Repository navigation
fix(drift-check): resolve default config from meta repo [skip version] - #200
Open
abhicodes-007 wants to merge 1 commit into
Open
abhicodes-007 wants to merge 1 commit into
abhicodes-007 wants to merge 1 commit into
Conversation
The default drift-check config was resolved against the process cwd, so running the checker from a tool repo silently used permissive defaults while CI enforced required workflows. Resolve it from meta_repo_path and warn when the default file is missing. Regression tests run the CLI from a different cwd with and without a meta config. Full suite: 354 passed, 2 skipped. Sabotage run of the fix made both tests fail. Closes TMHSDigital#153 Signed-off-by: Abhishek Deepak <abhicodes-007@users.noreply.github.com>
2 tasks
This branch has not been deployed
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
drift_checkresolved its default config withPath("standards/drift-checker.config.json"), i.e. against the process cwd. CI only worked because the composite action setsworking-directory: .drift-checker. Running the CLI from a tool repo loaded permissive defaults: norequired_workflows, noskip_checks, and no warning, so the same repo passed locally and failed in CI.Approach
When no
--configis given,_build_snapshotsnow resolves the default frommeta_repo_path / "standards" / "drift-checker.config.json", the same base used forrequired-refs.json. If that file is absent, the CLI prints a warning naming the path and continues with the existing permissive defaults. Explicit--configpaths are unchanged.Tests
Added
tests/test_issue_153_config_cwd.py:required workflow 'validate.yml' is absent(rc 1);Both fail on
mainwith the exact permissive-cwd symptom and pass with the fix. Sabotaging the fix made both tests fail again. Full suite: 354 passed, 2 skipped. The new test file passes Ruff;cli.pyhas 18 pre-existing Ruff findings, unchanged by this diff.Risk
Low. Only the no-
--configpath changes; callers that pass--configsee identical behavior.[skip version]is in the title because this repo's validate workflow requires a VERSION bump forfix:PRs.Closes #153