Skip to content

feat(catalog): complete Young catalog CLI contracts and pagination - #57

Merged
tiankaima merged 4 commits into
mainfrom
feat/young-community
Sep 15, 2026
Merged

tiankaima merged 4 commits into
mainfrom
feat/young-community

Conversation

@tiankaima

@tiankaima tiankaima commented Sep 15, 2026

Copy link
Copy Markdown
Member

What changed

Completed the Young catalog CLI contracts:

  • Fetch all pages by default while keeping explicit page and limit bounds.
  • Use canonical response data, route parameters, IDs, booleans, and date-range validation.
  • Add consistent pagination, date-unknown filtering, and JSON/table output for comments, subscriptions, organizers, and workspace events.
  • Keep organizer metadata bounded and use the paginated event list for activity records.

Remaining

The server OpenAPI artifact still needs to expose path parameters for some Young routes before the next contract sync.

@tiankaima
tiankaima marked this pull request as ready for review September 15, 2026 08:27
@tiankaima
tiankaima merged commit 4d74fff into main Sep 15, 2026
4 checks passed
@tiankaima
tiankaima deleted the feat/young-community branch September 15, 2026 09:14
tiankaima added a commit that referenced this pull request Sep 20, 2026
…in (#61)

`openapi-contract verify-source` only asserted that the server checkout
is *at* the pinned commit, and CI checks out exactly the pinned SHA, so
that assertion could never fail.

A pull-request head SHA stays fetchable from Life-USTC/server forever,
so the pin could point at a commit that was never on main while every
check passed: the provenance verified, the checkout matched, and the
vendored spec was byte-identical to the source.

This repository hit it. api/openapi.provenance.json was pinned at
fea7bb21ead65fa4da1d51d8ef36ef914a647783 ("fix(young): complete release
contracts", 2026-09-15) in #57, a pull-request head that is not an
ancestor of server main -- the server squash-merges, so PR heads never
land there. The generated client came from a discarded branch snapshot
and CI reported success until the contract was re-synced from 222eeb61.

Add `openapi-contract verify-reachable SERVER_DIR`, asserting
`git merge-base --is-ancestor <pin> <main>` against the server checkout.
`verify-source` and `sync` both call it, so CI rejects an unreachable
pin and the nightly sync refuses to write one.

Ancestry needs real history, so the server checkouts now use
`fetch-depth: 0` and fetch `refs/heads/main` explicitly. A shallow
checkout stays shallow even after fetching main, so the script refuses
to run there instead of guessing: a check that cannot be evaluated is
worse than no check. The same refusal covers a missing main ref and a
pin the checkout does not contain.

scripts/openapi-contract.test.sh builds synthetic server histories and
proves the check rejects an unmerged branch head -- reproducing the
incident where HEAD and the vendored spec both matched the pin -- and
accepts the main tip and older main commits. `make test` runs it before
the Go suite.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tiankaima tiankaima changed the title Complete Young catalog CLI contracts and pagination feat(catalog): complete Young catalog CLI contracts and pagination Sep 21, 2026
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