Skip to content

chore(internal/godocfx): support individual package .repo-metadata.json#13859

Merged
hongalex merged 2 commits intogoogleapis:mainfrom
hongalex:publish-docs-fix
Feb 23, 2026
Merged

chore(internal/godocfx): support individual package .repo-metadata.json#13859
hongalex merged 2 commits intogoogleapis:mainfrom
hongalex:publish-docs-fix

Conversation

@hongalex
Copy link
Member

The single internal/.repo-metadata-full.json file was removed in
favor of individual .repo-metadata.json files located within package
directories. godocfx was dependent on fetching this.

This PR updates the metadata resolution to:

  1. Search upwards from the package directory to the module root for a .repo-metadata.json file.
  2. Load the API description from the local metadata file.
  3. Provide a fallback mechanism for tests and older module versions.

Also updated test goldens to reflect metadata resolution changes and
improved symbol linking.

Fixes: b/462186715

@hongalex hongalex requested review from a team as code owners February 18, 2026 01:24
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully refactors the godocfx tool to support individual .repo-metadata.json files, moving away from a single, centralized metadata file. The new implementation correctly searches for metadata files upwards from the package directory and includes a fallback mechanism. The test suite and golden files have been thoroughly updated to reflect these changes, ensuring the new metadata resolution logic works as expected and improves symbol linking in the generated documentation. The changes are well-implemented and align with the stated objectives of the pull request.

@hongalex hongalex requested a review from shollyman February 19, 2026 01:08
@hongalex hongalex merged commit 2435533 into googleapis:main Feb 23, 2026
10 checks passed
hongalex added a commit that referenced this pull request Feb 24, 2026
…3887)

#13859 was the precursor to this, but only searched from package -> root
module, and thus couldn't find `.repo-metadata.json` files for packages
like
[Translate](https://github.com/googleapis/google-cloud-go/blob/main/translate/translate.go)

The appropriate file lives at `translate/apiv3/.repo-metadata.json`, so
we need to walk through the subdirectories as well.

There's one remaining issue that the zipped version of translate
(v1.27.1) doesn't actually contain this new json file, so simply running
`./godocfx cloud.google.com/go/translate` will fail, but `./godocfx
cloud.google.com/go/translate@main` (at head) will succeed. This should
be fine since publish_docs should only be done on new releases, but if
this assumption is wrong, we can update this as a fallback.
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.

2 participants