Skip to content

feat(docs): add API reference generation and PR CI - #1

Merged
moonyue-w merged 5 commits into
mainfrom
1789870148-go-sdk-docs-ci-gate
Sep 22, 2026
Merged

moonyue-w merged 5 commits into
mainfrom
1789870148-go-sdk-docs-ci-gate

Conversation

@moonyue-w

Copy link
Copy Markdown
Collaborator

Summary

  • generate and commit deterministic API reference with pinned gomarkdoc
  • add docs drift, source-link normalization, core-surface sanity, and internal-link checks
  • document Makefile entry points and add PR CI for lint, build, test, and docs-check

Testing

  • make lint
  • make build
  • make test
  • make docs-check

Add internal/docs Go tool that shells out to gomarkdoc@v1.1.0 with
--repository.default-branch main, wipes docs/api/ and rewrites a single
docs/api/reference.md, then post-processes to strip #Lxx line anchors so
the committed reference is a byte-stable artifact of the current commit.

New Makefile targets: docs / docs-check / lint. docs-check is stubbed and
implemented in the follow-up task.

Discovery spike observations (retained in the task ledger):
  - source links only appear with explicit --repository.* flags
  - all 3802 QoderAI URLs land on blob/main/... with #Lxx(-Lyy) anchors
  - two runs at the same commit + Go toolchain are byte-identical
  - no timestamps / absolute paths / user identifiers observed

Task: 1789870148
Regenerates docs/api/reference.md, then runs a four-stage gate:
  1. `git diff --exit-code -- docs/api` for drift
  2. every QoderAI blob URL must be on 'main' ref without #Lxx anchors
  3. core public surface (forward.Client / managed.Client / apierror.Error
     plus both NewClient constructors) must appear in the output
  4. relative markdown links must resolve (fenced code blocks are excluded
     so Go generics don't false-positive)

Drift RED verified by appending a temporary GoDoc comment to
forward/client.go — check surfaced the diff and exited non-zero.

Task: 1789870148
Extends README ## Development with make lint + a new API reference
subsection pointing at docs/api/reference.md and the gomarkdoc-backed
regeneration flow. Also gofmt-aligns comments in internal/docs/check.go
so make lint passes cleanly.

Task: 1789870148
.github/workflows/ci.yml runs on pull_request and push(main) with
contents:read scope. Matrix job iterates Go 1.23.x (module minimum) and
1.26.x, invoking make lint (gofmt + go vet) → make build → make test
(offline). docs-check runs on a single pinned Go version (1.26.x) —
go/doc rendering varies across Go versions so drift must be judged
against exactly one toolchain.

Verified locally: all four commands green.

Task: 1789870148
@moonyue-w
moonyue-w merged commit 09cb2c6 into main Sep 22, 2026
3 checks passed
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