Add post-merge-verification label to issues that are verified-later#765
Conversation
📝 WalkthroughWalkthroughThis pull request implements a post-merge verification label workflow in Jira. It adds label-management helpers ( ChangesPost-merge Verification Label Workflow
🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pkg/jira/jira.go (1)
214-230:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAvoid deriving
verifiedLaterfrom shared cross-issue errors.
errsis global across all issues, solen(*errs) > 0can be true due to earlier issues. With Line 229, that marks the current issue asverifiedLaterand can incorrectly addpost-merge-verification.Suggested fix
func (c *Verifier) verifyExtPRs(issue *jiraBaseClient.Issue, extPRs []pr, errs *[]error, tagName string) (ticketMessage string, isSuccess, verifiedLater bool) { var success bool + initialErrCount := len(*errs) message := fmt.Sprintf("Fix included in release %s", tagName) var unApprovedPRs []pr @@ - if len(unApprovedPRs) > 0 || len(*errs) > 0 { + if len(unApprovedPRs) > 0 || len(*errs) > initialErrCount { message = fmt.Sprintf("%s\nJira issue will not be automatically moved to %s for the following reasons:", message, jira.StatusVerified) for _, extPR := range unApprovedPRs { message = fmt.Sprintf("%s\n- PR %s/%s#%d not approved by the QA Contact", message, extPR.org, extPR.repo, extPR.prNum) } - for _, err := range *errs { + for _, err := range (*errs)[initialErrCount:] { message = fmt.Sprintf("%s\n- %s", message, err) }🤖 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 `@pkg/jira/jira.go` around lines 214 - 230, The code incorrectly sets verifiedLater based on the global errs slice; change the logic in the block that references unApprovedPRs, errs and verifiedLater so verifiedLater is only set when there are issue-specific problems (e.g., unApprovedPRs for this issue or errors that can be attributed to this issue), not simply when the global errs length > 0. Concretely, filter *errs for entries that belong to the current issue (or maintain a per-issue/localErrs slice) and use len(localErrs) (or len(filteredErrs)) in the conditional and when appending error lines to message, and only then set verifiedLater = true; keep the existing message construction and helpers.GetIssueQaContact usage intact.
🤖 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.
Outside diff comments:
In `@pkg/jira/jira.go`:
- Around line 214-230: The code incorrectly sets verifiedLater based on the
global errs slice; change the logic in the block that references unApprovedPRs,
errs and verifiedLater so verifiedLater is only set when there are
issue-specific problems (e.g., unApprovedPRs for this issue or errors that can
be attributed to this issue), not simply when the global errs length > 0.
Concretely, filter *errs for entries that belong to the current issue (or
maintain a per-issue/localErrs slice) and use len(localErrs) (or
len(filteredErrs)) in the conditional and when appending error lines to message,
and only then set verifiedLater = true; keep the existing message construction
and helpers.GetIssueQaContact usage intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: b6342473-a63d-4373-b301-8ce89816a1ae
📒 Files selected for processing (2)
pkg/jira/jira.gopkg/jira/jira_test.go
|
@JoelSpeed: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This is not necessarily a true statement... |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bradmwilliams, JoelSpeed The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I would like to be able to filter in Jira for all issues that will not automatically transition to verified. As far as I can tell, this means that they have a PR with
verified-lateras a label.This PR updates the logic to add a
post-merge-verificationlabel at the point where it currently comments on issues to be verified later. The label will be applied even to issues already ON_QA so I think this should update all of the existing issues out there too, which helps me in my goal I think.CC @bradmwilliams
Summary by CodeRabbit
New Features
Updates