Repository navigation
Skip duplicate CI for generated release PRs - #350
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Cancel turns required checks green
- Removed
!cancelled()from theifconditions of thelint,typecheck, andexamplesaggregate jobs so that workflow cancellation produces acancelledconclusion (which fails branch protection) instead ofskipped(which passes), matching the existingtestaggregate pattern.
- Removed
Or push these changes by commenting:
@cursor push 3be18609cb
Preview (3be18609cb)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -499,7 +499,7 @@
needs: release_change
# A skipped job reports success, including when it is a required check. The
# classifier only takes this path for the exact bot-owned metadata commit.
- if: ${{ always() && !cancelled() && needs.release_change.outputs.is_release_pr != 'true' }}
+ if: ${{ always() && needs.release_change.outputs.is_release_pr != 'true' }}
runs-on: ubuntu-latest
steps:
@@ -639,7 +639,7 @@
typecheck:
name: typecheck
needs: release_change
- if: ${{ always() && !cancelled() && needs.release_change.outputs.is_release_pr != 'true' }}
+ if: ${{ always() && needs.release_change.outputs.is_release_pr != 'true' }}
runs-on: ubuntu-latest
steps:
@@ -706,7 +706,7 @@
examples:
name: examples
needs: [release_change, example_shard]
- if: ${{ always() && !cancelled() && needs.release_change.outputs.is_release_pr != 'true' }}
+ if: ${{ always() && needs.release_change.outputs.is_release_pr != 'true' }}
runs-on: ubuntu-latest
steps:You can send follow-ups to the cloud agent here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Dispatch fail-safe breaks lint bases
- Added empty-string guards (
&& compatibilityBase !== '') to bothscripts/redact-audit/generate.mjsandscripts/error-codes/generate.mjsso the append-only checks correctly skip whenworkflow_dispatchproduces an empty base SHA instead of undefined.
- Added empty-string guards (
Or push these changes by commenting:
@cursor push 427ed27adc
Preview (427ed27adc)
diff --git a/scripts/error-codes/generate.mjs b/scripts/error-codes/generate.mjs
--- a/scripts/error-codes/generate.mjs
+++ b/scripts/error-codes/generate.mjs
@@ -352,7 +352,7 @@
const check = process.argv.includes('--check');
const catalog = validateCatalog(JSON.parse(readFileSync(catalogFile, 'utf8')));
const compatibilityBase = process.env.OCTANE_ERROR_CODES_BASE;
- if (compatibilityBase !== undefined) {
+ if (compatibilityBase !== undefined && compatibilityBase !== '') {
try {
execFileSync('git', ['cat-file', '-e', `${compatibilityBase}^{commit}`], {
cwd: root,
diff --git a/scripts/redact-audit/generate.mjs b/scripts/redact-audit/generate.mjs
--- a/scripts/redact-audit/generate.mjs
+++ b/scripts/redact-audit/generate.mjs
@@ -39,7 +39,7 @@
}
const compatibilityBase = process.env.OCTANE_REDACT_AUDIT_BASE;
-if (compatibilityBase !== undefined) {
+if (compatibilityBase !== undefined && compatibilityBase !== '') {
try {
execFileSync('git', ['cat-file', '-e', `${compatibilityBase}^{commit}`], {
cwd: REPO_ROOT,You can send follow-ups to the cloud agent here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Dispatch checks miss PR gates
- Replaced createWorkflowDispatch (whose check suites are excluded from PR statusCheckRollup) with the Commit Status API, which IS included in statusCheckRollup and satisfies branch-protection required checks on the generated PR head SHA.
Or push these changes by commenting:
@cursor push b287cda29f
Preview (b287cda29f)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -18,10 +18,10 @@
release-pr:
if: github.repository == 'octanejs/octane' && github.ref == 'refs/heads/main'
permissions:
- actions: write
contents: write
issues: read
pull-requests: write
+ statuses: write
name: Release PR
runs-on: ubuntu-latest
steps:
@@ -225,10 +225,11 @@
exit 1
# GITHUB_TOKEN-created pull requests intentionally do not emit another
- # pull_request workflow. Explicit workflow_dispatch is exempt from that
- # recursion guard, so request the small authenticated release-PR path in
- # ci.yml and attach its skipped required jobs to the generated head SHA.
- - name: Request lightweight release pull request checks
+ # pull_request workflow. workflow_dispatch check suites are not included
+ # in a PR's statusCheckRollup either, so use the Commit Status API to
+ # report success for each branch-protection required check directly on
+ # the generated head SHA.
+ - name: Satisfy required checks for release pull request
if: >-
always() &&
(
@@ -266,16 +267,30 @@
}
const pull = matches[0];
- await github.rest.actions.createWorkflowDispatch({
- owner,
- repo,
- workflow_id: "ci.yml",
- ref: pull.head.ref,
- inputs: {
- release_pr_number: String(pull.number),
- release_head_sha: pull.head.sha,
- },
- });
+
+ // Commit statuses (unlike workflow_dispatch check runs) appear in
+ // the PR's statusCheckRollup and satisfy branch-protection gates.
+ // Keep this list in sync with the required checks on main.
+ const requiredContexts = [
+ "lint",
+ "typecheck",
+ "test (22)",
+ "test (24)",
+ "examples",
+ ];
+ await Promise.all(
+ requiredContexts.map((ctx) =>
+ github.rest.repos.createCommitStatus({
+ owner,
+ repo,
+ sha: pull.head.sha,
+ state: "success",
+ context: ctx,
+ description:
+ "Skipped for generated Changesets release PR",
+ }),
+ ),
+ );
core.notice(
- `Requested lightweight CI for Changesets PR #${pull.number} at ${pull.head.sha}.`,
+ `Reported ${requiredContexts.length} required-check statuses for Changesets PR #${pull.number} at ${pull.head.sha}.`,
);You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 9aee6bd. Configure here.


Summary
Version PackagesPRslintandtypecheckcontexts as successful job-level skipsWhy
Changesets release PRs only contain generated version, changelog, inventory, registry, and corpus metadata. The source changes have already passed CI before entering the release plan, so repeating the entire suite makes routine releases unnecessarily slow to merge.
The release workflow uses
GITHUB_TOKEN, so it now explicitly dispatches CI on the generated head SHA. The classifier authenticates the PR title, bot identity, repositories, branch names, commit authorship, directmainparent, and a narrow generated-file allowlist before permitting any skip.Post-merge publishing safety is unchanged. The release merge only skips duplicate tests when its parent already has successful full-suite aggregate jobs; otherwise it runs full CI before publishing.
Validation
actionlint .github/workflows/ci.yml .github/workflows/release.ymlprettier --check .github/workflows/ci.yml .github/workflows/release.ymlactions/github-scriptbodygit diff --checkFull repository tests were intentionally not run for this workflow-only change.
Note
Medium Risk
Changes merge gating and branch-protection behavior for release PRs; misclassification could skip real CI, though unknown cases still fall back to the full suite.
Overview
Speeds up merging bot-generated Version Packages PRs by treating them as metadata-only once a stricter classifier says so, while keeping post-merge release pushes on the existing “parent already passed full tests” path.
CI (
ci.yml) renames the classifier job torelease_changeand splits outputs intois_release_prvsis_release_merge. It now authenticates onpull_request(not only main push): same bot/title/branch rules, a tightened changed-file allowlist (addspackages/cli/src/data/octane-data.json), and a check that the generated commit sits directly on the PR’s currentmainbase. When that passes, heavy jobs (shards, website/heavy integration, lint, typecheck, examples, compat, package validation) are skipped; the aggregatetestjob is omitted on release PRs but still runs on authenticated merges and verifies upstream suites were skipped only foris_release_merge.Release workflow (
release.yml) gainschecks: writeand, after a successful Changesets sync, creates successfullintandtypecheckcheck runs on the open release PR head (mirroring the classifier’s file/commit checks) so branch protection can pass without re-running those workflows onGITHUB_TOKENPRs.Reviewed by Cursor Bugbot for commit d5a6f5f. Bugbot is set up for automated code reviews on this repo. Configure here.