Skip to content

fix(member): add --limit flag to member list + page/limit consistency test#42

Merged
ysyneu merged 2 commits into
mainfrom
audit-fix/audit-2026-06-11b-cli-flag-consistency-limit
Jun 12, 2026
Merged

fix(member): add --limit flag to member list + page/limit consistency test#42
ysyneu merged 2 commits into
mainfrom
audit-fix/audit-2026-06-11b-cli-flag-consistency-limit

Conversation

@ysyneu

@ysyneu ysyneu commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What

  • member list now exposes --limit (default 20, same wording as team list) and forwards it to MemberListRequest.Limit.
  • New TestPageImpliesLimit walks the cobra command tree and asserts every command that registers --page also registers --limit, so future drift is caught at test time.

Root cause

member list registered --page but never --limit, even though the SDK's MemberListRequest embeds flashduty.ListOptions (which has Limit). Every other curated list command (alert/change/incident/oncall/team/audit/session) exposes both, so agents transfer the flag and hit unknown flag: --limit only here.

Evidence

Audit run audit-2026-06-11b:

  • sess_GWzX4FHFabgaENLQkpNgHB steps 7-8: fduty member list --limit 3unknown flag: --limit
  • sess_PZUjHi3xEAxuURncY6nSqZ steps 5-14: flag trial-and-error / --help round-trips

The broader alias-everything matrix from the original proposal was deliberately excluded: channel/field list do client-side filtering with no server pagination, and renaming search flags is a design call, not a mechanical fix.

Verification

  • Pre-fix (member.go stashed): go test ./internal/cli -run TestPageImpliesLimit FAILS citing flashduty member list.
  • Post-fix: go build ./... && go vet ./... && go test ./... all green.
  • go run ./cmd/flashduty member list --help shows --limit.

ysyneu added 2 commits June 12, 2026 10:27
…airing

member list registered --page but not --limit even though the SDK's
MemberListRequest embeds ListOptions with a Limit field, so agents that
learned --limit on other list commands got 'unknown flag: --limit'.

Add the flag (same wording/default as team list) and a cobra-tree test
asserting any command with --page also exposes --limit.
MemberListRequest already exposes Orderby and Asc fields (generated
from the OpenAPI schema); team list has both flags with identical
wording and defaults. Wire them to close the sibling-parameter gap
found during the audit-2026-06-11b param consistency review.
@ysyneu ysyneu merged commit c32f4eb into main Jun 12, 2026
12 checks passed
@ysyneu ysyneu deleted the audit-fix/audit-2026-06-11b-cli-flag-consistency-limit branch June 12, 2026 03:06
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