Skip to content

fix: allow overriding source directory per class in GitHub links#285

Merged
jinseopkim0 merged 2 commits intomainfrom
firestore-name
Feb 4, 2026
Merged

fix: allow overriding source directory per class in GitHub links#285
jinseopkim0 merged 2 commits intomainfrom
firestore-name

Conversation

@jinseopkim0
Copy link
Contributor

@jinseopkim0 jinseopkim0 commented Jan 27, 2026

Currently, the doclet assumes the source directory name matches the
artifact ID when generating GitHub links. This leads to broken links
for libraries where they differ, such as Firestore (artifact:
google-cloud-firestore, directory: google-cloud-firestore-admin
for FirestoreAdminClient).

This change adds an optional library_path_overrides map to
RepoMetadata and updates ClassBuilder to check this map using the
simple class name before falling back to the artifact ID.

Fixes: b/442875200

@jinseopkim0 jinseopkim0 marked this pull request as ready for review January 27, 2026 18:06
@jinseopkim0 jinseopkim0 requested a review from a team January 27, 2026 18:06
@jinseopkim0 jinseopkim0 enabled auto-merge (squash) January 27, 2026 18:06
@jinseopkim0 jinseopkim0 disabled auto-merge January 27, 2026 18:06
@jinseopkim0 jinseopkim0 enabled auto-merge (squash) January 27, 2026 18:06
@jinseopkim0 jinseopkim0 disabled auto-merge January 27, 2026 18:09
@jinseopkim0 jinseopkim0 marked this pull request as draft January 27, 2026 18:09
Currently, the doclet assumes the source directory name matches the
artifact ID when generating GitHub links. This leads to broken links
for libraries where they differ, such as Firestore (artifact:
`google-cloud-firestore`, directory: `google-cloud-firestore-admin`
for `FirestoreAdminClient`).

This change adds an optional `library_path_overrides` map to
`RepoMetadata` and updates `ClassBuilder` to check this map using the
simple class name before falling back to the artifact ID.

Fixes: b/442875200
@jinseopkim0 jinseopkim0 changed the title fix: allow overriding source directory in GitHub links fix: allow overriding source directory per class in GitHub links Jan 27, 2026
@jinseopkim0 jinseopkim0 marked this pull request as ready for review January 27, 2026 18:54
@jinseopkim0 jinseopkim0 requested a review from zhumin8 January 27, 2026 19:00
method.setAccessible(true);
String html = (String) method.invoke(builder, classElement, repoMetadata);

// 4. Verify link contains "google-cloud-firestore-admin" and the double slash "//"
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe unrelated: why are the double slash "//" necessary?

@jinseopkim0 jinseopkim0 enabled auto-merge (squash) February 4, 2026 19:43
@jinseopkim0 jinseopkim0 merged commit 239d067 into main Feb 4, 2026
5 of 8 checks passed
@jinseopkim0 jinseopkim0 deleted the firestore-name branch February 4, 2026 19:44
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