Skip to content

Skip duplicate CI for generated release PRs - #350

Merged
trueadm merged 5 commits into
mainfrom
codex/skip-release-pr-ci
Jul 28, 2026
Merged

trueadm merged 5 commits into
mainfrom
codex/skip-release-pr-ci

Conversation

@trueadm

@trueadm trueadm commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • dispatch an authenticated lightweight CI run for generated Version Packages PRs
  • skip the test, lint, typecheck, example, compatibility, and package-validation runners for the exact bot-generated metadata commit
  • preserve the protected lint and typecheck contexts as successful job-level skips
  • retain the existing fail-safe behavior: unexpected files, identity, ancestry, or API data fall back to full CI

Why

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, direct main parent, 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.yml
  • prettier --check .github/workflows/ci.yml .github/workflows/release.yml
  • parsed both YAML workflows and syntax-checked every actions/github-script body
  • compared the generated-file allowlist against every file in release PR Version Packages #304
  • git diff --check

Full 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 to release_change and splits outputs into is_release_pr vs is_release_merge. It now authenticates on pull_request (not only main push): same bot/title/branch rules, a tightened changed-file allowlist (adds packages/cli/src/data/octane-data.json), and a check that the generated commit sits directly on the PR’s current main base. When that passes, heavy jobs (shards, website/heavy integration, lint, typecheck, examples, compat, package validation) are skipped; the aggregate test job is omitted on release PRs but still runs on authenticated merges and verifies upstream suites were skipped only for is_release_merge.

Release workflow (release.yml) gains checks: write and, after a successful Changesets sync, creates successful lint and typecheck check runs on the open release PR head (mirroring the classifier’s file/commit checks) so branch protection can pass without re-running those workflows on GITHUB_TOKEN PRs.

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

@vercel

vercel Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
octane-website Ready Ready Preview, Comment Jul 28, 2026 6:26pm
octane-website-mcp Ready Ready Preview, Comment Jul 28, 2026 6:26pm

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website July 28, 2026 15:56 Inactive
@trueadm
trueadm marked this pull request as ready for review July 28, 2026 15:57

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 the if conditions of the lint, typecheck, and examples aggregate jobs so that workflow cancellation produces a cancelled conclusion (which fails branch protection) instead of skipped (which passes), matching the existing test aggregate pattern.

Create PR

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.

Comment thread .github/workflows/ci.yml Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 28, 2026 18:00 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 28, 2026 18:00 Inactive

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 both scripts/redact-audit/generate.mjs and scripts/error-codes/generate.mjs so the append-only checks correctly skip when workflow_dispatch produces an empty base SHA instead of undefined.

Create PR

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.

Comment thread .github/workflows/ci.yml Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 28, 2026 18:11 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 28, 2026 18:11 Inactive

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

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.

Create PR

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.

Comment thread .github/workflows/release.yml Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 28, 2026 18:26 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 28, 2026 18:26 Inactive
@trueadm
trueadm merged commit cdd4212 into main Jul 28, 2026
19 of 28 checks passed
@trueadm
trueadm deleted the codex/skip-release-pr-ci branch July 28, 2026 18:47
@leonidaz leonidaz mentioned this pull request Jul 28, 2026
4 of 6 tasks

This branch was previously deployed

2 inactive deployments
Preview – octane-website — d5a6f5f4 Deployed Jul 28, 2026 by vercel[bot]
Preview – octane-website-mcp — d5a6f5f4 Deployed Jul 28, 2026 by vercel[bot]
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