fix(dispatch-check): paginate the complete task feed #1247

Merged
bosun merged 2 commits from rigger/1227-dispatch-pagination into main 2026-09-06 10:09:11 +02:00
Owner

Refs #1227

Contract

  • Read the complete /actions/tasks feed with page=N&limit=M, starting at page 1.
  • Continue after short non-empty pages and stop only on an explicit empty workflow_runs page.
  • Treat malformed HTTP-200 envelopes/pages, including {}, as could-not-grade.
  • Keep narrowing-looking filters out of this read because the measured instance ignores them.
  • Print task_feed_pages, task_feed_rows, and terminal-page task_feed_total so the whole-read cost is visible.

Measured live evidence

  • Implementation snapshot: main 6c5f99f3a74c052f4f0007efa877300b321110c3; the branch was created from that exact main tip.
  • rt dispatch-check 6c5f99f3 --owner frankenbit --repo release-toolkit completed with exit 0.
  • Readback: 14 distinct contexts, 41 status rows, 17 matching tasks; task_feed_pages=503, task_feed_rows=25068, task_feed_total=25068. Pages include the terminal empty page.
  • The live read used page and limit parameters and reached the empty terminal page rather than stopping at the first short page.

Controls

  • Unit server returns a short page followed by more rows, then an empty page; it requires all three requests and all rows.
  • Mutation: stopping on len(rows) < requested limit made TestDispatchReadsUseCanonicalEndpoints fail (rc 1).
  • Mutation: mapping malformed-envelope decode errors to an empty page made TestListActionTasksRejectsMalformedPageInsteadOfTreatingItAsEmpty fail (rc 1).

Verification

  • go test -count=1 ./... passed.
  • go test -race -count=1 ./... passed.
  • go vet ./..., go build ./..., and golangci-lint passed.
  • bats --print-output-on-failure tests/: 161/161 passed.
  • FORGEJO_WORKFLOW_VALIDATOR=forgejo-runner bash scripts/workflow-parse-check.sh .: PARSED=30 TOTAL=30, passed.
  • scripts/contract-paths-check.sh docs/architecture/contracts: passed.
  • CI-equivalent shellcheck --severity=warning over scripts/: passed.
  • git diff --check: passed.

Artifact snapshot

  • Current head readback: 68ffdb01c8b0a0f0ad3aeeb7bfc926a13596b2f5.
  • The PR targets main; its moving base pointer is intentionally omitted from this body. The implementation snapshot base is recorded separately below.
  • The implementation snapshot base is 6c5f99f3a74c052f4f0007efa877300b321110c3; no rebase was performed while the repository allows an outdated branch.
  • No review request or merge performed.
