Skip to content

fix: list commands fetch every page by default - #8

Merged
zoltanf merged 1 commit into
mainfrom
fix/list-default-fetch-all
Apr 24, 2026
Merged

zoltanf merged 1 commit into
mainfrom
fix/list-default-fetch-all

Conversation

@zoltanf

@zoltanf zoltanf commented Apr 24, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes a silent-truncation failure mode in six list commands. rc0 record list <zone> (and five siblings) previously returned only the first API page — 50 rows, 100 for ACME — with exit code 0 and no stderr indication that more results existed. A zone with 50 RRsets and a zone with thousands looked identical on screen, which caused an operational incident where records were declared absent because they had been silently paginated off the first page.

  • Default is now fetch-everything for zone list, record list, tsig list, messages list, report problematic-zones, acme list-challenges.
  • --all stays accepted as a no-op for script compatibility (help text updated).
  • --page N stays explicit and now prints a stderr warning when more rows exist (envelope shape) or may exist (bare-array shape). -q / --quiet suppresses it. JSON/YAML stdout remains clean.
  • --all + --page still a hard error (exit 7).

Adds PageInfo + fetch_page() to the paginator, _warn_if_truncated() helper, 9 new integration regression tests, 6 new paginator unit tests. Rewrites the pagination help topic.

Per release convention, no version bump in this PR — scripts/release.sh 1.1.0 after merge handles pyproject.toml, __init__.py, and the dated CHANGELOG heading.

Test plan

  • uv run ruff check . — clean
  • uv run ruff format --check . — clean
  • uv run mypy — 71 source files, no issues
  • uv run pytest — 431 passed, coverage 91.24% (floor 88)
  • Manual smoke on a multi-page zone post-merge

Six list commands (zone/record/tsig/messages/report problematic-zones/
acme list-challenges) previously truncated at the first API page (50 rows,
100 for ACME) with exit code 0 and no warning. A zone with 50 RRsets and a
zone with thousands looked identical on screen, which caused an operational
incident where records were declared absent because they had been silently
paginated off the first page.

Default behavior now fetches every page. `--all` is kept as an accepted
no-op for script compatibility. `--page N` remains the explicit single-page
path and now prints a stderr warning when more rows exist (envelope shape)
or may exist (bare-array shape); `-q` / `--quiet` suppresses it. JSON/YAML
stdout stays clean — warnings are stderr-only.

Adds `PageInfo` + `fetch_page()` to the paginator for the single-page
path, `_warn_if_truncated()` helper in commands, and 15 new tests
(9 integration regressions + 6 paginator unit tests). Rewrites the
pagination topic doc.
@zoltanf
zoltanf force-pushed the fix/list-default-fetch-all branch from 17e637e to 17929da Compare April 24, 2026 20:55
@zoltanf
zoltanf merged commit 72b474b into main Apr 24, 2026
5 checks passed
@zoltanf
zoltanf deleted the fix/list-default-fetch-all branch April 24, 2026 20:57
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