fix(ci): add gate jobs so required checks pass on changeset PRs#2918
fix(ci): add gate jobs so required checks pass on changeset PRs#2918amikofalvy merged 1 commit intomainfrom
Conversation
The changeset-check optimization from #2902 skips the heavy ci, Cypress E2E, and Create Agents E2E jobs on changeset PRs. But those job names are required branch-protection checks, so skipping them leaves the Version Packages PR in UNSTABLE state. Add lightweight gate jobs that always run on ubuntu-latest and carry the required check names. They pass unless the real job failed, satisfying branch protection without spinning up expensive runners. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
There was a problem hiding this comment.
Clean fix. The gate job pattern is correct — if: always() ensures the gate runs regardless of whether the heavy job was skipped or executed, and the result check properly catches both failure and cancelled states. Job IDs and name: fields are aligned with the required branch-protection check names. No external references to the renamed jobs exist.
Claude Opus | 𝕏
|
TL;DR — Branch-protection required checks ( Key changes
Summary | 2 files | 1 commit | base: Gate jobs for branch protection on changeset PRs
The pattern is identical across all three gate jobs:
|
There was a problem hiding this comment.
PR Review Summary
(0) Total Issues | Risk: Low
Analysis
This PR implements a well-established GitHub Actions pattern for satisfying required branch-protection checks when the actual jobs are conditionally skipped.
What it does:
- Renames heavy jobs to
*-runvariants (e.g.,ci→ci-run) - Adds lightweight gate jobs with the original required check names
- Gate jobs run on cheap
ubuntu-latestrunners withif: always() - Gate jobs pass when heavy jobs are skipped (changeset PRs) or succeed
- Gate jobs fail only when heavy jobs fail or are cancelled
Why it's correct:
if: always()ensures gate jobs run regardless of upstream job state- The condition
needs.*.result == 'failure' || needs.*.result == 'cancelled'correctly propagates real failures - The
skippedstate (when changeset-check causes heavy jobs to skip) is intentionally NOT treated as failure — this is the core optimization - Branch protection sees the required check names (
ci,Create Agents E2E Tests,Cypress E2E Tests) always report a status
Edge cases handled:
- ✅ Normal PR → heavy jobs run → gate jobs pass (unless heavy fails)
- ✅ Changeset PR → heavy jobs skip → gate jobs pass (required checks satisfied)
- ✅ Failed heavy job → gate jobs fail → branch protection blocks merge
- ✅ Cancelled workflow → gate jobs fail → branch protection blocks merge
✅ APPROVE
Summary: Clean, well-commented implementation of the gate job pattern. This correctly unblocks the Version Packages PR (#2914) while preserving the CI cost optimization from #2902. No issues found.
Reviewers (1)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
pr-review-devops |
0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Total | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
The changeset-check optimization from #2902 skips the heavy ci, Cypress E2E, and Create Agents E2E jobs on changeset PRs. But those job names are required branch-protection checks, so skipping them leaves the Version Packages PR in UNSTABLE state. Add lightweight gate jobs that always run on ubuntu-latest and carry the required check names. They pass unless the real job failed, satisfying branch protection without spinning up expensive runners. Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Summary
ci,Cypress E2E Tests, andCreate Agents E2E Testsjobs on changeset PRs. But those job names are required branch-protection checks, so skipping them leaves the Version Packages PR (Version Packages #2914) inUNSTABLEstate — it can't be merged.ubuntu-latestthat always run and carry the required check names. They pass unless the real job failed, satisfying branch protection without spinning up expensive runners.How it works
cici-runciCreate Agents E2E Testscreate-agents-e2e-runcreate-agents-e2eCypress E2E Testscypress-e2e-runcypress-e2eTest plan
🤖 Generated with Claude Code