fix(validator): skip deleted YAMLs in PR diff - #5
Conversation
Without --diff-filter the validator picks up paths the PR removed and crashes with ENOENT in runPackageChecks when it tries to read them. Use --diff-filter=ACMRT so deleted entries never reach the checker; renamed/copied entries surface their new path which is what we want to validate. Refactor changedYamlFiles into a pure filterPackageYamlPaths helper so we can unit-test the path filter without a git repo. Also gate main() on direct execution so the test file can import the helper without the script auto-running. Caught while exercising task 12.7 of bootstrap-addon-registry: the smoke-test fixture removal PR (#4) failed validation with the ENOENT crash described above.
|
Warning Rate limit exceeded
To unlock additional reviews beyond the hourly cap, upgrade to Pro or higher. Account admins can upgrade under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (2)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary
ENOENTwhenrunPackageCheckstried to read the (now missing) file.git diff --diff-filter=ACMRTso deleted (D) entries never reach the checker. Renamed/copied entries already surface their new path under these letters.changedYamlFilesinto a purefilterPackageYamlPathshelper so the path filter is unit-testable without a git repo. Gatemain()on direct execution so the test file can import the helper.Test plan
scripts/tests/changed-yaml-files.test.tscovers added/modified/deleted/renamed cases (5 tests).npm testnow reports 107/107 passing (was 102/102).Caught while exercising task 12.7 of
bootstrap-addon-registry\u2014 the smoke-test fixture removal PR #4.