Repository navigation
fix(pipeline): skip an unreadable subdirectory in the control-file walk instead of aborting the whole index - #2085
Conversation
…lk instead of aborting the whole index semantic_manifest_walk_controls() returns CBM_NOT_FOUND the moment cbm_opendir() fails on any subdirectory, and that propagates all the way up through cbm_pipeline_build_semantic_manifest(), aborting the entire index_repository run. discover.c's walk_dir() already treats the same failure (a permission-denied directory it can't open) as "nothing to discover here" and moves on. The control walk has no reason to be stricter: it only looks for .gitignore/.cbmignore/package-manifest files, which a locked-out directory simply doesn't contribute. Skip it and keep walking, except at depth 0, where an inaccessible manifest root is still a real error (pipeline_semantic_manifest_rejects_non_directory_root pins that). Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thank you for the focused control-file walk change and the pipeline test. We need more time to review how an unreadable directory should affect indexing and exclusion handling before giving a decision. The review queue is currently full, so detailed feedback may take a little time. We are working through it carefully and appreciate the work you have put into supporting the project. Thank you for your patience. |
|
The test-windows-guards failure is the same pre-existing section_cold_storm issue as its sibling PR #2084, unrelated to this diff. Anything else needed here? |
|
Thank you for asking what is still needed. The current recursive control-file walk aborts when an |
|
Thanks again for the focused unreadable-subdirectory case. There is still no additional contributor task from this triage: the exclusion/error-semantics review and CI attribution remain maintainer responsibilities. The separate diagnostic issue #2020 remains outside this change. |
Brings the branch up to date with main a222715. One conflict, in semantic_manifest_walk_controls() (src/pipeline/pipeline_incremental.c): main had reformatted the old `if (!dir) return CBM_NOT_FOUND;` into a brace-less form. Resolved by keeping the branch's hunk verbatim -- a nested directory that cannot be opened is skipped, the root call (depth 0) still fails closed -- so the change under review is unchanged. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you, @AmirF194, and sorry this sat for so long after the go-ahead. The fix is exactly the right size: a nested directory the walk cannot open has no control files to contribute, so skipping it matches what discovery already does, while the root call (depth 0) still fails closed. The test is well chosen too, with a locked directory next to a readable sibling whose What we changed on your branch, so you know what landed:
That is the only change. Before pushing it we checked the merged tree by indexing a directory with one subdirectory locked to mode 0: with the old code the run aborts and publishes nothing, with your fix it indexes normally. Your new test fails against the old code and passes with yours. We will merge once CI is green on the new head. Thanks again for tracking this down from #2001 and for keeping the separate diagnostics issue (#2020) out of this change. |
Picking up from the thread on #2001: the abort happens after discovery finishes clean, in
cbm_pipeline_build_semantic_manifest's own control-file walk.semantic_manifest_walk_controlsrecursively walks the whole repo looking for.gitignore/.cbmignore/package-manifest files. When it hits thelockeddirectory andcbm_opendirfails, it returnsCBM_NOT_FOUND, which propagates all the way up and aborts the entire index.discover.c'swalk_diralready treats the identical failure as "nothing to discover here" and moves on; the control walk had no reason to be stricter; a permission-denied subdirectory just has no control files to contribute.Fix skips a nested directory it can't open instead of failing the whole walk. The root call still fails closed (depth 0), so
pipeline_semantic_manifest_rejects_non_directory_rootkeeps passing unchanged.Added
pipeline_semantic_manifest_skips_unreadable_subdirectory: a locked sibling next to a readable one, asserts the walk succeeds and still finds the sibling's.gitignore. Needs a non-root run to mean anything, since root ignores the chmod and the check would be a no-op (same reasoning astest_cli.c's existing root-demotion comment); verified that way in a container both ways.Not fixed here, and worth flagging so it doesn't get lost:
#2020is the separate issue about the genericerrorhint collapsing distinct failure codes. It's real and independent of this one; I only touched the abort itself.Fixes #2001