Skip to content

feat(schema-canary): run only the affected countries on PRs - #1483

Closed
gabrielseco wants to merge 2 commits into
feat/schema-canary-submitfrom
feat/schema-canary-affected
Closed

gabrielseco wants to merge 2 commits into
feat/schema-canary-submitfrom
feat/schema-canary-affected

Conversation

@gabrielseco

@gabrielseco gabrielseco commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Most canary PRs are single-country version bumps. Running all 92 countries for those wastes time and sandbox load.

What changed

Toggle details

npm run schema-canary:affected -- --base=<ref> diffs the branch against its base:

  • Only per-country entries changed (a pinned version in jsonSchemaVersions.ts, a seed, a KNOWN_UNSAVED_FIELDS entry): returns just those countries. It loads the base and head versions of each file and compares them country by country.
  • Anything else the canary reads changed: returns all.
  • Files the canary doesn't read (docs, 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/A

  • Feature 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 CHN only.

  • 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:affected flow 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 force all.

The PR workflow checks out full history, runs that script, skips the canary when no countries apply, and passes the result into schema-canary via --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.

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>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 228.91 kB 228.91 kB 0 B (0%) 🟢
Total (raw) 637.74 kB 637.74 kB 0 B (0%) 🟢
CSS (gzip) 21.94 kB 21.94 kB 0 B (0%) 🟢
CSS (raw) 114.43 kB 114.43 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 228.91 kB / 350 kB (65.4%)
  • ✅ Total raw: 637.74 kB / 850 kB (75.0%)
  • ✅ CSS gzipped: 21.94 kB / 25 kB (87.8%)

Largest Files (Top 5)

  1. index.esm-wIkXrqU6.js - 11.4 kB (0 B (0%))
  2. styles.css - 10.97 kB (0 B (0%))
  3. index.css - 10.97 kB (0 B (0%))
  4. internals-Bfee4wlS.js - 6.12 kB (0 B (0%))
  5. hooks-B1CnEL_O.js - 5.84 kB (0 B (0%))
View All Files (291 total)
File Size (gzip) Change
index.esm-wIkXrqU6.js 11.4 kB 0 B (0%)
styles.css 10.97 kB 0 B (0%)
index.css 10.97 kB 0 B (0%)
internals-Bfee4wlS.js 6.12 kB 0 B (0%)
hooks-B1CnEL_O.js 5.84 kB 0 B (0%)
sdk.gen-FtLNfTcH.js 5.54 kB 0 B (0%)
index.js 5.51 kB 0 B (0%)
flows/Onboarding/hooks.js 4.52 kB 0 B (0%)
utils-CUgvJHl4.js 4.07 kB 0 B (0%)
FieldSetField-CDERaaih.js 4.03 kB 0 B (0%)

✅ Bundle size check passed

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-j5j4ebgky-remotecom.vercel.app
Latest Commit:dee0d8f

Deployed with vercel-action

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-7n4dt20lb-remotecom.vercel.app
Latest Commit:dee0d8f

Deployed with vercel-action

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

⚪ Coverage unchanged

Metric Current Previous Change Status
Lines 89.33% 89.33% 0% ⚪
Statements 88.88% 88.88% 0% ⚪
Functions 88.09% 88.09% 0% ⚪
Branches 80.38% 80.38% 0% ⚪

Detailed Breakdown

Lines Coverage
  • Covered: 5256 / 5884
  • Coverage: 89.33%
  • Change: 0% (0 lines)
Statements Coverage
  • Covered: 5354 / 6024
  • Coverage: 88.88%
  • Change: 0% (0 statements)
Functions Coverage
  • Covered: 1405 / 1595
  • Coverage: 88.09%
  • Change: 0% (0 functions)
Branches Coverage
  • Covered: 3253 / 4047
  • Coverage: 80.38%
  • Change: 0% (0 branches)

✅ Coverage check passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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',
];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3761b06. Configure here.

Base automatically changed from ci/schema-canary to feat/schema-canary-submit October 9, 2026 05:51
@gabrielseco

Copy link
Copy Markdown
Collaborator Author

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]

@gabrielseco gabrielseco closed this Oct 9, 2026
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