feat(channel): add --team-ids server-side filter to channel list (v1.4.0)#45
Merged
Conversation
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.
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.
Why
fduty channel listexposed only--name(client-side substring filter). The curated command shadows the generated twin (genChannelsChannelListCmd), which carries the API'steam_idsfilter — so server-side team scoping was unreachable. Callers had to fetch all channels and filter locally, which:fc-event channel.List), so large accounts silently truncate;/initincident 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.TeamIDsto a new--team-idsflag (Int64Slice; empty = all teams, fully backward-compatible). Verified:channel list --helplists the flag;go build/vet/gofumpt/go test ./internal/cli/...green.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--dataescape 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.