Skip to content

mirror: use FS.createPath (mkdirp) and verify parents; surface ENOENT cleanly#123

Merged
LennartvdM merged 1 commit into
mainfrom
codex/use-fs.createpath-for-mkdirp-safe-mirroring
Nov 12, 2025
Merged

mirror: use FS.createPath (mkdirp) and verify parents; surface ENOENT cleanly#123
LennartvdM merged 1 commit into
mainfrom
codex/use-fs.createpath-for-mkdirp-safe-mirroring

Conversation

@LennartvdM
Copy link
Copy Markdown
Owner

Summary

  • ensure mirror writes create parent directories via FS.createPath and verify them before writing
  • add parent diagnostics to mirror failures so missing folders surface as ParentDirMissing with errno/code details
  • initialize common /repo subdirectories on startup using the same recursive path helper

Testing

  • not run (not requested)

Codex Task

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 12, 2025

Deploy Preview for wyrrdmaek ready!

Name Link
🔨 Latest commit 8ca251c
🔍 Latest deploy log https://app.netlify.com/projects/wyrrdmaek/deploys/6914f461d6ad480008c5fbe5
😎 Deploy Preview https://deploy-preview-123--wyrrdmaek.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@LennartvdM LennartvdM merged commit 2c52756 into main Nov 12, 2025
5 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

const exists = analysis?.exists === true;
const isFolder = analysis?.object?.isFolder === true;
const normalizedAnalysis =
analysis && typeof analysis === 'object' ? { ...analysis, exists: !!analysis.exists, isFolder } : null;
if (!exists || !isFolder) {
const parentError = {

P0 Badge Fix parent directory validation

The new ensureParentDirectory gate checks analysis?.object?.isFolder === true to verify that the parent node is a directory. FS.analyzePath returns an FS node whose type is indicated by mode; it does not populate an isFolder boolean. As written, isFolder will always be false even when the path exists as a directory, so every call throws ParentDirMissing and mirror writes will fail immediately. Use instance.FS.isDir(analysis.object.mode) (or similar) to detect directories instead.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant