Skip to content

chore: Release PRs return to review after generated checks pass#1247

Merged
hatayama merged 1 commit into
v3-betafrom
feature/hatayama/fix-release-pr-draft-recovery
May 30, 2026
Merged

chore: Release PRs return to review after generated checks pass#1247
hatayama merged 1 commit into
v3-betafrom
feature/hatayama/fix-release-pr-draft-recovery

Conversation

@hatayama

Copy link
Copy Markdown
Owner

Summary

  • Release PRs no longer stay in draft when generated native CLI checks are dispatched for the updated branch head.
  • Draft protection is still kept while checks run, and stale checked results still block the PR from becoming ready.

User Impact

  • Before this change, a release PR could remain draft even after its generated check workflow passed, because the automation was still looking for an older head SHA.
  • After this change, release PRs return to review once the dispatched check run succeeds for the current branch head.

Changes

  • Track the head SHA from the dispatched workflow run instead of trusting the first PR list response.
  • Verify the current release PR head against the successful workflow run head before marking it ready.
  • Add a regression test for stale PR head data after generated release commits.

Verification

  • go -C Packages/src/Cli~ test ./internal/automation -run TestReleasePRChecksUseDispatchedRunHeadWhenPRListReturnsStaleHead -count=1
  • go -C Packages/src/Cli~ test ./internal/automation -run 'TestReleasePRChecks(UseDispatchedRunHeadWhenPRListReturnsStaleHead|FailWhenHeadChangesBeforeReady|DispatchAndMarkReady)' -count=1
  • go -C Packages/src/Cli~ test ./internal/automation ./internal/architecture -count=1
  • scripts/test-release-please-config.sh && scripts/test-sync-release-please-go-cli-dist.sh
  • scripts/check-go-cli.sh

Use the workflow run head SHA as the checked release PR head so draft recovery survives GitHub PR list lag after generated native CLI dist commits.
@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aa084000-74a4-4a3a-828b-f12ae979afef

📥 Commits

Reviewing files that changed from the base of the PR and between 07c8247 and 874e0e5.

📒 Files selected for processing (2)
  • Packages/src/Cli~/internal/automation/release_pr_checks.go
  • Packages/src/Cli~/internal/automation/release_pr_checks_test.go

📝 Walkthrough

Walkthrough

The PR refactors release PR checks to capture full dispatched workflow run objects instead of just run IDs. The lookup functions now return releaseWorkflowRun structs containing HeadSHA, enabling head verification against the specific dispatched run rather than potentially stale PR list data. A new test validates this behavior when PR head values change between checks.

Changes

Release PR Checks Refactoring

Layer / File(s) Summary
Dispatch lookup refactoring to return run objects
Packages/src/Cli~/internal/automation/release_pr_checks.go
findDispatchedReleasePRCheckRun and latestReleasePRCheckRun now return releaseWorkflowRun structs instead of int64 IDs. JSON unmarshaling parses runs into objects with HeadSHA and CreatedAt fields, selection logic is updated to return the full run or empty struct with false flag, and return paths reflect the struct-based approach.
Main flow integration and head verification
Packages/src/Cli~/internal/automation/release_pr_checks.go
RunReleasePleasePRChecks uses the dispatched run struct's DatabaseID for watching and passes HeadSHA to a new verification helper. verifyReleasePRCheckHeadMatchesRun validates that the current PR head matches the dispatched run's head SHA, replacing prior comparison against earlier PR head values.
Test for stale PR head handling
Packages/src/Cli~/internal/automation/release_pr_checks_test.go
New test TestReleasePRChecksUseDispatchedRunHeadWhenPRListReturnsStaleHead simulates a release PR whose headRefOid changes between initial and post-watch PR lists, verifying readiness is correctly marked using the dispatched run's headSha.

Possibly Related PRs

  • hatayama/unity-cli-loop#1244: Main PR that dispatches the release-please-PR-checks workflow which this PR refines for head SHA verification against the dispatched run.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: release PRs now return to review after generated checks pass, which aligns with the core implementation change of tracking the dispatched run's head SHA.
Description check ✅ Passed The description clearly relates to the changeset, explaining the user impact, specific changes made, and verification steps that correspond to the code modifications.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/hatayama/fix-release-pr-draft-recovery

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 and usage tips.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Re-trigger cubic

@hatayama
hatayama merged commit 6c194fa into v3-beta May 30, 2026
8 checks passed
@hatayama
hatayama deleted the feature/hatayama/fix-release-pr-draft-recovery branch May 30, 2026 09:35
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