Repository navigation
[IR-6586] feat(02-03): warn when resolving an incident from the CLI - #83
Conversation
|
Pushed 57d34a8: named the results of the |
|
Soil is watching this PR. It acts on CodeFlow's review of the latest commit, review comments and change requests, red CI (after checking
|
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryAdds stderr warnings when resolved incidents still have open status-page events.
Reviews (4) · Last reviewed commit: "statuspagewarn: release the stalled hand..." · Reviewed by Greptile |
1 similar comment
Soil councilSoil's council reviewed this change across 3 commits ( Rebutted, with reasons (2)
Open suggestions (1), not blocking:
Fixed before posting (4)
|
…ent is resolved Adds internal/statuspagewarn and calls it from incidents update/create and alerts resolve --resolve-incidents. Best-effort, stderr only, warn only. Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
…e command Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
…eted for maintenance Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
…oses Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
4144108 to
7ee88cf
Compare
|
Rebased onto the latest master. Upstream only changed README.md (docs for incident association flags), with no conflicts and no code overlap. Vet, tests and lint pass, and total coverage is 80.5%. |
Why
Resolving an incident from the CLI does not touch the public status page entries linked to it, and nothing tells you they are still open. Subscribers keep seeing an active incident. See #52. The status page commands themselves already shipped in #57 (v0.6.1) as
status-pages listandstatus-pages events list/create/update/resolve, so this PR does not add or rename any command.What changed
A new best-effort helper package,
internal/statuspagewarn, prints a warning to stderr when a command leaves an incidentresolvedorclosedand that incident still has open status page events. Each open event is listed with its status page ID, its status and the exact command to close it.Where it fires (one call per command):
incidents updatewhen the returned incident status isresolvedorclosedincidents createwhen the created incident isresolvedorclosedalerts resolve --resolve-incidents, for each related incident that isresolvedorclosedDetails:
resolvedorcompletedare not listed. No events, or an incident that is not left resolved, means no output and no extra request.rootly status-pages events resolve <id>. Open maintenance events (scheduled,in_progress) get--status=completedadded, since maintenance is closed withcompleted.debug:line when--debugis set.total_pages.--format jsonand--format yamloutput stays clean.incidents updateandalerts resolve, and the README, mention the warning.Example stderr after
rootly incidents update INC-123 --status=resolved:How to test
The unit tests use
httptestservers to cover open and mixed events, pagination, maintenance statuses, silent cases, lookup failures, a stalled endpoint, and thealerts resolve --resolve-incidentspath.