Skip to content

fix(opsgenie): convert closed incidents to DONE with a resolution date - #9390

Open
ShivamSharma43 wants to merge 1 commit into
apache:mainfrom
ShivamSharma43:fix/opsgenie-closed-incident-status
Open

ShivamSharma43 wants to merge 1 commit into
apache:mainfrom
ShivamSharma43:fix/opsgenie-closed-incident-status

Conversation

@ShivamSharma43

Copy link
Copy Markdown
Contributor

Summary

The Opsgenie convertIncidents subtask converted closed incidents to status = OTHER with no resolution_date or lead_time_minutes.

Opsgenie incidents are open, resolved or closed. getStatus mapped closed to ticket.OTHER, and getTimes only filled the resolution date and lead time for resolved. A closed incident is finished just like a resolved one, but in issues it looked neither open nor done. Metrics that use the resolution date, such as DORA's failed deployment recovery time, left closed incidents out. Details in #9388.

Changes:

  • tasks/incidents_converter.go: getStatus returns DONE for closed as well as resolved. getTimes sets resolution_date and lead_time_minutes for both, from updatedAt, the same way it already did for resolved incidents. original_status still holds closed.
  • tasks/incidents_converter_test.go (new): checks the status for open, resolved and closed incidents, and checks that resolved and closed incidents get a resolution date and lead time while open ones don't. With the old code, the closed cases fail (expected: "DONE", actual: "OTHER").

The e2e fixture has only open and resolved incidents, so its snapshots don't change.

Does this close any open issues?

Fixes #9388

Screenshots

N/A

Other Information

  • go test ./plugins/opsgenie/tasks/: pass.
  • go vet ./plugins/opsgenie/..., gofmt and golangci-lint run ./plugins/opsgenie/...: clean. I didn't run the opsgenie e2e tests locally (they need E2E_DB_URL); their fixture has no closed incident.
  • No open PR or issue touches the Opsgenie incident converter.
  • Suggested label: pr-type/bug-fix.
  • AI assistance disclosure: this change was prepared with the help of Claude Code (Claude Opus 5.5), and I reviewed the diff. The commit carries a Generated-by: trailer per the ASF generative tooling guidance.

🤖 Generated with Claude Code

getStatus mapped closed incidents to OTHER, and getTimes only set
resolution_date and lead_time_minutes for resolved ones. A closed
incident is finished like a resolved one, but it ended up in issues
with status OTHER and no resolution date, so metrics that use the
resolution date, such as DORA's failed deployment recovery time,
left it out.

Treat closed like resolved in both functions, and add unit tests.

Fixes apache#9388

Generated-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Shivam Sharma <192242476+ShivamSharma43@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 06:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Opsgenie] Closed incidents are converted to status OTHER without a resolution date

2 participants