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. |
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