Skip to content

fix(validator): skip deleted YAMLs in PR diff - #5

Merged
nabeelio merged 1 commit into
mainfrom
fix/validate-skip-deleted
May 5, 2026
Merged

fix(validator): skip deleted YAMLs in PR diff#5
nabeelio merged 1 commit into
mainfrom
fix/validate-skip-deleted

Conversation

@nabeelio

@nabeelio nabeelio commented May 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Validator was including deleted YAML paths in its check list and crashing with ENOENT when runPackageChecks tried to read the (now missing) file.
  • Fix: git diff --diff-filter=ACMRT so deleted (D) entries never reach the checker. Renamed/copied entries already surface their new path under these letters.
  • Refactor changedYamlFiles into a pure filterPackageYamlPaths helper so the path filter is unit-testable without a git repo. Gate main() on direct execution so the test file can import the helper.

Test plan

  • New scripts/tests/changed-yaml-files.test.ts covers added/modified/deleted/renamed cases (5 tests).
  • npm test now reports 107/107 passing (was 102/102).
  • Validator on this PR (which only touches scripts/) should be a no-op since it changes no YAMLs.

Caught while exercising task 12.7 of bootstrap-addon-registry \u2014 the smoke-test fixture removal PR #4.

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

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@nabeelio has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 58 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: a45d5438-3a6f-4198-8fc7-e18718086d0d

📥 Commits

Reviewing files that changed from the base of the PR and between 186fb37 and 70eacf2.

📒 Files selected for processing (2)
  • scripts/tests/changed-yaml-files.test.ts
  • scripts/validate.ts

Note

🎁 Summarized by CodeRabbit Free

Your 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 @coderabbitai help to get the list of available commands and usage tips.

@nabeelio
nabeelio merged commit 0db278f into main May 5, 2026
2 checks passed
@nabeelio
nabeelio deleted the fix/validate-skip-deleted branch May 5, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant