fix(workflows): match overlay file extensions case-insensitively - #4531
Open
jawwad-ali wants to merge 1 commit into
Open
fix(workflows): match overlay file extensions case-insensitively#4531jawwad-ali wants to merge 1 commit into
jawwad-ali wants to merge 1 commit into
Conversation
`ProjectOverlaySource.collect` matched `path.suffix` verbatim:
if not path.is_file() or path.suffix not in (".yml", ".yaml"):
continue
so a hand-placed overlay named `<id>.YML` or `<id>.Yaml` was skipped and never
applied, with nothing reported to say the file had been ignored. Overlay files
are explicitly hand-authored (docs/reference/workflows.md documents the format
and tells users to write them), so the casing is the author's choice.
Reproduced on main -- three overlays in one directory, differing only in
extension case:
files on disk: ['Mixed.Yaml', 'UPPER.YML', 'lower.yml']
COLLECTED : ['lower']
SKIPPED : ['mixed', 'upper']
Every other YAML discovery path in the package already lowercases before
matching: engine.py:941, _commands.py:1325, :1894, :2128. This brings the
overlay loader in line with them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ProjectOverlaySource.collectmatches the extension verbatim:So a hand-placed overlay named
<id>.YMLor<id>.Yamlis skipped and never applied — and nothing is reported to say the file was ignored. Overlay files are explicitly hand-authored (docs/reference/workflows.mddocuments the format and tells users to write them), so the extension casing is the author's choice, not something the tool generated.Reproduction on current
main(c173bf1)Three overlays in one directory, differing only in extension case:
The author gets no error and no warning — the overlay simply has no effect.
Why this is the odd one out
Every other YAML discovery path in the package already lowercases before matching:
workflows/engine.py:941path.suffix.lower() in (".yml", ".yaml")workflows/_commands.py:1325source_path.suffix.lower() in (...)workflows/_commands.py:1894dev_path.suffix.lower() in (...)workflows/_commands.py:2128source_path.suffix.lower() in (...)overlays/layer_sources.py:150path.suffix in (...)← this PRFix
Scope note
overlays/_commands.py:115(_find_overlay_file) carries the identical case-sensitive pattern. I have deliberately not touched it here: an open PR of mine (#4141) already modifies that file, and combining the two would create a needless conflict. Happy to follow up with it once #4141 lands, or to fold it in here if you would rather see both together.Verification
upstream/main→ passing with the fix..YML,.Yaml,.YAML,.Yml.notes.txt,backup.yml.bak,README.mdanddata.jsonare still skipped.tests/workflows: no new failures vs a clean-mainself-baseline (10 pre-existing, Windows symlink-privilege).uvx ruff@0.15.0 check src tests→ cleanBehaviour change, disclosed: files previously skipped now get read. If a project already holds a
.YML/.YAMLfile in an overlay directory that is not a valid overlay manifest, resolution will now report it rather than ignoring it — which is the intended outcome, but it is a change for such a project.Written with assistance from Claude Code. Bug found, reproduced, and verified by me on current
main.🤖 Generated with Claude Code