ci: discover mzcompose compositions via Git in the lint check - #38778
Open
antiguru wants to merge 1 commit into
Open
ci: discover mzcompose compositions via Git in the lint check#38778antiguru wants to merge 1 commit into
antiguru wants to merge 1 commit into
Conversation
The `check_all_files_referenced_in_ci` check listed compositions with a bare `find . -name mzcompose.py`, which descends into gitignored directories. A checkout nested inside the repository, such as a Git worktree or a build directory, therefore contributes its own copies of every composition. The exclusion list did not suppress them because each entry is anchored at the repository root, so the check reported `cli`, `monitoring`, `canary-environment`, `mzcompose_examples` and `get-cloud-hostname` as unreferenced, plus any composition that exists in the nested checkout's revision but not in the current pipeline templates. Use `git_files` from `shlib.bash` instead, the same helper and pattern that `check-python-files.sh` already uses for mzcompose files. It relies on Git to resolve gitignore rules, so it sees exactly the compositions that `mzbuild.Repository` discovers when it builds them. The exclusion list moves into an array that filters the result by exact path. One behavior difference follows from the helper: `git_files` reports tracked files only, so a newly created composition is checked once it is staged rather than as soon as the file exists. CI always operates on a tracked checkout, so coverage there is unchanged. 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.
The
check_all_files_referenced_in_cicheck incheck-mzcompose-files.shlisted compositions with a barefind . -name mzcompose.py, which descends into gitignored directories. A checkout nested inside the repository, such as a Git worktree or a build directory, therefore contributes its own copies of every composition. The exclusion list did not suppress them, because each entry is anchored at the repository root and the nested copies live under a different prefix. The check then reportedcli,monitoring,canary-environment,mzcompose_examplesandget-cloud-hostnameas unreferenced, plus any composition that exists in the nested checkout's revision but not in the current pipeline templates. CI is unaffected, since its checkout holds no nested repository, but the check cannot pass locally for anyone who keeps a worktree inside the repository.This replaces the
findwithgit_filesfromshlib.bash, the same helper and the same'**/mzcompose.py'pattern thatcheck-python-files.shalready applies to mzcompose files. Git resolves the gitignore rules, so the check sees exactly the compositions thatmzbuild.Repositorydiscovers throughgit.expand_globswhen it builds them. The exclusion list moves into an array that filters the result by exact path, which keeps the per-entry comments and drops the./prefix thefindpredicates needed.One behavior difference follows from the helper.
git_filesreports tracked files only, so a newly created composition is checked once it is staged rather than as soon as the file exists. CI always operates on a tracked checkout, so coverage there does not change.The change is confined to a CI lint check, so it adds no tests and needs no release note.
🤖 Generated with Claude Code