Conversation
…sponse Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc1cd0d6c5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| rule.id.as_deref(), | ||
| Some("faba7566-0e31-4e5e-9813-5e2d02fbc5f8") |
There was a problem hiding this comment.
Surface the scheduler unique identifier
For the live wrapped shape, the payload contains both uniqueIdentifier and id, but this test now locks the CLI onto the inner id; run_list renders rule.id as the ID column while get/delete pass that value to /suppression-rules/v1/{alert_scheduler_rule_id}. The v5 docs describe that path parameter as the rule's unique identifier, so tenants that return separate version IDs here will show an ID users cannot reliably feed back into cx alerts suppression-rules get/delete; deserialize uniqueIdentifier and prefer it for the displayed/actionable ID.
Useful? React with 👍 / 👎.
Context
cx alerts suppression-rules listrenders a row for each rule but every field is null/empty (-o jsongives[{"id":null,"name":null,...}], the text table shows a blank row). The rule exists andcreateworks — same failure mode as the earlierintegrations list(#146) /webhooks list(#162) bugs: a response-shape mismatch that serde silently swallows because every field onAlertSchedulerRuleisOption.Linked Issues
webhooks listandintegrations listreturn empty despite existing webhooks/integrations #135 (integrations/webhooks list) and Bug: recording-rules list returns empty despite existing rule groups (same as #135) #153 (recording-rules list)Design
The live API (
GET /mgmt/openapi/5/alerts/suppression-rules/v1, verified on us1, 2026-07-18) wraps each array element:{ "alertSchedulerRules": [ { "alertSchedulerRule": { "id": "...", "name": "...", ... }, "nextActiveTimeframes": [] } ], "nextPageToken": "" }GetBulkAlertSchedulerRuleResponsedeserialized each element directly asAlertSchedulerRule, so every field missed. Following the #162 pattern: the Rust fieldalert_scheduler_rules: Vec<AlertSchedulerRule>is unchanged (nomod.rschanges) — adeserialize_withunwraps the envelope at the JSON boundary. An untagged enum accepts both the wrapped (live) and flat (legacy/fixture) shapes, so the existing flat unit fixture still parses.Changes
src/commands/suppression_rules/api.rs: envelope unwrap viaListedAlertSchedulerRuleuntagged enum +unwrap_rule_envelopesdeserializernextActiveTimeframessibling andnextPageToken); existing flat-shape test kept as back-compat coverageTesting
cargo test suppression_rules::api::tests— 4 passed (new wrapped-shape regression test + existing 3)cargo test— greencargo run -- alerts suppression-rules listnow renders the rule's real id/name/enabled/created (was a blank row);-o jsonreturns populated fieldsRisks & Rollout
Low — deserialization-only, list path only. If the API ever returns flat rule objects again, the
Flatvariant still parses them. Rollback is a revert.Out of Scope / Follow-ups
GET .../suppression-rules/v1/{id}returns{}from the API itself (verified via raw curl on us1) —run_getfaithfully prints it, sosuppression-rules get <id>shows nothing useful; that looks API-side, not CLI-side. Happy to file separately if useful.🤖 Generated with Claude Code