Skip to content

ci(schema-canary): only check the countries whose pin changed on PRs - #1559

Merged
gabrielseco merged 1 commit into
mainfrom
ci/schema-canary-pr-changed-countries
Oct 15, 2026
Merged

gabrielseco merged 1 commit into
mainfrom
ci/schema-canary-pr-changed-countries

Conversation

@gabrielseco

@gabrielseco gabrielseco commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

On a pull request, the schema canary now only checks the countries whose contract_details pin changed, instead of every EOR country.

Why

  • A schema bump PR touches one country's pin, but the PR canary seeded and checked all of them, which is slow and exposes it to sandbox rate-limit flakes on unrelated countries.

What changed

Toggle details
  • scripts/schema-canary/changed-countries.ts: compares jsonSchemaVersions.ts on HEAD^1 (the base in the PR merge commit) with HEAD and prints the countries whose pin changed, all, or none. It prints all whenever any other file changed, so edits to the canary, the form-building code or package.json still run every country.
  • schema-canary.ts: --country now accepts a comma-separated list.
  • schema-canary.yml: the PR job fetches 2 commits, runs the picker, and passes the result to --country; with none (for example a comment-only edit) the canary step is skipped.
  • The main and nightly canary still check every country.
  • No public API change.

Screenshots

N/A

Related Resources

Testing

  • changed-countries.test.ts covers parsing, a single and multiple changed pins, no change, and a newly pinned country.
  • Confirm on a follow-up bump PR that only that country appears in the canary log (this PR itself runs all, since it touches the canary files).

🤖 Generated with Claude Code


Note

Low Risk
CI-only scope narrowing for PR jobs with a safe fallback to the full canary when non-pin files change; no runtime or public API impact.

Overview
PR schema canary runs only countries whose contract_details pin changed, instead of every EOR country—cutting PR runtime and unrelated sandbox flakes.

A new scripts/schema-canary/changed-countries.ts compares jsonSchemaVersions.ts between HEAD^1 and HEAD and prints a comma-separated country list, all (if any non-versions file changed or versions didn’t change), or none. The PR workflow checks out two commits, runs that picker, skips the canary when output is none, and passes the scope into npm run schema-canary. schema-canary.ts now treats --country as a comma-separated list when filtering sandbox countries. Main and nightly jobs are unchanged (still full runs). Unit tests cover pin parsing and diff detection.

Reviewed by Cursor Bugbot for commit 5188322. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

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-oq6yzbldx-remotecom.vercel.app
Latest Commit:5188322

Deployed with vercel-action

@github-actions

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-1dk0rlymf-remotecom.vercel.app
Latest Commit:5188322

Deployed with vercel-action

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage Report

⚪ Coverage unchanged

Metric Current Previous Change Status
Lines 89.58% 89.58% 0% ⚪
Statements 89.46% 89.46% 0% ⚪
Functions 88.47% 88.47% 0% ⚪
Branches 81.21% 81.21% 0% ⚪

Detailed Breakdown

Lines Coverage
  • Covered: 5393 / 6020
  • Coverage: 89.58%
  • Change: 0% (0 lines)
Statements Coverage
  • Covered: 5458 / 6101
  • Coverage: 89.46%
  • Change: 0% (0 statements)
Functions Coverage
  • Covered: 1427 / 1613
  • Coverage: 88.47%
  • Change: 0% (0 functions)
Branches Coverage
  • Covered: 3345 / 4119
  • Coverage: 81.21%
  • Change: 0% (0 branches)

✅ Coverage check passed

@gabrielseco
gabrielseco merged commit b612fb8 into main Oct 15, 2026
17 checks passed
@gabrielseco
gabrielseco deleted the ci/schema-canary-pr-changed-countries branch October 15, 2026 09:26
@gabrielseco gabrielseco mentioned this pull request Oct 16, 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.

2 participants