Skip to content

Add post-merge-verification label to issues that are verified-later#765

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
JoelSpeed:post-merge-verification-label
May 15, 2026
Merged

Add post-merge-verification label to issues that are verified-later#765
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
JoelSpeed:post-merge-verification-label

Conversation

@JoelSpeed
Copy link
Copy Markdown
Contributor

@JoelSpeed JoelSpeed commented May 15, 2026

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-later as a label.

This PR updates the logic to add a post-merge-verification label 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

    • Added post-merge verification label for improved tracking of issues requiring later verification.
  • Updates

    • External pull request verification now leverages label-based tracking instead of status updates for enhanced clarity and workflow consistency.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

📝 Walkthrough

Walkthrough

This pull request implements a post-merge verification label workflow in Jira. It adds label-management helpers (hasJiraLabel, addJiraLabel), updates the verification flow to mark issues for deferred verification, and replaces status changes with label additions for those deferred cases. Test coverage is extended to validate label presence across scenarios.

Changes

Post-merge Verification Label Workflow

Layer / File(s) Summary
Post-merge verification label infrastructure
pkg/jira/jira.go
New postMergeVerificationLabel constant, hasJiraLabel helper that safely checks issue labels, and addJiraLabel method that conditionally updates Jira issues with the label, skipping when already present and returning errors on API failures.
Verification workflow integration
pkg/jira/jira.go
verifyExtPRs sets verifiedLater = true for the legacy QE-approval path; VerifyIssues now adds the post-merge label via addJiraLabel instead of updating status to ON_QA for deferred verification cases.
Test coverage for post-merge label workflow
pkg/jira/jira_test.go
Added k8s.io/utils/strings/slices import; extended expectedResult struct with expectPostMergeVerificationLabel field; updated multiple TestVerifyIssues test cases to specify label expectations; added assertions validating label presence using slices.Contains.

🎯 3 (Moderate) | ⏱️ ~20 minutes

A label was born in the spring,
Post-merge, it marks a golden thing,
No status change, just a tag so fine,
Verification deferred, all in line!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: adding a post-merge-verification label to issues marked as verified-later, which matches the primary objective and the actual code changes in the PR.
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

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@openshift-ci openshift-ci Bot requested review from AlexNPavel and hoxhaeris May 15, 2026 10:00
Copy link
Copy Markdown
Contributor

@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.

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 win

Avoid deriving verifiedLater from shared cross-issue errors.

errs is global across all issues, so len(*errs) > 0 can be true due to earlier issues. With Line 229, that marks the current issue as verifiedLater and can incorrectly add post-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

📥 Commits

Reviewing files that changed from the base of the PR and between d01335a and 17ca41b.

📒 Files selected for processing (2)
  • pkg/jira/jira.go
  • pkg/jira/jira_test.go

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 15, 2026

@JoelSpeed: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions 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.

@bradmwilliams
Copy link
Copy Markdown
Collaborator

I think this should update all of the existing issues out there too,

This is not necessarily a true statement...
Issue verification will only happen on any releases that appear after this PR merges.
Any releases that have already been processed, will not be re-verified

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 15, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 15, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 15, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 1514b32 into openshift:main May 15, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants