Skip to content

Add paginated Screener clearance operations - #77

Closed
code-monger-givenall wants to merge 2 commits into
basecamp:mainfrom
code-monger-givenall:agent/screener-clearances
Closed

Add paginated Screener clearance operations#77
code-monger-givenall wants to merge 2 commits into
basecamp:mainfrom
code-monger-givenall:agent/screener-clearances

Conversation

@code-monger-givenall

@code-monger-givenall code-monger-givenall commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What changed

Adds generated operations for the HTML Screener list and clearance updates, plus a ClearancesService with List, ListWithLimit, Approve, and Deny.

List follows HEY's server-provided cursor links until there are no pages left. It rejects cross-origin links, detects loops, honors the SDK page cap, and removes duplicate clearance IDs.

The existing /clearances.json summary operation is unchanged. Generated requests now honor the requested response type before adding .json, so HTML and form routes keep their real paths.

Why

/clearances.json returns the pending count, not the pending senders. The HTML /clearances response contains the sender cards in batches of eight. Reading one response silently returns only the first batch.

Validation

  • env GOWORK=off mise x -- make check
  • 129 of 129 conformance cases passed
  • A read-only live check matched the summary count across 36 pages with no duplicate IDs

Summary by cubic

Adds paginated Screener clearance operations and honors per‑operation retry policies. Previously /clearances returned only the first 8 senders and retries followed a global default; now the SDK lists all pages and retries match each operation’s contract.

  • Implements ListClearances (GET /clearances, HTML) and UpdateClearance (PATCH /clearances/{clearanceId}, form). List retries up to 3 on 429/503; Update retries up to 2 on 429/503 and treats 302/303 redirects as success.
  • Adds ClearancesService with List, ListWithLimit, Approve, Deny. Follows server cursor links, rejects cross-origin links/redirects, detects loops, respects MaxPages, and de‑duplicates IDs.
  • Generated client honors the request’s Accept header before appending .json; HTML and form routes keep their real paths. Idempotent requests with bodies now buffer payloads for reliable retries. Client-level WithMaxRetries/WithBaseDelay override an operation only when explicitly set; otherwise the operation’s policy applies.
  • Conformance adds path and retry tests; spec and route coverage updated.

Migration/usage

  • No breaking changes; /clearances.json summary is unchanged.
  • Use client.Clearances().List(ctx) to fetch pending senders and Approve/Deny to act on them.
  • Set Accept: application/json to use automatic .json path extension; leave unset for HTML/form routes. Use WithMaxRetries/WithBaseDelay only if you need to override an operation’s retry limits/delay.

Written for commit 0e779b1. Summary will update on new commits.

Review in cubic

@code-monger-givenall
code-monger-givenall marked this pull request as ready for review August 19, 2026 17:36
Copilot AI balanced review requested due to automatic review settings August 19, 2026 17:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds paginated Screener clearance listing and approval/denial operations to the generated API and Go service layer.

Changes:

  • Models HTML listing and form-based clearance updates.
  • Adds pagination, deduplication, validation, and HTML parsing.
  • Updates generated clients, route artifacts, and conformance coverage.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spec/route-coverage.json Registers the new routes.
spec/hey.smithy Defines clearance operations and media types.
spec/excluded-routes.json Removes the PATCH exclusion.
openapi.json Adds generated OpenAPI operations and schemas.
go/pkg/hey/url-routes.json Adds route-table entries.
go/pkg/hey/client.go Exposes the service and honors response media types.
go/pkg/hey/clearances.go Implements listing, parsing, and updates.
go/pkg/hey/clearances_test.go Tests service behavior and validation.
go/pkg/generated/client.gen.go Adds generated request and response APIs.
conformance/tests/paths.json Adds path conformance cases.
conformance/runner/go/main.go Executes the new conformance operations.
behavior-model.json Records operation behavior metadata.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread go/pkg/hey/clearances.go Outdated
Comment thread spec/hey.smithy Outdated
Copilot AI review requested due to automatic review settings August 19, 2026 18:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated no new comments.

Suppressed comments (1)

go/pkg/hey/client.go:220

  • The generated client still does not honor these operations' retry policies. Only the global SDK defaults are copied here, while doWithRetry retries every idempotent operation on 429/500/502/503/504 for MaxRetries + 1 requests. Consequently, UpdateClearance defaults to four requests and retries statuses outside its declared maxAttempts: 2, retryOn: [429, 503] policy. Please carry the per-operation x-hey-retry metadata into generated retry execution (with a defined precedence for explicit client overrides).
		retryConfig := generated.DefaultRetryConfig()
		retryConfig.MaxRetries = c.httpOpts.MaxRetries
		retryConfig.BaseDelay = c.httpOpts.BaseDelay

@code-monger-givenall

Copy link
Copy Markdown
Contributor Author

Superseded by #92, which added the typed Screener operations on current main. I moved the remaining generated retry-policy fix to #94 so the two concerns can be reviewed independently.

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.

2 participants