Refs #1227 ## Contract - Read the complete `/actions/tasks` feed with `page=N&limit=M`, starting at page 1. - Continue after short non-empty pages and stop only on an explicit empty `workflow_runs` page. - Treat malformed HTTP-200 envelopes/pages, including `{}`, as could-not-grade. - Keep narrowing-looking filters out of this read because the measured instance ignores them. - Print `task_feed_pages`, `task_feed_rows`, and terminal-page `task_feed_total` so the whole-read cost is visible. ## Measured live evidence - Implementation snapshot: main `6c5f99f3a74c052f4f0007efa877300b321110c3`; the branch was created from that exact main tip. - `rt dispatch-check 6c5f99f3 --owner frankenbit --repo release-toolkit` completed with exit 0. - Readback: 14 distinct contexts, 41 status rows, 17 matching tasks; `task_feed_pages=503`, `task_feed_rows=25068`, `task_feed_total=25068`. Pages include the terminal empty page. - The live read used page and limit parameters and reached the empty terminal page rather than stopping at the first short page. ## Controls - Unit server returns a short page followed by more rows, then an empty page; it requires all three requests and all rows. - Mutation: stopping on `len(rows) < requested limit` made `TestDispatchReadsUseCanonicalEndpoints` fail (rc 1). - Mutation: mapping malformed-envelope decode errors to an empty page made `TestListActionTasksRejectsMalformedPageInsteadOfTreatingItAsEmpty` fail (rc 1). ## Verification - `go test -count=1 ./...` passed. - `go test -race -count=1 ./...` passed. - `go vet ./...`, `go build ./...`, and golangci-lint passed. - `bats --print-output-on-failure tests/`: 161/161 passed. - `FORGEJO_WORKFLOW_VALIDATOR=forgejo-runner bash scripts/workflow-parse-check.sh .`: `PARSED=30 TOTAL=30`, passed. - `scripts/contract-paths-check.sh docs/architecture/contracts`: passed. - CI-equivalent `shellcheck --severity=warning` over `scripts/`: passed. - `git diff --check`: passed. ## Artifact snapshot - Current head readback: `68ffdb01c8b0a0f0ad3aeeb7bfc926a13596b2f5`. - The PR targets `main`; its moving base pointer is intentionally omitted from this body. The implementation snapshot base is recorded separately below. - The implementation snapshot base is `6c5f99f3a74c052f4f0007efa877300b321110c3`; no rebase was performed while the repository allows an outdated branch. - No review request or merge performed.
fix(dispatch-check): paginate the complete task feed
Some checks failed
ac-closure-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 6s
changelog-body-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
check-self-bootstrap / check (pull_request) Successful in 5s
fork-pr-approval-notice / explain fork workflow approval (pull_request_target) Successful in 18s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 6s
gitea-twin-check / check (pull_request) Successful in 19s
ac-closure-check / ac-closure check (pull_request) Successful in 37s
ac-closure-check / check (pull_request) Successful in 0s
changelog-body-check / changelog body Cold-Read linter (pull_request) Successful in 37s
changelog-body-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Failing after 28s
fragment-check / changelog fragment-kind (pull_request) Successful in 38s
fragment-check / check (pull_request) Successful in 0s
register-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 9s
manifest-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 19s
tests / workflow-schema (pull_request) Successful in 4s
prep-order-check / check (pull_request) Successful in 23s
tests / dated-examples (pull_request) Successful in 5s
tests / shellcheck (pull_request) Successful in 4s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 40s
manifest-check / check (pull_request) Successful in 0s
workflow-parse-check / toolkit-self parse guard and controls (pull_request) Successful in 4s
tests / contract-paths (pull_request) Successful in 19s
register-check / register-drift check (pull_request) Successful in 38s
register-check / check (pull_request) Successful in 0s
workflow-parse-check / workflow parse and schema (pull_request) Successful in 24s
workflow-parse-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Has been cancelled
ce6280a2f8
docs(dispatch-check): update help snapshot
All checks were successful
changelog-body-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 7s
fork-pr-approval-notice / explain fork workflow approval (pull_request_target) Successful in 18s
check-self-bootstrap / check (pull_request) Successful in 6s
gitea-twin-check / check (pull_request) Successful in 8s
changelog-body-check / changelog body Cold-Read linter (pull_request) Successful in 38s
changelog-body-check / check (pull_request) Successful in 0s
manifest-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 22s
go-ci / lint + build + test (pull_request) Successful in 44s
prep-order-check / check (pull_request) Successful in 22s
register-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 22s
tests / workflow-schema (pull_request) Successful in 6s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 41s
manifest-check / check (pull_request) Successful in 0s
tests / contract-paths (pull_request) Successful in 6s
workflow-parse-check / toolkit-self parse guard and controls (pull_request) Successful in 5s
workflow-parse-check / workflow parse and schema (pull_request) Successful in 5s
workflow-parse-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 43s
tests / shellcheck (pull_request) Successful in 17s
register-check / check (pull_request) Successful in 0s
tests / dated-examples (pull_request) Successful in 24s
tests / bats (pull_request) Successful in 55s
ac-closure-check / check (pull_request) Successful in 0s
fragment-check / check (pull_request) Successful in 0s
ac-closure-check / ac-closure check (pull_request) Successful in 7s
ac-closure-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 19s
fragment-check / changelog fragment-kind (pull_request) Successful in 7s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 27s
68ffdb01c8
bosun requested review from lookout 2026-09-06 09:55:52 +02:00
lookout approved these changes 2026-09-06 10:07:08 +02:00
lookout left a comment

Approved exact head 68ffdb01c8 (server base 66ce9d76eb). Ran go test ./..., go vet ./..., go build ./..., golangci-lint, Bats 161/161, register-check, fragment-check, and diff-check. Independently verified the dispatch feed reads page=1&limit=M through a short non-empty page to an explicit empty workflow_runs page; malformed HTTP-200 {} returns ErrUnexpectedResponse with no partial feed; CLI reports page/row/total counts. Mutation of short-page termination failed the canonical feed test, malformed-page leniency failed the refusal test, and removal of feed-count output failed the CLI count assertion. No findings.

Approved exact head 68ffdb01c8b0a0f0ad3aeeb7bfc926a13596b2f5 (server base 66ce9d76eb0047cf9a618c81142b37319b2f465c). Ran go test ./..., go vet ./..., go build ./..., golangci-lint, Bats 161/161, register-check, fragment-check, and diff-check. Independently verified the dispatch feed reads page=1&limit=M through a short non-empty page to an explicit empty workflow_runs page; malformed HTTP-200 {} returns ErrUnexpectedResponse with no partial feed; CLI reports page/row/total counts. Mutation of short-page termination failed the canonical feed test, malformed-page leniency failed the refusal test, and removal of feed-count output failed the CLI count assertion. No findings.
bosun merged commit dbafdf4473 into main 2026-09-06 10:09:11 +02:00
bosun deleted branch rigger/1227-dispatch-pagination 2026-09-06 10:09:11 +02:00
Sign in to join this conversation.
No description provided.