Skip to content

Restore release draft analysis#571

Merged
koxudaxi merged 4 commits intomainfrom
restore-release-draft-analysis
Apr 30, 2026
Merged

Restore release draft analysis#571
koxudaxi merged 4 commits intomainfrom
restore-release-draft-analysis

Conversation

@koxudaxi
Copy link
Copy Markdown
Owner

@koxudaxi koxudaxi commented Apr 30, 2026

Summary by CodeRabbit

  • Chores
    • Split breaking-change analysis into a dedicated step that uploads results for more accurate labeling, PR comments, and draft release updates.
    • Added concurrency locks to reduce merge-time races.
    • Reduced token/permission scope and updated CLI usage for safer automation.
    • Improved release-notification robustness with fallback tag resolution, clearer logging, and standardized error handling.
    • Smarter benchmark gating to skip expensive runs when unrelated files change.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 30, 2026

Merging this PR will degrade performance by 28.59%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
test_generate_default_template_benchmark 35.5 ms 49.8 ms -28.59%

Comparing restore-release-draft-analysis (0e5764c) with main (1664a17)

Open in CodSpeed

@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 (1664a17) to head (3b2c0fe).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #571   +/-   ##
=========================================
  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.

@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: 91aac5cd-7bf9-4cdc-b2a1-9997382c96ce

📥 Commits

Reviewing files that changed from the base of the PR and between 5c210ee and 3b2c0fe.

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

Walkthrough

Split breaking-change detection into a dedicated analyze job using an AI action and artifact passing; update-draft consumes the artifact to set outputs, label, comment, and build the draft. release-notify tightens triggers, permissions, parsing, and logging. codspeed gates benchmarks via PR diff checks and token presence.

Changes

Cohort / File(s) Summary
Release draft workflow
/.github/workflows/release-draft.yml
Adds an analyze job using anthropics/claude-code-action with a strict JSON schema and uploads analysis as an artifact. update-draft now waits for analyze, downloads/parses the artifact, sets outputs (has_breaking_changes, breaking_changes_content, reasoning), conditionally applies breaking-change/breaking-change-analyzed labels, posts PR comments, updates draft release body, adds concurrency locking, and updates GH CLI permissions/API path interpolation.
Notification workflow
/.github/workflows/release-notify.yml
Restricts workflow_run handling to completed push runs from the same repo; reduces pull-requests permission to read; upgrades actions/github-script; adds tag-resolution fallback by head_sha, refactors release-notes parsing into explicit regex patterns, standardizes error variable naming, adds logging around fallback/resolution/commenting, and preserves comment posting behavior.
CodSpeed gating
/.github/workflows/codspeed.yml
Grants pull-requests: read; exports GH_TOKEN and PR_NUMBER in preflight; for pull_request uses gh pr diff to list changed files and disables CodSpeed benchmarks unless diffs touch fastapi_code_generator/, tests/, or an allowlist (pyproject.toml, uv.lock, tox.ini); fails early if diff lookup errors.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor PR as "Merged PR"
    participant Actions as "GitHub Actions Runner"
    participant Claude as "Claude AI (anthropic/claude-code-action)"
    participant Artifact as "Actions Artifact Storage"
    participant GH as "GitHub API (labels/comments/releases)"

    PR->>Actions: trigger `release-draft` workflow
    Actions->>Claude: run `analyze` job (submit PR data & schema)
    Claude-->>Actions: return JSON (has_breaking_changes, content, reasoning)
    Actions->>Artifact: upload analysis artifact
    Actions->>Artifact: download artifact in `update-draft`
    Actions->>Actions: parse artifact, set outputs
    alt has_breaking_changes == true
        Actions->>GH: add `breaking-change` label
    else
        Actions->>GH: add `breaking-change-analyzed` label
    end
    Actions->>GH: post PR comment with reasoning
    Actions->>GH: create/update draft release body
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I sniffed the CI breeze tonight,
Claude hummed a verdict, clear and bright,
Artifacts bundled, labels in line,
Drafts and comments all in time,
I hop away — automation's bite! 🥕

🚥 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 clearly summarizes the main change: restoring/re-enabling release draft analysis functionality through workflow modifications.
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 restore-release-draft-analysis

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 18 minutes and 21 seconds.

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release-draft.yml:
- Around line 146-157: Move the "Add breaking-change-analyzed" step to the very
end of the job so it runs after the PR comment and draft-release update steps
(i.e., after any steps that run gh pr comment or gh release), keeping the "Add
breaking-change label if applicable" step in its current position (or before the
final analyzed step) so the conditional label still applies; ensure the moved
step retains its env (GH_TOKEN) and uses the same command (gh pr edit ${{
github.event.pull_request.number }} --add-label "breaking-change-analyzed") so
the workflow only marks the PR as analyzed after all release/comment actions
have completed successfully.

In @.github/workflows/release-notify.yml:
- Around line 301-305: The dedupe check treats any "Related PR Released" comment
as global and blocks future notifications; update the hasExistingComment logic
(where issueComments is computed from getAllComments(issueNumber)) to require
the version in the match as well — e.g., check c.body includes a versioned
marker (use the same `version` variable) for both the "Released in [version]"
check and the "Related PR Released" check so the presence test is
version-specific; update the predicate that sets hasExistingComment to only
return true when the comment body includes the current version.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 920cb76b-6d9a-4992-8867-a9fca7f370c8

📥 Commits

Reviewing files that changed from the base of the PR and between 1664a17 and 0e5764c.

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

Comment thread .github/workflows/release-draft.yml
Comment thread .github/workflows/release-notify.yml
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/codspeed.yml:
- Around line 37-39: The pipeline currently runs `gh pr diff "$PR_NUMBER"
--name-only | grep -qE '...` which can hide failures from `gh pr diff`; update
the workflow to enable pipefail (e.g., set -o pipefail) or otherwise check the
`gh pr diff` exit status before grepping: run `gh pr diff` into a temporary
buffer or file, verify its exit code, and only then run `grep -qE` on that
output (references: `gh pr diff`, `grep -qE`).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 36a08fb4-95c9-4b7e-8eac-1aebc93fd595

📥 Commits

Reviewing files that changed from the base of the PR and between 0e5764c and 2539cf7.

📒 Files selected for processing (1)
  • .github/workflows/codspeed.yml

Comment thread .github/workflows/codspeed.yml
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release-notify.yml:
- Around line 330-332: The dedupe check only looks for comments containing
`Released in [${version}]` (the hasExistingComment predicate over
refPrComments), but the workflow later posts `Related PR Released:
[${version}]`, so reruns can create duplicate related-release comments; update
the dedupe predicate used for refPrComments to check for either pattern (e.g.,
both `Released in [${version}]` and `Related PR Released: [${version}]`) or a
single version-aware regex that matches both variants so existing
related-release comments are detected and no duplicate is posted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 705b0624-aea6-40af-a21b-59e315c459ce

📥 Commits

Reviewing files that changed from the base of the PR and between 2539cf7 and 5c210ee.

📒 Files selected for processing (2)
  • .github/workflows/codspeed.yml
  • .github/workflows/release-notify.yml

Comment thread .github/workflows/release-notify.yml
@koxudaxi koxudaxi merged commit fa6ea89 into main Apr 30, 2026
38 checks passed
@koxudaxi koxudaxi deleted the restore-release-draft-analysis branch April 30, 2026 16:26
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