Repository navigation
fix(opsgenie): convert closed incidents to DONE with a resolution date - #9390
Open
ShivamSharma43 wants to merge 1 commit into
Open
ShivamSharma43 wants to merge 1 commit into
ShivamSharma43 wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Opsgenie
convertIncidentssubtask converted closed incidents tostatus = OTHERwith noresolution_dateorlead_time_minutes.Opsgenie incidents are
open,resolvedorclosed.getStatusmappedclosedtoticket.OTHER, andgetTimesonly filled the resolution date and lead time forresolved. A closed incident is finished just like a resolved one, but inissuesit 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:getStatusreturnsDONEforclosedas well asresolved.getTimessetsresolution_dateandlead_time_minutesfor both, fromupdatedAt, the same way it already did for resolved incidents.original_statusstill holdsclosed.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, theclosedcases 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/...,gofmtandgolangci-lint run ./plugins/opsgenie/...: clean. I didn't run the opsgenie e2e tests locally (they needE2E_DB_URL); their fixture has no closed incident.pr-type/bug-fix.Generated-by:trailer per the ASF generative tooling guidance.🤖 Generated with Claude Code