ci: close issues on release#590
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a conditional GitHub Actions release step that, after a non-dry-run publish, looks up the release URL and closes open issues labeled ChangesRelease workflow automation
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant ReleaseWorkflow
participant PackageJson
participant GitHubReleases
participant GitHubIssues
ReleaseWorkflow->>PackageJson: Read version from package.json
ReleaseWorkflow->>GitHubReleases: gh release view v$VERSION
GitHubReleases-->>ReleaseWorkflow: Release URL
ReleaseWorkflow->>GitHubIssues: List open issues labeled pending-release
GitHubIssues-->>ReleaseWorkflow: Matching issues
loop each pending-release issue
ReleaseWorkflow->>GitHubIssues: Remove pending-release label
ReleaseWorkflow->>GitHubIssues: Post release comment
ReleaseWorkflow->>GitHubIssues: Close issue
end
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/release.yaml (1)
114-118: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winOne failing issue aborts processing of all remaining issues.
GitHub Actions runs
run:steps withbash -e -o pipefailby default, so ifgh issue edit,gh issue comment, orgh issue closefails for any single issue (e.g., a transient API error or a race where the issue was already closed), the whole loop — and step — aborts immediately, leaving the rest of thepending-releaseissues unprocessed with no indication of which ones succeeded.🔧 Proposed fix to isolate per-issue failures
gh issue list --state open --label "pending-release" --json number --jq '.[].number' | while read -r ISSUE; do - gh issue edit "$ISSUE" --remove-label "pending-release" - gh issue comment "$ISSUE" --body "New release $TAG is published: $RELEASE_URL" - gh issue close "$ISSUE" + gh issue edit "$ISSUE" --remove-label "pending-release" || echo "::warning::failed to remove label on #$ISSUE" + gh issue comment "$ISSUE" --body "New release $TAG is published: $RELEASE_URL" || echo "::warning::failed to comment on #$ISSUE" + gh issue close "$ISSUE" || echo "::warning::failed to close #$ISSUE" done🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release.yaml around lines 114 - 118, The release workflow loop in the pending-release cleanup step currently aborts on the first failing GitHub CLI call, so one bad issue stops processing of the rest. Update the `gh issue list ... | while read -r ISSUE` block in the release workflow to isolate failures per issue, such as by handling errors around `gh issue edit`, `gh issue comment`, and `gh issue close` inside the loop and continuing to the next `ISSUE` even when one command fails. Keep the existing `pending-release` processing logic but make the per-issue operations resilient so remaining issues are still handled.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yaml:
- Line 114: The release workflow’s gh issue listing is subject to the default
30-item cap, so some pending-release issues may be skipped. Update the gh issue
list command in the release workflow to explicitly request enough results using
a limit option, and keep the rest of the loop logic unchanged so all matching
issues are processed.
---
Nitpick comments:
In @.github/workflows/release.yaml:
- Around line 114-118: The release workflow loop in the pending-release cleanup
step currently aborts on the first failing GitHub CLI call, so one bad issue
stops processing of the rest. Update the `gh issue list ... | while read -r
ISSUE` block in the release workflow to isolate failures per issue, such as by
handling errors around `gh issue edit`, `gh issue comment`, and `gh issue close`
inside the loop and continuing to the next `ISSUE` even when one command fails.
Keep the existing `pending-release` processing logic but make the per-issue
operations resilient so remaining issues are still handled.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 223d4933-c05b-474b-af28-11a436db3633
📒 Files selected for processing (1)
.github/workflows/release.yaml
Summary by CodeRabbit