Skip to content

feat(channel): add --team-ids server-side filter to channel list (v1.4.0)#45

Merged
ysyneu merged 1 commit into
feat/ai-srefrom
fix/channel-list-team-ids
Jun 15, 2026
Merged

feat(channel): add --team-ids server-side filter to channel list (v1.4.0)#45
ysyneu merged 1 commit into
feat/ai-srefrom
fix/channel-list-team-ids

Conversation

@ysyneu

@ysyneu ysyneu commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Why

fduty channel list exposed only --name (client-side substring filter). The curated command shadows the generated twin (genChannelsChannelListCmd), which carries the API's team_ids filter — so server-side team scoping was unreachable. Callers had to fetch all channels and filter locally, which:

  • scales poorly — the server default caps the page at 100 rows (fc-event channel.List), so large accounts silently truncate;
  • broke fc-safari's /init incident scanner: it could not get a single team's channels, so team-scoped scans always computed 0 incidents (false cold-start). See fc-safari#208.

What

Wire ListChannelsRequest.TeamIDs to a new --team-ids flag (Int64Slice; empty = all teams, fully backward-compatible). Verified: channel list --help lists the flag; go build / vet / gofumpt / go test ./internal/cli/... green.

fduty channel list --team-ids 2586851485973 --output-format json

Release

Additive flag → semver minor: cut as v1.4.0 when feat/ai-sre → main.

Context: this is one instance of a systemic pattern

Curated commands register first and shadow their generated twins (genAddLeaf), freezing a flag subset and omitting the generated --data escape hatch. ~17 curated leaf commands shadow a generated twin; several drop useful server-side filters (incident list, alert list, audit search, incident feed, …). This PR fixes the one with a confirmed prod impact; the broader remediation is tracked separately.

The curated `channel list` exposed only `--name` (a client-side substring
filter), shadowing the generated twin that carries the API's `team_ids`
filter. So there was no way to ask the server for a single team's channels —
callers had to fetch all channels and filter locally, which scales poorly
(server default caps the page at 100 rows) and, in fc-safari's /init scanner,
made team-scoped incident totals impossible to compute correctly.

Wire ListChannelsRequest.TeamIDs to a new --team-ids flag (empty = all teams,
behavior unchanged). Intended release: minor bump v1.4.0.
@ysyneu ysyneu merged commit 6848243 into feat/ai-sre Jun 15, 2026
12 checks passed
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.

1 participant