🌱 Add workflow to link automated bugs on PR merge - #693
Conversation
Signed-off-by: Nandini Chandra <nachandr@redhat.com>
📝 WalkthroughWalkthroughAdds a GitHub Actions workflow that runs for merged pull requests, extracts ChangesAutomated bug linking
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GitHub as GitHub
participant Workflow as Link automated bugs
participant PullRequestAPI as Pull request API
participant IssueAPI as Issue API
GitHub->>Workflow: Trigger on merged pull_request closed event
Workflow->>PullRequestAPI: List changed files and patches
PullRequestAPI-->>Workflow: Return pull request diffs
Workflow->>Workflow: Find unique Automates issue references
Workflow->>IssueAPI: Create comments on same-repository issues
IssueAPI-->>Workflow: Return comment results or errors
🚥 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: 2
🤖 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/link-automated-bugs.yml:
- Around line 18-21: Remove the unused “Checkout merged code”
actions/checkout@v4 step from the workflow, leaving the github-script REST API
operations unchanged. Do not replace it with another checkout configuration.
- Around line 30-36: Update the PR file retrieval around
github.rest.pulls.listFiles to use github.paginate with the same repository and
pull request parameters, ensuring all changed files are collected rather than
only the first 100; preserve the existing downstream file-processing behavior.
🪄 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 Plus
Run ID: 8681468e-e755-403b-916f-0da6eb584f19
📒 Files selected for processing (1)
.github/workflows/link-automated-bugs.yml
Signed-off-by: Nandini Chandra <nachandr@redhat.com>
fa721b9 to
748ede0
Compare
|
Thanks for the PR, I have two issues to be considered:
If the workflow is re-run (e.g. via "Re-run jobs" on a merged PR), it will post duplicate comments on issues. Consider checking for an existing comment before posting:
The existing pr-closed.yaml (cherry-pick workflow) triggers on the same event. If a PR merge fires both workflows simultaneously and both try to interact with the same issue, there's a theoretical race. Consider adding a concurrency group: |
This adds automation coverage details for bugs.
// Automates: https://github.com/migtools/crane/issues/NNNAutomated through PR #xyz (url)(closed issues included)