Skip to content

Add incident association flags - #55

Merged
kwent merged 3 commits into
masterfrom
agent/incident-services-types
Aug 13, 2026
Merged

Add incident association flags#55
kwent merged 3 commits into
masterfrom
agent/incident-services-types

Conversation

@kwent

@kwent kwent commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • add incident create/update flags for services, incident types, functionalities, environments, teams, and causes
  • accept comma-separated slugs or UUIDs, matching the server friendly-association contract
  • serialize each association to the corresponding incident API field
  • cover create/update payloads and command wiring with tests

Closes #53

Testing

  • go test ./...

@kwent

kwent commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

@greptileai

@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds incident association flags for create and update commands and serializes supplied slugs or UUIDs into the corresponding API fields.

  • Supports services, incident types, functionalities, environments, teams, and causes.
  • Preserves omitted update associations while allowing explicit empty arrays to clear them.
  • Adds API payload and command-wiring coverage, including the previously requested omitted-versus-empty update test.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
internal/api/client.go Generalizes incident mutation options to support association arrays and forwards the six supported association fields.
internal/cmd/incidents/create.go Adds create flags for six association types and maps non-empty values into the incident payload.
internal/cmd/incidents/update.go Adds update association flags while using explicit flag-change detection to distinguish omission from clearing.
internal/cmd/incidents/cmd_test.go Adds command-level verification that an explicitly empty services flag sends an empty array while an omitted types flag remains absent.
internal/api/client_http_test.go Extends create-request coverage to verify all association fields are serialized.
internal/api/client_mutations_test.go Extends update-request coverage to verify all association fields are serialized.

Reviews (4): Last reviewed commit: "test clearing incident associations" | Re-trigger Greptile

Comment thread internal/cmd/incidents/update.go
@kwent kwent changed the title Add service and incident type flags Add incident association flags Aug 13, 2026
@kwent

kwent commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

@greptileai

@kwent

kwent commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

@greptileai

@kwent
kwent marked this pull request as ready for review August 13, 2026 04:07
@kwent
kwent merged commit a270507 into master Aug 13, 2026
7 checks passed
@kwent
kwent deleted the agent/incident-services-types branch August 13, 2026 04:08
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.

Feature request: --services and --types flags on incidents create/update

1 participant