Context
#1 implemented dagger/dagger#13688 and documents that findConfigDirs returns the nearest enclosing project. While reviewing dagger/typescript-sdk#11, a nested mixed-filename layout exposed that parentConfigDir instead accepts the first successful findUp in filename order.
Reproduction
Signed-off failing integration test: grouville@cbefe1a
git clone https://github.com/dagger/polyfill.git
cd polyfill
git fetch https://github.com/grouville/polyfill.git repro/nearest-mixed-config
git cherry-pick cbefe1ac5f72d91c763774b85f7d25c9a4c5a93c
dagger --x-release=v1.0.0-beta.7 check e-2-e:find-config-dirs-nearest-mixed-filename-check --progress=plain
The test constructs:
parent/
├── deno.json
└── child/
├── deno.jsonc
└── nested/ # cwd
with filenames ordered as ["deno.json", "deno.jsonc"].
Expected: [".."], resolving to the nearer parent/child project.
Actual: ["../.."], resolving to parent, because the farther deno.json is checked first.
The lookup should compare all successful findUp results and select the closest ancestor regardless of filename order.
Context
#1 implemented dagger/dagger#13688 and documents that
findConfigDirsreturns the nearest enclosing project. While reviewing dagger/typescript-sdk#11, a nested mixed-filename layout exposed thatparentConfigDirinstead accepts the first successfulfindUpin filename order.Reproduction
Signed-off failing integration test: grouville@cbefe1a
The test constructs:
with filenames ordered as
["deno.json", "deno.jsonc"].Expected:
[".."], resolving to the nearerparent/childproject.Actual:
["../.."], resolving toparent, because the fartherdeno.jsonis checked first.The lookup should compare all successful
findUpresults and select the closest ancestor regardless of filename order.