Skip to content

Commit ac8dba7

Browse files
committed
[docs] bind branch pagination to repository identity
Signed-off-by: Viwat Vchirawongkwin <viwat.v@chula.ac.th>
1 parent 1ed3766 commit ac8dba7

3 files changed

Lines changed: 27 additions & 17 deletions

File tree

‎docs/decisions/0042-prefill-official-examples-and-discover-branches.md‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,16 @@ inputs would break existing advanced and reproducible-import workflows.
7474
and publishes no partial catalog. An empty catalog is displayed honestly
7575
and cannot be browsed in branch mode.
7676

77-
7. **Keep pagination inside the exact-host boundary.** The client validates
78-
GitHub's `Link` pagination metadata, including exact HTTPS host, repository
79-
branch path, `per_page`, and strictly increasing `page`. It never directly
77+
7. **Keep pagination inside the exact-host boundary.** Repository metadata
78+
also supplies a positive numeric repository `id`. The client validates
79+
GitHub's `Link` pagination metadata, including exact HTTPS host, either the
80+
locator-derived `/repos/{owner}/{repo}/branches` path or GitHub's canonical
81+
`/repositories/{id}/branches` path bound to that metadata identity,
82+
`per_page`, and a `page` that advances by exactly one. It never directly
8083
follows a response-provided URL; it constructs the next exact
81-
`api.github.com` request from validated local values. Each page uses the
82-
existing absolute request deadline, cancellation, response-body, error,
83-
and rate-limit rules.
84+
`api.github.com` request from the validated local locator and page number.
85+
Each page uses the existing absolute request deadline, cancellation,
86+
response-body, error, and rate-limit rules.
8487

8588
8. **Pin after selection.** A branch catalog and any commit SHA contained in a
8689
branch-list response are advisory and moving. Browse passes only the chosen

‎docs/specifications/App/TDD.md‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -816,18 +816,21 @@ tablet view. These are hard resource ceilings, not pagination: the subset never
816816
silently presents a partial folder.
817817

818818
Before normal-mode resolution, `listBranches(locator)` reads repository
819-
metadata for `default_branch`, then serially reads the public branches endpoint
820-
with `per_page=100` and increasing `page`. It publishes only a complete
819+
metadata for `default_branch` and a positive numeric repository `id`, then
820+
serially reads the public branches endpoint with `per_page=100` and increasing
821+
`page`. It publishes only a complete
821822
`GithubBranchCatalog`: at most 512 exact names over six pages, 512 KiB per
822823
branch page, and 2 MiB across branch-page bodies. Invalid/duplicate names,
823824
malformed metadata or pagination, a 513th name, or a further page fails without
824825
publishing accumulated names. `Link` metadata is accepted only when its next
825-
URL is HTTPS on exact host `api.github.com`, has the exact repository branches
826-
path and expected page parameters, and advances by one; the returned URL is
827-
never followed directly. The adapter constructs the next request from its
828-
validated locator and page number. The reported default is first and selected;
829-
remaining branches use `String.compareTo`. An empty catalog is displayed and
830-
cannot Browse in branch mode.
826+
URL is HTTPS on exact host `api.github.com`, has either the locator-derived
827+
`/repos/{owner}/{repo}/branches` path or GitHub's canonical
828+
`/repositories/{id}/branches` path for that metadata identity, carries only
829+
the expected page parameters, and advances by one; the returned URL is never
830+
followed directly. The adapter constructs the next request from its validated
831+
locator and page number. The reported default is first and selected; remaining
832+
branches use `String.compareTo`. An empty catalog is displayed and cannot
833+
Browse in branch mode.
831834

832835
The normal ref control is a searchable branch-only chooser. A localized
833836
advanced action exposes the retained manual branch/tag/commit field, including

‎docs/specifications/App/specs.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,13 @@ adds the novice ref-selection path without weakening A33-SUB-AC-1..10:
347347
catalog or none: at most 512 names, six pages, 512 KiB per branch page, and
348348
2 MiB across branch-page bodies. A 513th name, further next page, duplicate
349349
or invalid name, malformed metadata/page/link, or exceeded byte bound MUST
350-
return a localized typed failure. Pagination links MUST be validated for the
351-
exact HTTPS API host, repository path, page, and page size but MUST NOT be
352-
followed directly; the client constructs the next exact-host request. MUST
350+
return a localized typed failure. Metadata MUST provide the positive numeric
351+
repository identity used to bind GitHub's canonical
352+
`/repositories/{id}/branches` pagination path. Pagination links MUST be
353+
validated for the exact HTTPS API host, either that identity-bound path or
354+
the locator-derived repository branch path, the next consecutive page, and
355+
the fixed page size, but MUST NOT be followed directly; the client constructs
356+
the next exact-host request from local values. MUST
353357
- **A33-BRANCH-AC-4 (state, rate, and accessibility)** — Branch loading MUST
354358
be a distinct visible/cancellable state. Editing the repository clears the
355359
catalog and all dependent pinned/navigation/selection/review state without

0 commit comments

Comments
 (0)