Skip to content

Stop duplicating Jira status updates#744

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
bradmwilliams:jira-status-updates-fix
Mar 17, 2026
Merged

Stop duplicating Jira status updates#744
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
bradmwilliams:jira-status-updates-fix

Conversation

@bradmwilliams
Copy link
Copy Markdown
Collaborator

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 17, 2026

Walkthrough

The VerifyIssues function in Jira integration now includes status guards to prevent redundant updates. Both the success path (VERIFIED status) and failure path (ON_QA status) now check if the target status already exists before updating, reducing duplicate messaging.

Changes

Cohort / File(s) Summary
Jira status guards
pkg/jira/jira.go
Added conditional checks in VerifyIssues to guard status updates to VERIFIED and ON_QA, preventing redundant updates when the target status is already set. Includes clarifying comments on the guard logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

Tip

CodeRabbit can use your project's `golangci-lint` configuration to improve the quality of Go code reviews.

Add a configuration file to your project to customize how CodeRabbit runs golangci-lint.

Copy link
Copy Markdown
Member

@wking wking left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot requested review from AlexNPavel and hoxhaeris March 17, 2026 17:50
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 17, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bradmwilliams, wking

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 Mar 17, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2026
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.

🧹 Nitpick comments (1)
pkg/jira/jira.go (1)

344-349: VERIFIED guard is redundant in this branch

At Line 334, only ON_QA/MODIFIED statuses can reach this block, so the check at Line 345 is always true. This makes the new guard non-functional for deduplication and adds misleading intent. Consider removing it, or move the dedupe check to the earlier status gate if you want it to be effective.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/jira/jira.go` around lines 344 - 349, The redundant VERIFIED-status guard
inside the block that only executes for ON_QA/MODIFIED should be removed or
relocated; update the code around the handler that calls
c.jiraClient.UpdateStatus (and the surrounding status gate that allows only
ON_QA/MODIFIED) by deleting the check against issue.Fields.Status.Name ==
jira.StatusVerified so the dedupe logic is either removed here or moved to the
earlier status gate where ON_QA/MODIFIED are evaluated; ensure UpdateStatus is
still called via c.jiraClient.UpdateStatus(issue.ID, jira.StatusVerified) and
any error handling that appends to errs remains unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/jira/jira.go`:
- Around line 344-349: The redundant VERIFIED-status guard inside the block that
only executes for ON_QA/MODIFIED should be removed or relocated; update the code
around the handler that calls c.jiraClient.UpdateStatus (and the surrounding
status gate that allows only ON_QA/MODIFIED) by deleting the check against
issue.Fields.Status.Name == jira.StatusVerified so the dedupe logic is either
removed here or moved to the earlier status gate where ON_QA/MODIFIED are
evaluated; ensure UpdateStatus is still called via
c.jiraClient.UpdateStatus(issue.ID, jira.StatusVerified) and any error handling
that appends to errs remains unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a6185e61-7635-4ed3-b03d-bbd96fb8c577

📥 Commits

Reviewing files that changed from the base of the PR and between 620fde9 and c3f066e.

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 17, 2026

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

@openshift-merge-bot openshift-merge-bot Bot merged commit 7dcbaae into openshift:main Mar 17, 2026
9 checks passed
@bradmwilliams bradmwilliams deleted the jira-status-updates-fix branch March 17, 2026 18:17
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