perf(ci): skip container init for changeset PRs#2902
Conversation
The changesets/action pushes commits using the default GITHUB_TOKEN credential, which GitHub ignores for triggering downstream workflows. This left the Version Packages PR (#2881) stuck with required checks (ci, Cypress E2E, Create Agents E2E) permanently waiting. Configures the git remote URL with the inkeep-internal-ci App token before changesets/action runs — same pattern applied to ci.yml and auto-format.yml in #2871. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Service containers (Doltgres, Postgres) in cypress-e2e and create-agents-e2e were initialized before the changeset check ran, wasting ~30s of ubuntu-32gb runner time on every changeset PR. Extracts the changeset check into a lightweight job on ubuntu-latest that runs first. The heavy jobs now depend on it via `needs:` and skip entirely (including container init) when it's a changeset PR. Also removes all redundant step-level `if: changeset-check` guards since the job-level `if` already gates everything. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
TL;DR — Changeset PRs no longer allocate expensive Key changes
Summary | 4 files | 3 commits | base: Reusable composite action for changeset detection
The composite action uses a sparse checkout (
Lightweight job gates heavy CI runners
This saves ~30s of
App token for release workflow git pushes
|
There was a problem hiding this comment.
Clean refactor — the approach is sound. Extracting the changeset check into a lightweight ubuntu-latest job avoids allocating ubuntu-32gb runners and spinning up service containers for changeset PRs. One behavioral change to be aware of regarding required status checks (see inline comment).
Claude Opus | 𝕏
|
|
||
| ci: | ||
| needs: changeset-check | ||
| if: needs.changeset-check.outputs.is_changeset != 'true' |
There was a problem hiding this comment.
Required status check interaction: Previously, ci always reported "success" (steps were individually skipped). Now it reports "skipped" when the changeset check fires. If ci, create-agents-e2e, or cypress-e2e are required status checks in branch protection, verify that your GitHub settings treat skipped checks as passing — this is the default for newer repos but may not be configured here. If not, changeset PRs will be blocked from merging.
Same applies to create-agents-e2e (line 302) and cypress-e2e in cypress.yml (line 86).
| # changesets/action trigger downstream CI workflows. Without this, the | ||
| # push uses the default GITHUB_TOKEN which GitHub ignores for triggering. | ||
| - name: Configure git remote with App token | ||
| run: git remote set-url origin "https://x-access-token:${APP_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" |
There was a problem hiding this comment.
This is a separate fix from the changeset-skip optimization — configuring the git remote with the App token so changesets/action pushes trigger downstream CI. Worth calling out in the PR description that this is bundled in, since it's unrelated to the container-init skip.
There was a problem hiding this comment.
PR Review Summary
(1) Total Issues | Risk: Low
🟠⚠️ Major (1) 🟠⚠️
🟠 1) ci.yml, cypress.yml Duplicated changeset-check logic across workflows
files:
Issue: The changeset-check job script is nearly identical across both workflows (~60 lines of shell script). This violates DRY and increases maintenance burden when the detection logic needs updating.
Why: When the changeset detection logic needs to change (e.g., adding new branch patterns, fixing edge cases), both workflows must be updated in sync. Having two copies doubles the risk of drift and bugs. The detection logic already has several conditions (branch name check, merge group PR lookup, changed files analysis) that have evolved over time.
Fix: Extract the changeset-check logic into a reusable composite action at .github/composite-actions/changeset-check/action.yml with an is_changeset output. Both workflows can then reference it:
changeset-check:
runs-on: ubuntu-latest
outputs:
is_changeset: ${{ steps.check.outputs.is_changeset }}
steps:
- uses: ./.github/composite-actions/changeset-check
id: checkRefs:
🧹 While You're Here (1) 🧹
Inline Comments:
- 🧹 While You're Here:
ci.yml:308Doltgres image uses mutable:latesttag (pre-existing)
💡 APPROVE WITH SUGGESTIONS
Summary: The optimization is well-designed — extracting the changeset check into a lightweight job that runs before expensive ubuntu-32gb jobs ensures container initialization is skipped entirely for changeset PRs. The job-level conditionals are correctly placed, and the release.yml git remote configuration fix is appropriate. The main suggestion is to extract the duplicated changeset detection script (~60 lines) into a composite action to avoid drift between ci.yml and cypress.yml. This is not blocking but would improve maintainability.
Reviewers (1)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
pr-review-devops |
5 | 1 | 0 | 0 | 1 | 0 | 0 |
| Total | 5 | 1 | 0 | 0 | 1 | 0 | 0 |
Note: 3 findings were INFO-level confirmations that the implementation is correct (not issues).
The changeset detection logic (~60 lines of shell) was duplicated across ci.yml and cypress.yml. Extracts it into a shared composite action at .github/composite-actions/changeset-check/action.yml. Both workflows now do a sparse checkout (just the composite action directory) and delegate to the shared action, keeping the changeset detection logic in one place. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
PR Review Summary
(0) Total Issues | Risk: Low
Re-review scope: This review covers only the delta since commit
f45f47ff1ac9— specifically commit709bfed92which extracts the duplicated changeset-check logic into a reusable composite action, addressing the prior review's feedback.
✅ Prior Feedback Addressed
The previous review flagged that the changeset-check job script (~60 lines) was duplicated across ci.yml and cypress.yml. This commit cleanly addresses that by:
- Creating
.github/composite-actions/changeset-check/action.ymlwith the shared logic - Both workflows now reference it with sparse-checkout for minimal fetch overhead
- Net reduction of ~108 lines across the two workflow files
The refactor correctly preserves all detection logic:
- Branch name check (
changeset-release/main) - Merge group PR lookup via
gh pr view - File-change analysis for
.changeset/-only PRs
💭 Consider (1) 💭
💭 1) changeset-check/action.yml Add explicit inputs for better documentation
Issue: The composite action uses env vars set from github context expressions (HEAD_REF, GITHUB_EVENT_NAME, etc.) within the step, but doesn't declare them as formal inputs.
Why: Adding an inputs: section would make the action's contract self-documenting and allow callers to override values for testing. This is a style/clarity improvement — the current implementation is fully functional.
Fix: Optional — consider adding inputs with defaults:
inputs:
head_ref:
description: "Head ref of the PR (defaults to github.head_ref)"
required: false
default: ${{ github.head_ref }}Refs:
🕐 Pending Recommendations (1)
- 🧹
ci.yml:258Doltgres image uses mutable:latesttag (raised in prior review)
✅ APPROVE
Summary: The delta cleanly addresses the prior review's feedback by extracting the duplicated changeset-check logic into a reusable composite action. The implementation is correct, the sparse-checkout pattern is appropriate for minimizing fetch overhead, and all detection logic is preserved. Nice refactor! 🎉
Reviewers (1)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
pr-review-devops |
3 | 0 | 1 | 0 | 0 | 1 | 1 |
| Total | 3 | 0 | 1 | 0 | 0 | 1 | 1 |
Note: 1 INFO finding (auto-format.yml inline check) was discarded as pre-existing and not relevant to this PR's scope.
Discarded (1)
| Location | Issue | Reason Discarded |
|---|---|---|
auto-format.yml:21 |
Uses inline branch check instead of composite action | Pre-existing, simpler check is sufficient for that lightweight workflow, and overhead of sparse-checkout not worthwhile. |
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 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]>
* fix(ci): configure git remote with App token in release workflow The changesets/action pushes commits using the default GITHUB_TOKEN credential, which GitHub ignores for triggering downstream workflows. This left the Version Packages PR (#2881) stuck with required checks (ci, Cypress E2E, Create Agents E2E) permanently waiting. Configures the git remote URL with the inkeep-internal-ci App token before changesets/action runs — same pattern applied to ci.yml and auto-format.yml in #2871. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * perf(ci): skip container init for changeset PRs by extracting check job Service containers (Doltgres, Postgres) in cypress-e2e and create-agents-e2e were initialized before the changeset check ran, wasting ~30s of ubuntu-32gb runner time on every changeset PR. Extracts the changeset check into a lightweight job on ubuntu-latest that runs first. The heavy jobs now depend on it via `needs:` and skip entirely (including container init) when it's a changeset PR. Also removes all redundant step-level `if: changeset-check` guards since the job-level `if` already gates everything. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * refactor(ci): extract changeset check into reusable composite action The changeset detection logic (~60 lines of shell) was duplicated across ci.yml and cypress.yml. Extracts it into a shared composite action at .github/composite-actions/changeset-check/action.yml. Both workflows now do a sparse checkout (just the composite action directory) and delegate to the shared action, keeping the changeset detection logic in one place. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
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
cypress-e2eandcreate-agents-e2ewere initialized before the changeset check ran, wasting ~30s ofubuntu-32gbrunner time on every changeset PRubuntu-latestthat runs first. The heavy jobs depend on it vianeeds:and skip entirely (including container init) when it's a changeset PRif: changeset-checkguards since the job-levelifalready gates everything (-83 lines net)Affects:
ci.yml(bothciandcreate-agents-e2ejobs),cypress.yml(cypress-e2ejob)Test plan
🤖 Generated with Claude Code