Repository navigation
feat(schema-canary): run only the affected countries on PRs - #1483
gabrielseco wants to merge 2 commits into
Conversation
npm run schema-canary:affected -- --base=<ref> diffs the branch against its base: - When only per-country entries changed (a pinned version in jsonSchemaVersions.ts, a seed in contract-details-seeds.ts, a KNOWN_UNSAVED_FIELDS entry), it returns just those countries. It loads the base and head versions of each file and compares country by country. - Any other change to something the canary reads returns all. - Files the canary doesn't read (docs, schemaVersions.ts) are ignored. The PR job runs the canary for that list, skips it when the list is empty, and runs every country for all. --country now takes a comma-separated list. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (291 total)
✅ Bundle size check passed |
|
Deploy preview for adp-cost-calculator ready!
Deployed with vercel-action |
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
📊 Coverage Report⚪ Coverage unchanged
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3761b06. Configure here.
| 'example/playwright.canary.config.ts', | ||
| '.github/actions/schema-canary-browser/', | ||
| '.github/workflows/schema-canary.yml', | ||
| ]; |
There was a problem hiding this comment.
Shared canary deps treated as unrelated
Medium Severity
ALL_COUNTRIES_PATHS omits modules the canary actually loads when building and submitting forms, including src/flows/utils.ts and src/lib/. A PR that edits those together with a pinned version, seed, or KNOWN_UNSAVED_FIELDS entry is classified as country-scoped, so the other countries never get checked.
Reviewed by Cursor Bugbot for commit 3761b06. Configure here.
|
Dropped: the canary checks all 92 countries (pinned + submit) in about 2 minutes, so narrowing PR runs to the affected countries isn't worth the extra script and the risk of skipping a country that needed checking. #1484 now sits directly on #1491. Branch kept in case this is needed later. [by Claude] |


Summary
On PRs, the canary now checks only the countries a change affects: bumping one country's pinned version checks just that country, while changes to shared code still check all of them.
Why
What changed
Toggle details
npm run schema-canary:affected -- --base=<ref>diffs the branch against its base:jsonSchemaVersions.ts, a seed, aKNOWN_UNSAVED_FIELDSentry): returns just those countries. It loads the base and head versions of each file and compares them country by country.all.schemaVersions.ts) are ignored.The PR job checks out full history, runs it, skips the canary when the list is empty, and passes the list via
--country, which now takes a comma-separated list.Screenshots
N/A
Related Resources
Testing
Tested against the
example/app in a browser: N/AFeature flag: N/A
Unit tests:
scripts/schema-canary/affected-countries.test.ts.On a fake CHN version bump plus a README edit, the script returns
CHNonly.This PR changes the canary itself, so its own job runs every country.
🤖 Generated with Claude Code
Note
Medium Risk
CI may skip or narrow contract-details sandbox validation based on heuristics; misclassification could miss a country, though shared/canary code changes still run all countries.
Overview
PR schema canary jobs on pull requests now scope sandbox checks to countries the diff actually touches, instead of always running every EOR country.
A new
schema-canary:affectedflow diffs the branch against--base, loads before/after exports for country-scoped files (jsonSchemaVersions, contract seeds, known unsaved fields), and returns a comma-separated country list,all, or nothing. Changes under shared canary/onboarding paths still forceall.The PR workflow checks out full history, runs that script, skips the canary when no countries apply, and passes the result into
schema-canaryvia--country, which now accepts a comma-separated list. Nightly runs are unchanged.Reviewed by Cursor Bugbot for commit dee0d8f. Bugbot is set up for automated code reviews on this repo. Configure here.