feat: publish a multi-version API reference site via GitHub Pages - #38
Conversation
The hand-written OpenAPI docs in the apollo repo only cover a fraction of the actual contract and keep drifting out of sync. Render every released spec version (plus the unreleased main HEAD) straight from apollo-openapi.yaml with Redocly CLI and publish it to GitHub Pages, so the reference stays complete and up to date automatically as tags are cut. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
nobodyiam
left a comment
There was a problem hiding this comment.
Thanks for adding the versioned API reference site. I reproduced npm ci and the full docs build at 3ba4a84; all 14 existing tags plus next build successfully, and the current checks are green.
Please address these blocking correctness issues before merging:
scripts/build-docs.sh:79-84swallows per-tag build failures and still publishes the site. A failed new release can therefore be omitted silently while the root page falls back to an older release. Please fail the build when any expected release tag cannot be rendered, unless an explicit legacy-tag allowlist is required..github/workflows/deploy-docs.yml:28-31checks out the triggering ref. On av*push that is the tag, sosite/nextis built from the tag commit rather than necessarily from the currentmainHEAD. Please buildnextexplicitly frommain.README.md:4,14,16points the official repository to the contributor-ownedshalk.github.iosite. The Pages address for this repository ishttps://apolloconfig.github.io/apollo-openapi/; please update the badge, main documentation link, and versions link accordingly before merging.
Non-blocking: please also consider regenerating package-lock.json against registry.npmjs.org instead of pinning the GitHub-hosted build to the Tencent mirror.
- fail the build when a release tag cannot be rendered, instead of skipping it and publishing a site that silently omits that release - always check out main, so site/next is built from main HEAD rather than from the tag commit on a v* push; released versions are read from git history and are unaffected - point the README badge and doc links at apolloconfig.github.io instead of the contributor fork Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The lock file pinned @redocly/cli to a Tencent mirror URL, which would send the upstream GitHub Actions build to a third-party regional mirror. The integrity hash is unchanged, so only the download host differs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thanks for the careful review. All three blocking items are addressed in 5b530cb, and the non-blocking one in 9e2a606. 1. A tag whose spec fails to render now aborts the whole build ( 2. Checkout is now pinned to One deliberate side effect worth calling out: on a 3. The badge, the main documentation link, and the versions link all point at Non-blocking: Regenerated against Remaining after merge, as noted in the test plan: GitHub Pages needs to be enabled on this repository (Settings → Pages → Source → "GitHub Actions") before |
nobodyiam
left a comment
There was a problem hiding this comment.
Thanks for the updates. Re-reviewed at 9e2a606; all three blocking items and the registry suggestion are addressed.
I verified npm ci and the full docs build for all 14 release tags plus next, confirmed that the root page matches v0.3.11, and checked the generated pages and version links. Fault-injection checks also confirmed that a failed tag render aborts the build. The current CI checks pass. No blocking findings remain.
After merging, please enable GitHub Pages with GitHub Actions as the source and verify the main/tag deployment paths and the published URL.
… site apolloconfig/apollo-openapi#38 has been merged and the official GitHub Pages deployment is live, so switch both docs from the contributor-owned shalk.github.io mirror to the official apolloconfig.github.io URL. Also fixes two non-blocking English wording nits requested in review. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
) * docs(openapi): link to the full auto-generated API reference site The hand-written interface list here only covers the core/commonly-used endpoints and will keep drifting out of sync with the actual spec. Point readers to the new Redocly-based reference site rendered directly from apollo-openapi.yaml (apolloconfig/apollo-openapi#38) for the complete, always-current endpoint list. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * docs(openapi): point to the official apolloconfig.github.io reference site apolloconfig/apollo-openapi#38 has been merged and the official GitHub Pages deployment is live, so switch both docs from the contributor-owned shalk.github.io mirror to the official apolloconfig.github.io URL. Also fixes two non-blocking English wording nits requested in review. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Summary
apollorepo only cover a fraction of the actual contract (~53 of ~152 endpoints today) and keep drifting out of sync as the spec grows. This publishes a static API reference site rendered directly fromapollo-openapi.yaml, so it can't drift.scripts/build-docs.sh(Redocly CLI) builds one page per released git tag (vX.Y.Z/) plus the currentmainHEAD asnext/(labeled unreleased), copies the latest tag's build to the site root (root = latest release, not HEAD, since Portal only ever pins tagged specs), and generates aversions.htmlindex — all driven off the live tag list, no hand-maintained version list to forget updating..github/workflows/deploy-docs.ymldeploys via the standardactions/upload-pages-artifact+actions/deploy-pagesflow, triggered on doc-relevant pushes tomainand unconditionally on everyv*tag (a new release always republishes the whole multi-version site).Test plan
npm install && ./scripts/build-docs.shlocally — all 14 existing tags (v0.1.0..v0.3.11) plusnextbuild successfully, correctly version-sorted (v0.3.10/v0.3.11afterv0.3.9, not lexically before it)site/locally and verified/,/next/,/v0.1.0/,/versions.htmlall return 200 with expected rendered titlessite/index.htmlis byte-identical to the latest tag'sindex.htmldeploy-docs.ymlruns and the Pages URL resolves correctlyOpen question for maintainers
This was built/tested against my fork, so
README.mdcurrently links tohttps://shalk.github.io/apollo-openapi/. If this merges here, that should becomehttps://apolloconfig.github.io/apollo-openapi/(or wherever Pages ends up hosted for this repo) — happy to push that fix once we agree on the target.🤖 Generated with Claude Code