Skip to content

Use REST API for release draft labels#574

Merged
koxudaxi merged 2 commits intomainfrom
fix-release-draft-rest-labels
Apr 30, 2026
Merged

Use REST API for release draft labels#574
koxudaxi merged 2 commits intomainfrom
fix-release-draft-rest-labels

Conversation

@koxudaxi
Copy link
Copy Markdown
Owner

@koxudaxi koxudaxi commented Apr 30, 2026

Summary

  • Add release draft labels through the REST Issues Labels API
  • Add release draft analysis comments through the REST Issues Comments API
  • Avoid gh issue edit/comment CLI wrappers for write operations in the no-checkout update job

Checks

  • ruby -e 'require "yaml"; YAML.load_file(".github/workflows/release-draft.yml"); puts "OK release-draft"'
  • git diff --check

Summary by CodeRabbit

  • Chores
    • Updated the release workflow to use direct API calls for applying labels and posting analysis comments, improving reliability and reducing noisy command output.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: da65ce60-de88-4a4e-bad4-4b2f5b87d070

📥 Commits

Reviewing files that changed from the base of the PR and between e3a7b4b and 0cc8667.

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

Walkthrough

The release-draft workflow now uses direct GitHub REST API POST requests (gh api) to add issue labels and to post analysis comments (JSON payload via jq), replacing prior gh subcommands and silencing output with explicit headers and --silent flags. (49 words)

Changes

Cohort / File(s) Summary
Release workflow (labels & comments)
.github/workflows/release-draft.yml
Replaced gh issue edit --add-label and gh issue comment --body-file usages with gh api --method POST calls: POST to Issues labels endpoint using Accept: application/vnd.github+json and labels[] form fields; build JSON { "body": ... } via jq and POST to issue comments endpoint; added --silent to suppress output.

Sequence Diagram(s)

sequenceDiagram
  participant Runner as "GitHub Actions Runner"
  participant ghCLI as "gh (CLI)"
  participant GitHubAPI as "GitHub REST API"
  participant Issue as "Issue/PR"

  Note over Runner,ghCLI: Workflow generates label/comment payloads
  Runner->>ghCLI: gh api --method POST /repos/.../issues/:number/labels\n(headers + labels[])
  ghCLI->>GitHubAPI: POST /issues/:number/labels (form data, Accept header)
  GitHubAPI-->>Issue: Apply label(s)
  Runner->>ghCLI: jq builds JSON -> gh api --method POST /repos/.../issues/:number/comments\n--silent
  ghCLI->>GitHubAPI: POST /issues/:number/comments (JSON body)
  GitHubAPI-->>Issue: Create comment
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 I hopped through YAML, nibbling CLI lines,
Now REST requests sparkle where commands once dined,
Headers in place and JSON in hand,
Labels and comments land tidy and planned,
Hooray — the draft dances across GitHub's land! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: switching from gh CLI subcommands to REST API for managing release draft labels.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-release-draft-rest-labels

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
Review rate limit: 5/8 reviews remaining, refill in 19 minutes and 18 seconds.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

📚 Docs Preview: https://pr-574.fastapi-code-generator.pages.dev

@koxudaxi koxudaxi merged commit 8c6b162 into main Apr 30, 2026
34 checks passed
@koxudaxi koxudaxi deleted the fix-release-draft-rest-labels branch April 30, 2026 17:47
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (220ed5b) to head (0cc8667).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #574   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1351      1351           
  Branches       139       139           
=========================================
  Hits          1351      1351           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@koxudaxi koxudaxi added the breaking-change-analyzed PR has been checked for release draft updates label Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change-analyzed PR has been checked for release draft updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant