Skip to content

fix(release): resume draft CLI releases by ID - #3200

Merged
M4n5ter merged 1 commit into
mainfrom
fix/cli-release-draft-lookup
Aug 18, 2026
Merged

fix(release): resume draft CLI releases by ID#3200
M4n5ter merged 1 commit into
mainfrom
fix/cli-release-draft-lookup

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Aug 18, 2026

Copy link
Copy Markdown
Member

Summary

English

Resume a partially created CLI GitHub Release by resolving its stable API ID through gh release view. GitHub's release-by-tag REST endpoint returns 404 for drafts, which caused Finalize run
32125339803 to fail immediately
after successfully creating the draft.

The existing exact tag and draft remain the recovery state; rerunning Finalize after this fix will
upload, verify, and publish that draft.

简体中文

通过 gh release view 解析稳定的 Release API ID,从而继续处理部分创建完成的 CLI GitHub
Release。GitHub 的 release-by-tag REST endpoint 对 draft 返回 404,导致 Finalize run
32125339803 在成功创建 draft
后立即失败。

现有精确 tag 和 draft 会保留为恢复状态;合并本修复后重新运行 Finalize,即可继续上传、验证并
发布该 draft。

Verification

  • npx --yes npm@11.19.0 run check:release — 27 tests passed
  • go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.7 .github/workflows/release-cli-finalize.yml
  • Bash syntax check for the Finalize publish step
  • npx biome check scripts/release-cli-workflow-policy.test.mjs
  • Read-only lookup of the existing draft resolved Release ID 372253908
  • Full repository typecheck was not run; the change is limited to workflow shell and its policy test

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex diagnosed the Actions failure, implemented the workflow fix, and added the
regression assertion. M4n5ter is the human contributor of record and reviews the final change.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

GitHub's release-by-tag REST endpoint does not return draft releases, so a successful draft creation was followed by a false 404. Resolve both draft and published releases through gh, bind the result to the expected repository API URL, and perform subsequent reads by stable release ID.\n\nGenerated-by: Codex
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6fb7e769-d5ba-4a5a-a5a4-0cdbdba496fd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@M4n5ter
M4n5ter marked this pull request as ready for review August 18, 2026 10:21
@M4n5ter
M4n5ter merged commit 6a78de2 into main Aug 18, 2026
17 of 18 checks passed
@M4n5ter
M4n5ter deleted the fix/cli-release-draft-lookup branch August 18, 2026 10:21
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Resume draft CLI releases by stable API ID

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Resumes existing draft CLI releases using their stable GitHub API URL.
• Validates release URLs belong to the expected repository before exact-ID reads.
• Adds regression coverage preventing draft-invisible tag endpoint usage.
Diagram

graph TD
  A["Finalize workflow"] --> B["View release tag"] --> C{"Release found?"}
  C -- "No" --> D["Create draft"] --> B
  C -- "Yes" --> E["Validate API URL"] --> F["Read stable ID"] --> G["Publish and verify"]
Loading
High-Level Assessment

The selected approach is appropriate: gh release view handles both draft and published releases, while the validated immutable API URL supports exact subsequent reads. Listing all repository releases and filtering by tag was considered but would add pagination and matching complexity.

Files changed (2) +19 / -4

Bug fix (1) +16 / -4
release-cli-finalize.ymlResolve draft releases through immutable API URLs +16/-4

Resolve draft releases through immutable API URLs

• Replaces the draft-incompatible release-by-tag REST lookup with 'gh release view'. It validates the resolved URL against the expected repository and uses that stable release ID for state reads before and after publication.

.github/workflows/release-cli-finalize.yml

Tests (1) +3 / -0
release-cli-workflow-policy.test.mjsEnforce stable-ID release lookup policy +3/-0

Enforce stable-ID release lookup policy

• Adds regression assertions requiring API URL resolution and stable-URL reads. It also prohibits reintroducing the release-by-tag endpoint in the finalization workflow.

scripts/release-cli-workflow-policy.test.mjs

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Image

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Finding overflow, which tucks the rest behind 'View more'

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

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