Skip to content

docgen: align online mode field metadata with --file mode#926

Merged
zeevdr merged 1 commit into
mainfrom
912-docgen-online-parity
Jun 11, 2026
Merged

docgen: align online mode field metadata with --file mode#926
zeevdr merged 1 commit into
mainfrom
912-docgen-online-parity

Conversation

@zeevdr

@zeevdr zeevdr commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

  • The same schema documented differently depending on how it was loaded: adminSchemaToDocgen dropped Info, Title, Example, Examples, ExternalDocs, Tags, Format, ReadOnly, WriteOnce, Sensitive, VersionDescription, and AllowedSchemes that --file mode renders. Online mode now maps the full admin-client surface, structured to read in parallel with schemaFromYAML.
  • Root-causing the gap surfaced that adminclient itself dropped proto FieldConstraints.allowed_schemes; adminclient and grpctransport now carry it both directions.
  • A reflection-based drift-guard test walks all seven struct pairs, so a future adminclient field addition fails the test until it is mapped (or explicitly listed as not-documented). Mutation-tested in both failure directions.
  • A parity test renders the same schema through both loaders and asserts byte-identical markdown.

Test plan

  • make test — all modules pass
  • ./scripts/check-coverage.sh — cmd/decree 87.4% (≥86.1), sdk/adminclient 98.3% (≥97.7); changed grpctransport functions at 100% per go tool cover -func
  • make lint-go clean; go build/go vet clean in touched modules
  • Tagged compile checks: e2e, e2e upgrade, stress, chaos, integration, example across all examples modules

Closes #912

adminSchemaToDocgen now maps every documentation-relevant property the
admin client carries — info, title, example(s), externalDocs, tags,
format, readOnly, writeOnce, sensitive, and version_description — so a
schema fetched from the server documents identically to one read with
--file. adminclient.FieldConstraints gains AllowedSchemes, which the
proto carries but the SDK dropped, mapped in both grpctransport
directions. A reflection-based drift test fails whenever a future
adminclient property is neither mapped nor explicitly recorded as
non-documentation metadata.

Closes #912

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zeevdr zeevdr added this to the Docs Toolkit milestone Jun 11, 2026
@zeevdr zeevdr added size: S Quick win — a few hours or less priority: P2 Nice-to-have labels Jun 11, 2026
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zeevdr zeevdr merged commit a41874d into main Jun 11, 2026
21 checks passed
@zeevdr zeevdr deleted the 912-docgen-online-parity branch June 11, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P2 Nice-to-have size: S Quick win — a few hours or less

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docgen: online mode drops field metadata shown in --file mode

1 participant