Skip to content

fix(ci): add gate jobs so required checks pass on changeset PRs#2918

Merged
amikofalvy merged 1 commit intomainfrom
fix/ci-gate-jobs-changeset-prs
Mar 30, 2026
Merged

fix(ci): add gate jobs so required checks pass on changeset PRs#2918
amikofalvy merged 1 commit intomainfrom
fix/ci-gate-jobs-changeset-prs

Conversation

@amikofalvy
Copy link
Copy Markdown
Collaborator

Summary

  • The changeset-check optimization from perf(ci): skip container init for changeset PRs #2902 skips the heavy ci, Cypress E2E Tests, and Create Agents E2E Tests jobs on changeset PRs. But those job names are required branch-protection checks, so skipping them leaves the Version Packages PR (Version Packages #2914) in UNSTABLE state — it can't be merged.
  • Adds lightweight gate jobs on ubuntu-latest that 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

Required check name Heavy job (skipped on changeset PRs) Gate job (always runs)
ci ci-run ci
Create Agents E2E Tests create-agents-e2e-run create-agents-e2e
Cypress E2E Tests cypress-e2e-run cypress-e2e

Test plan

  • Verify this PR's own CI gate jobs report SUCCESS
  • After merge, confirm the Version Packages PR (Version Packages #2914) shows all required checks passing

🤖 Generated with Claude Code

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]>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Mar 30, 2026 9:34pm
agents-docs Ready Ready Preview, Comment Mar 30, 2026 9:34pm
agents-manage-ui Ready Ready Preview, Comment Mar 30, 2026 9:34pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 30, 2026

⚠️ No Changeset found

Latest commit: 4d406a3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@amikofalvy amikofalvy enabled auto-merge March 30, 2026 21:31
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

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.

Pullfrog  | View workflow run | Using Claude Opus𝕏

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented Mar 30, 2026

TL;DR — Branch-protection required checks (ci, Create Agents E2E Tests, Cypress E2E Tests) were being skipped on changeset PRs, preventing the Version Packages PR from merging. This adds lightweight gate jobs that always run and carry the required check names, passing through the real job's result.

Key changes

  • Rename heavy jobs and add gate jobs in ci.yml — Renames cici-run and create-agents-e2ecreate-agents-e2e-run, then adds two new always-running gate jobs (ci, create-agents-e2e) on ubuntu-latest that forward the real job's pass/fail status.
  • Rename heavy job and add gate job in cypress.yml — Renames cypress-e2ecypress-e2e-run and adds a cypress-e2e gate job with the same pattern, satisfying the Cypress E2E Tests required check.

Summary | 2 files | 1 commit | base: mainfix/ci-gate-jobs-changeset-prs


Gate jobs for branch protection on changeset PRs

Before: The changeset-check optimization from #2902 skipped ci, create-agents-e2e, and cypress-e2e jobs on changeset PRs, but those job names were required branch-protection checks — leaving the Version Packages PR (#2914) stuck in UNSTABLE.
After: Heavy jobs are renamed with a -run suffix. New gate jobs reclaim the original required-check names, always run on ubuntu-latest, and only fail if the real job reported failure or cancelled.

The pattern is identical across all three gate jobs: needs both changeset-check and the -run job, runs with if: always(), and checks needs.<run-job>.result to propagate failures. When the heavy job is skipped (changeset PRs), the gate job succeeds automatically since skipped is not treated as failure.

Why not just remove the required checks from branch protection? Those checks guard against real regressions on non-changeset PRs. Removing them would weaken CI coverage. The gate-job pattern preserves the protection while allowing changeset PRs to skip expensive work.

.github/workflows/ci.yml · .github/workflows/cypress.yml

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Claude Opus𝕏

Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

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:

  1. Renames heavy jobs to *-run variants (e.g., cici-run)
  2. Adds lightweight gate jobs with the original required check names
  3. Gate jobs run on cheap ubuntu-latest runners with if: always()
  4. Gate jobs pass when heavy jobs are skipped (changeset PRs) or succeed
  5. 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 skipped state (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

@github-actions github-actions Bot deleted a comment from claude Bot Mar 30, 2026
@amikofalvy amikofalvy added this pull request to the merge queue Mar 30, 2026
Merged via the queue into main with commit e91b902 Mar 30, 2026
24 of 25 checks passed
@amikofalvy amikofalvy deleted the fix/ci-gate-jobs-changeset-prs branch March 30, 2026 21:56
tim-inkeep pushed a commit that referenced this pull request Mar 31, 2026
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]>
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