Conversation
Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
There was a problem hiding this comment.
💡 Codex Review
tscli/cmd/tscli/list/tailnets/cli.go
Line 66 in ec33c3d
When --output is pretty or human and the organization has more than one page, this branch replaces the response with only listResp.Tailnets, discarding both the opaque cursor and totalCount. The user therefore cannot discover the value required for the next --cursor invocation without switching output formats, making pagination unusable in these supported modes; render or otherwise preserve the next-page cursor alongside the tailnet records.
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🟡 Changes recommended
Pretty/human output currently strips pagination metadata (cursor/totalCount), which makes the new pagination support incomplete for those output modes.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds pagination support to the tscli list tailnets command, aligning the CLI, API contract snapshot, and coverage tooling so pagination request/response fields are exercised and tracked.
Changes:
- Add
--limitand--cursorflags tolist tailnetsand send them as query parameters. - Introduce
OrganizationTailnetListResponse(withcursor/totalCount) and wire it into coverage tooling. - Update OpenAPI snapshot + generated docs and add an integration test asserting pagination query/response fields.
File summaries
| File | Description |
|---|---|
| tools/internal/coveragegaps/properties.go | Registers the new response type for property coverage extraction. |
| test/cli/tailnet_lifecycle_integration_test.go | Adds an integration test validating pagination query params and response fields. |
| pkg/contract/openapi/tailscale-v2-openapi.yaml | Updates the OpenAPI snapshot to include pagination parameters and response fields. |
| pkg/contract/openapi/snapshot-metadata.yaml | Updates snapshot fetch timestamp/hash metadata. |
| pkg/apitype/models.go | Adds OrganizationTailnet + OrganizationTailnetListResponse models. |
| docs/commands/tscli_list_tailnets.md | Documents new --limit/--cursor flags. |
| coverage/property-coverage.yaml | Adds property coverage mapping for the tailnets list response. |
| coverage/coverage-gaps.md | Updates coverage gaps report to reflect newly covered properties. |
| coverage/coverage-gaps.json | Updates coverage gaps machine-readable output for the new properties. |
| cmd/tscli/list/tailnets/cli.go | Implements pagination flags, validation, request query construction, and typed pretty/human decoding. |
Review details
Suppressed comments (1)
cmd/tscli/list/tailnets/cli.go:66
- For pretty/human output, the code drops pagination metadata (
cursor,totalCount) by marshaling onlylistResp.Tailnets. That makes it hard/impossible to page while using those output formats. Consider including pagination fields in the pretty/human payload when they are present (e.g., append a final record containingcursor/totalCount).
var listResp apitype.OrganizationTailnetListResponse
if err := json.Unmarshal(raw, &listResp); err != nil {
return fmt.Errorf("decode list tailnets response: %w", err)
}
out, err = json.MarshalIndent(listResp.Tailnets, "", " ")
- Files reviewed: 7/10 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
Signed-off-by: Lee Briggs lee@leebriggs.co.uk