S62: REST envelopes round 2 (repos + actions list endpoints)#303
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second wave of GitHub-compat envelope work, paired with S60. The
post-S60 dogfood (A02 audit) found that another half-dozen REST
endpoints had the same structural divergence S60 fixed for issues +
PRs + comments: bare arrays where the CLI expects
`{total_count, : [...]}` envelopes, and flat foreign keys
where the CLI expects nested objects.
Five list endpoints + the repo response are addressed here. Issue +
PR `html_url` (B7) is small enough to ship as a follow-on once
each handler's plumbing is touched; out of scope for this PR.
Findings closed
`{total_count, workflows: [...]}`.
`{total_count, workflow_runs: [...]}`. Jobs list also wrapped as
`{total_count, jobs: [...]}`.
returns `{total_count, secrets: [...]}`.
returns `{total_count, variables: [...]}`.
envelope (legacy `owner_login` / `owner_type` kept for one
cycle), plus `html_url`, `is_template`, `topics`,
`license: {key}`, `language`, `size` (KB), `pushed_at` (=
updated_at for now — we don't track a separate push column).
`presentRepo` grew two parameters (`topics`, `baseURL`); single-
GET and edit paths populate topics via a new `(*Handlers).topicsFor`
helper, while list endpoints skip it to avoid an N+1 (CLI list views
don't render topics anyway).
`owner_type` is rendered as title-case `"User"` / `"Organization"`
in the new envelope to match GitHub's contract exactly, while the
legacy flat `owner_type` keeps its lowercase form.
Test coverage
the envelope — touched workflows, runs, jobs, secrets (3 scopes),
variables.
owner envelope, html_url prefix, and pushed_at population.
Test plan
(`worker.TestPool_HappyPath` race-y, `repo handlers TestPullViewRequiredChecksSafeLinksAndRerunControls` DB seed issue) are also failing on origin/trunk; not introduced here.
Follow-ups
plumbing change, ~one focused commit per response type.
S63 sprint (CLI currently sends them, server ignores).