ci: wire codemod --check suite + bundle gate into GitHub Actions#40
Closed
adm01-debug wants to merge 1 commit into
Closed
ci: wire codemod --check suite + bundle gate into GitHub Actions#40adm01-debug wants to merge 1 commit into
adm01-debug wants to merge 1 commit into
Conversation
Adds a regression gate that runs every codemod's --check mode on each PR, preventing reintroduction of categories already cleaned up (no-duplicate-imports, eqeqeq non-null, no-unused-vars, no-explicit- any safe patterns, lucide barrel imports) and the bundle-size budget (per-chunk gzip ≤ 500 kB). ## scripts/run-codemod-checks.mjs (new) Aggregating runner that invokes each codemod's --check mode in sequence and prints a unified pass/fail/skipped table. Designed to be tolerant of in-flight branches: codemod scripts that haven't landed on main yet (PRs #34, #36, #37, #38) are reported as 'skipped', not failures, so this PR can merge in any order with the codemod PRs and the gate progressively activates as each one lands. Default mode: missing scripts → skipped (exit 0) --strict mode: missing scripts → fail (exit 1) The CI workflow uses default mode. ## .github/workflows/lint-codemods.yml (new) Triggered on PRs that touch src/, the codemod scripts, eslint config, or package files. Two steps: 1. npm run check:codemods — codemod --check suite 2. Bundle size budget — defensive: skipped if scripts/bundle-analysis.mjs is absent, runs the --check mode otherwise ## package.json — npm script aliases check:codemods — orchestrator (used by CI) check:duplicate-imports — codemod-merge-duplicate-imports.mjs --check check:strict-equality — codemod-strict-equality.mjs --check check:unused-vars — codemod-unused-vars.mjs --check check:any-to-unknown — codemod-any-to-unknown.mjs --check check:lucide-imports — codemod-lucide-imports.mjs --check ## Validation YAML python yaml.safe_load → OK Default mode exit 0 (5 skipped on this branch — codemods not landed yet) --strict mode exit 1 (5 'fail (script missing)' as expected) When PRs #34/#36/#37/#38 merge, the corresponding entries flip from 'skipped' to 'OK' on the next CI run, and any future regression flips them to 'FAIL', blocking the offending PR.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Adds a regression gate that runs every codemod's
--checkmode on each PR, preventing reintroduction of categories already cleaned up (no-duplicate-imports,eqeqeqnon-null,no-unused-vars,no-explicit-anysafe patterns, lucide barrel imports) and the bundle-size budget (per-chunk gzip ≤ 500 kB).Why
PRs #34 (bundle gate), #36 (eqeqeq cleanup), #37 (unused-vars cleanup), #38 (any→unknown cleanup), and the earlier #29 (eslint config + auto-fix) collectively cleared ~700 ESLint problems from the codebase. Without an enforcement gate, those gains regress on the next push that introduces a new
==or unused import.This PR is the gate. It's deliberately tolerant of in-flight codemod PRs so it can merge in any order with #34/#36/#37/#38 and progressively activate.
What's added
scripts/run-codemod-checks.mjsAggregating runner that invokes each codemod's
--checkmode in sequence and prints a unified pass/fail/skipped table:Two modes:
skipped--strictfail (script missing)CI uses default mode for tolerance to merge order.
.github/workflows/lint-codemods.ymlTriggered on PRs touching
src/, codemod scripts, eslint config, or package files. Two steps:npm run check:codemods)scripts/bundle-analysis.mjs --check) — defensive: skipped if the script is absent, runs once it landspackage.json— npm script aliasesValidation
--strictmodefail (script missing)as expected)When #34/#36/#37/#38 merge, the corresponding entries flip from
skippedtoOKon the next CI run, and any future regression flips them toFAIL, blocking the offending PR.https://claude.ai/code/session_01KWeDG
Generated by Claude Code