Skip to content

feat: generate per-package contract docs, aligned with docs/code/ convention - #130

Merged
ntlaletsi70 merged 1 commit into
developfrom
feat/contract-docs-generation
Aug 22, 2026
Merged

ntlaletsi70 merged 1 commit into
developfrom
feat/contract-docs-generation

Conversation

@ntlaletsi70

Copy link
Copy Markdown
Collaborator

Summary

  • Adds `mage docs`, which generates Markdown documentation from `.proto` comments via `protoc-gen-doc`, driven by `buf` — one file per proto package directory (`docs/code/blanketops/.md`), matching exactly the `docs/code/` layout `gomarkdoc` produces in the sibling `environments` and `environments-controller` repos.
  • Wired into `finalize-release.yml` only, right after the existing Go/TS codegen step — this repo already generates and commits its Go/TS contracts exclusively at release time (no async on-push-to-main job), which is the correct, race-free pattern the sibling repos' docs generation had to be retrofitted into after hitting a real develop/main drift bug this session. Docs generation follows that same already-correct shape from the start — no new race introduced.
  • Cleaned up banner-divider comments (`// ====...====`) in 11 `.proto` files first — `protoc-gen-doc` attaches a message/service's leading comment block the same way Go's doc tooling does (no blank line before the declaration), so an attached banner would have rendered as literal ASCII dashes in the generated docs, the same failure mode already fixed across the Go repos this session. Verified with `buf lint` and `buf build` that the comment-only edits didn't break anything, and spot-checked the generated output renders clean.
  • Includes the initial generated `docs/` output so docs exist immediately rather than waiting for the next release cut.

Test plan

  • `buf lint` / `buf build` clean after the banner cleanup
  • `go build ./...` clean
  • `mage lint` passes
  • `mage docs` generates cleanly, output spot-checked (e.g. `Route` message renders "Resource" as its description, no ASCII dashes)
  • Exercise `mage docs` as part of a real `finalize-release.yml` run

…vention

Adds `mage docs`, which generates Markdown documentation from .proto
comments via protoc-gen-doc, driven by buf -- one file per proto
package directory (docs/code/blanketops/<path>.md), matching exactly
the docs/code/ layout gomarkdoc produces in the sibling environments
and environments-controller repos.

Wired into finalize-release.yml only, right after the existing Go/TS
codegen step -- this repo already generates and commits its Go/TS
contracts exclusively at release time (no async on-push-to-main job),
which is the correct, race-free pattern the sibling repos' docs
generation had to be retrofitted into after hitting a real drift bug.
Docs generation follows that same already-correct shape from the
start.

Cleaned up banner-divider comments (`// ====...====`) in 11 .proto
files first -- protoc-gen-doc attaches a message/service's leading
comment block the same way Go's doc tooling does (no blank line before
the declaration), so an attached banner would have rendered as literal
ASCII dashes in the generated docs, same failure mode already fixed
across the Go repos. Verified with `buf lint` and `buf build` that the
comment-only edits didn't break anything, and spot-checked the
generated output renders clean.

Includes the initial generated docs/ output so docs exist immediately
rather than waiting for the next release cut.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ntlaletsi70
ntlaletsi70 merged commit f94bbac into develop Aug 22, 2026
1 check 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