Skip to content

ci(release-cut): always show resolved commit, branch, and tag in summary - #10482

Merged
nwparker merged 1 commit into
mainfrom
ci/release-cut-resolved-ref-summary
Jul 25, 2026
Merged

nwparker merged 1 commit into
mainfrom
ci/release-cut-resolved-ref-summary

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

Improves the Cut Release job summary so RC (and other) cuts are easy to audit:

  1. Always show the resolved commit (clickable) after ref is checked out — not just the raw ref input.
  2. Also show branches and tags whose tip is that commit (clickable when present).
  3. Historical SHA fallback: if no branch tip matches, show a name-rev hint like main~3.
  4. Inline the inputs table instead of m-s-abeer/update-gha-summary-with-workflow-inputs@v1 (same motivation as Inline release-cut workflow inputs summary for security #10041: avoid an external action in a contents:write job; inputs stay data via toJSON + jq).

Example summary shape:

Workflow inputs

Input Value
kind rc
ref hotfix/1.4.153-rc.4-from-rc.2
... ...

Resolved source

Field Value
Input ref hotfix/... (branch)
Commit abc1234
Branches at commit hotfix/...
Tags at commit none

Screenshots

No product UI change. Job summary on Cut Release runs gains a Resolved source section with links.

Testing

  • pnpm lint N/A (workflow-only)
  • pnpm typecheck N/A
  • pnpm test N/A
  • pnpm build N/A
  • Local dry-run of the resolve/summary bash against main tip, historical SHA, and an RC tag tip
  • After merge: dispatch Cut Release with dry_run=true and confirm the job summary

AI Review Report

Reviewed for:

  • Shell injection from dispatch-controlled ref (kept as env data; not interpolated into the script body)
  • Markdown/link correctness for branch names with /
  • Annotated-tag discovery via for-each-ref --points-at
  • Cross-platform: runs only on ubuntu-latest in this job (no macOS/Windows/Electron surface)

Security Audit

Notes

Related/supersedes the inputs-inlining approach in #10041 (this PR also adds the resolved commit/branch/tag enrichment). Happy to coordinate if that PR lands first.

Replace the third-party inputs-summary action with an inlined table (avoids
executing an external action in a contents:write job) and, after ref
resolution, append a Resolved source section that always includes the
commit SHA plus any branches/tags whose tip is that commit. Commit,
branch, and tag values are clickable GitHub links for faster RC cut audit.
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The release workflow now renders workflow_dispatch inputs with an inline shell step using jq. Ref resolution exports repository metadata, computes full and short commit SHAs, identifies the input kind, and expands the job summary with linked commit, branch, tag, and fallback ref information. The previous push_main calculation is removed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main workflow summary change and mentions the resolved commit, branches, and tags.
Description check ✅ Passed All required sections are present and the review/testing/security notes are specific enough for this workflow-only change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
.github/workflows/release-cut.yml (2)

114-138: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

push_main logic is still present and used — contradicts the summary; also now duplicates the new branch lookup.

The push_main computation (git fetch origin main --quiet / rev-parse origin/main / echo push_main=true|false) at lines 129-138 is unchanged in this diff and is still consumed downstream at steps.resolve.outputs.push_main (line 662, Push tag step). Both the AI summary ("The previous push_main calculation is removed") and the line-range change details ("it no longer includes the previous push_main determination logic...") claim this was removed, but it clearly still exists and is load-bearing.

Separately: now that the new code below (lines 148-154) already computes every origin branch pointing at $sha, this fetch+compare is redundant — push_main is just "is main among those branches". Worth folding into the new lookup instead of doing two separate origin traversals.

♻️ Illustrative consolidation (move after branches computed)
-          # Why: only push the version-bump commit back to main when the
-          # caller is releasing the exact tip of main. For any older or
-          # off-main ref we leave main alone and only publish the tag.
-          git fetch origin main --quiet
-          main_sha="$(git rev-parse origin/main)"
-          if [[ "$sha" == "$main_sha" ]]; then
-            echo "push_main=true" >>"$GITHUB_OUTPUT"
-          else
-            echo "push_main=false" >>"$GITHUB_OUTPUT"
-          fi
+          # push_main is computed after `branches` below, reusing the same
+          # origin ref lookup instead of a second git fetch/rev-parse.

then, after branches is computed further down:

+          # Why: only push the version-bump commit back to main when the
+          # caller is releasing the exact tip of main.
+          if grep -qx 'main' <<<"$branches"; then
+            echo "push_main=true" >>"$GITHUB_OUTPUT"
+          else
+            echo "push_main=false" >>"$GITHUB_OUTPUT"
+          fi

140-230: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider extracting this into a dedicated script file.

This step is now ~90 lines of bash embedded in YAML (ref-kind detection, branch/tag lookup, a linkify helper, a name-rev fallback, and markdown assembly) — matches the code_block_complexity_high flag. Moving it to e.g. config/scripts/resolve-ref-summary.sh (invoked with sha, input_ref, repo_url as args/env) would make it independently testable and easier to review going forward, without changing behavior.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c9cf8d28-ad20-4069-bcae-1c39137fdb94

📥 Commits

Reviewing files that changed from the base of the PR and between c468e3f and c8e6fad.

📒 Files selected for processing (1)
  • .github/workflows/release-cut.yml

@nwparker
nwparker merged commit f009500 into main Jul 25, 2026
2 checks passed
@nwparker
nwparker deleted the ci/release-cut-resolved-ref-summary branch July 25, 2026 09:06
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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