Cli sr create impact#31
Merged
Merged
Conversation
Member
Author
|
@claude review this |
There was a problem hiding this comment.
Pull request overview
This PR extends the status-report (alias sr) workflows to support per-component impact on create and add-update, and surfaces impact details in interactive wizards and report output.
Changes:
- Add
--impact COMPONENT_ID=LEVEL(repeatable) tosr createandsr add-update, plus parsing/validation utilities. - Enhance the interactive wizards to select and review per-component impacts, and show impact diffs after updates.
- Extend
status-report infooutput (table + JSON) to include current impacts and per-update impact changes; bump CLI version and update generated docs.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds examples for per-component impact usage. |
| internal/statusreport/testhelpers_test.go | Adds shared helpers for capturing/decoding request bodies in tests. |
| internal/statusreport/statusreport.go | Adds impact enum/string conversion and helper functions for impact aggregation & ordering. |
| internal/statusreport/statusreport_wizard.go | Updates create/add-update wizards to collect and summarize per-component impacts. |
| internal/statusreport/statusreport_info.go | Adds “Affected” section + JSON fields for current impacts and per-update impacts. |
| internal/statusreport/statusreport_impact_test.go | Adds unit tests for impact parsing and conversion helpers. |
| internal/statusreport/statusreport_create.go | Refactors create API to params struct; adds --impact flag and request wiring. |
| internal/statusreport/statusreport_create_test.go | Updates tests for new params struct and verifies request bodies with impacts. |
| internal/statusreport/statusreport_add_update.go | Refactors add-update API to params struct; adds --impact flag and prints impact diffs. |
| internal/statusreport/statusreport_add_update_test.go | Updates tests for new params struct and verifies request bodies with impacts. |
| internal/statusreport/impact_flag.go | Implements --impact flag parsing and validation. |
| internal/cmd/app.go | Bumps CLI version to v1.2.1. |
| internal/cmd/app_test.go | Updates version assertion. |
| go.mod | Updates protobuf/connect dependencies. |
| go.sum | Updates module checksums for dependency bumps. |
| docs/openstatus.1 | Updates man page for new flags (but currently mangles the --impact placeholder text). |
| docs/openstatus-docs.md | Updates markdown docs for new flags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # Update an incident and change impact | ||
| openstatus sr add-update sr_42 --status monitoring --message "Recovering" \ | ||
| --impact comp_api=degraded,comp_db=operational |
Comment on lines
+100
to
103
| &cli.StringSliceFlag{ | ||
| Name: "impact", | ||
| Usage: "Per-component impact, repeatable: --impact <component_id>=<level> (level: operational, degraded, partial_outage, major_outage). Mutually exclusive with --component-ids.", | ||
| }, |
Comment on lines
+159
to
+162
| &cli.StringSliceFlag{ | ||
| Name: "impact", | ||
| Usage: "Per-component impact, repeatable: --impact <component_id>=<level> (level: operational, degraded, partial_outage, major_outage). Can also add new affected components.", | ||
| }, |
| } | ||
| } | ||
| } | ||
|
|
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.
No description provided.