Skip to content

feat(cli): filter ClickStack alert list by tag, search, source and state (#1472) - #1479

Open
sdairs wants to merge 1 commit into
claude/drift-1466-cli-postgresfrom
claude/drift-1466-cli-clickstack
Open

sdairs wants to merge 1 commit into
claude/drift-1466-cli-postgresfrom
claude/drift-1466-cli-clickstack

Conversation

@sdairs

@sdairs sdairs commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Fixes #1472. CLI PR for the ClickStack part of #1466, stacked on #1478.

  • cloud clickstack alert list gains four filters:
    • --tag (repeatable)
    • --search
    • --source saved_search|tile|inline (repeatable)
    • --state ALERT|OK|INSUFFICIENT_DATA|DISABLED|PENDING (repeatable)
  • Possible values for --source and --state come from the library enums' VALUES.
  • Limits from the spec are checked in the CLI and fail with a usage error (exit 2) before credentials are read: each tag at most 32 characters, search at most 512, at most 50 tags. Clap can't cap how many times a flag repeats, so the 50-tag limit is checked after parsing, in validate_post_parse.
  • The --name lookup still pages through all alerts unfiltered, so name resolution is unchanged.
  • Tests:
    • clap parsing: repeatability, possible values and limits;
    • one subprocess wiring test asserting the repeated query parameters on the wire.
  • The ClickStack guide shows how to filter alert lists.

🤖 Generated with Claude Code


Note

Low Risk
Read-only CLI list filtering with local validation and tests; no changes to auth, writes, or credential handling beyond earlier usage checks.

Overview
cloud clickstack alert list now supports server-side filters: repeatable --tag, --search, --source, and --state, with enum values driven from the API library’s VALUES lists.

Filter inputs are validated in the CLI (per-tag/search length limits; at most 50 tags) so bad requests fail as usage errors (exit 2) before credentials are read. The 50-tag cap is enforced in validate_post_parse via a new clickstack_validation_error hook, matching the existing ClickPipe pattern.

List and paginated API calls pass the parsed filters through as query parameters. --name alert resolution still pages the full unfiltered list. Tests cover clap parsing, limits, post-parse validation, wire query params, and the guide documents filter behavior.

Reviewed by Cursor Bugbot for commit 1508d66. Bugbot is set up for automated code reviews on this repo. Configure here.

@sdairs
sdairs requested a review from iskakaushik as a code owner November 17, 2026 15:40
Add `--tag`, `--search`, `--source` and `--state` to
`cloud clickstack alert list`. Repeated flags are sent as repeated
query parameters; `--source`/`--state` take the library enums' VALUES.
The spec limits (32-character tags, 512-character search) are clap
value-parser errors, and the 50-tag limit is a post-parse usage error
on `alert list`, both before credentials. `--name` lookups keep paging
through every alert unfiltered.

Fixes #1472

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sdairs
sdairs force-pushed the claude/drift-1466-cli-clickstack branch from 9b1c4e4 to 1508d66 Compare November 17, 2026 16:45
@sdairs
sdairs changed the base branch from claude/drift-1466-api-clickstack to claude/drift-1466-cli-postgres November 17, 2026 16:45
@sdairs
sdairs added this pull request to stack #1483 November 17, 2026 16:46

This branch has not been deployed

No deployments
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.

CLI: filter ClickStack alert list

1 participant