Skip to content

Fix parent config discovery on POSIX paths - #190

Open
Kulraj69 wants to merge 3 commits into
leopardslab:masterfrom
Kulraj69:fix-posix-parent-config
Open

Kulraj69 wants to merge 3 commits into
leopardslab:masterfrom
Kulraj69:fix-posix-parent-config

Conversation

@Kulraj69

Copy link
Copy Markdown

Proposed Changes

Running Nodecloud from a nested working directory on Linux or macOS fails to find .nc.config.js in a parent directory. The existing lookup splits process.cwd() on backslashes, so it only walks ancestors for Windows-style paths.

  • Walk parent directories with path.dirname() instead of splitting path separators.
  • Keep nearest-config precedence, check the filesystem root once, and preserve the missing-config error.
  • Add regression coverage for nested POSIX, Windows drive and UNC paths, root configs, and missing configs. Include a real child-process test from a temporary nested working directory with a local stub provider.

Related historical context: #31 and #40 established ancestor config discovery for Windows. This corrects its POSIX behavior rather than changing where configs are intended to be found.

Validation

  • Original source: 3 of the 9 new regression tests fail.
  • Fixed common-package suite: 12 passing on Node 12.22.12 and Node 22.23.5.
  • Patch reapplied to a fresh copy of the fetched source archive: 12 common-package tests pass on Node 22.23.5.
  • JavaScript syntax checks and patch whitespace check pass. The new test follows the repository's Prettier 1.15.3 configuration; the runtime file keeps its existing style.

Windows drive and UNC behavior are simulated with path.win32, not native Windows runs. No full monorepo/generator suite, remote CI, cloud calls or credentials were used in these local tests.

A separate QA review was requested but no result was returned after six hours. The validation above is local testing, not independent QA approval.

AI assistance was used to develop the patch and tests.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant