Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

feat: grab repository metadata#364

Merged
dandhlee merged 3 commits intomainfrom
extract_shortname
Apr 1, 2024
Merged

feat: grab repository metadata#364
dandhlee merged 3 commits intomainfrom
extract_shortname

Conversation

@dandhlee
Copy link
Copy Markdown
Collaborator

@dandhlee dandhlee commented Mar 30, 2024

I've noticed an issue with the rest of the libraries not being able to properly find the library names from the given Sphinx info.

Seems like I need to extract the .repo-metadata.json file directly to source this information - Sphinx has very limited ways to deliver this information through docs/conf.py.

Based on the googleapis/ repo search, it seems that using name suffices for shortname for the library. If I encounter ones that don't work, I'll create an exception around those few. I've sampled ~100 and seems to work with using name instead of api_shortname.

Verified that existing library generation demo for bigframes and logging still works.

If the repository metadata could not be retrieved, skip over getting the summary page details.

Fixes b/331977022.

  • Tests pass
  • Appropriate changes to README are included in PR

@product-auto-label product-auto-label Bot added the size: s Pull request size is small. label Mar 30, 2024
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Mar 30, 2024
@dandhlee dandhlee marked this pull request as ready for review March 30, 2024 02:05
@dandhlee dandhlee requested review from a team and dansaadati March 30, 2024 02:05
Comment thread docfx_yaml/extension.py Outdated

for entry in yaml_data:
if not app.env.library_shortname:
continue
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This would apply to the whole library, right? If so, I think you can just break instead of continue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You're right, done.

Comment thread docfx_yaml/extension.py Outdated
import shutil
import black
import logging
import json
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: import ordering

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done. I was able to sort through the first party libraries.

Copy link
Copy Markdown
Collaborator Author

@dandhlee dandhlee left a comment

Choose a reason for hiding this comment

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

Thank you! Verified that new changes did not change the result.

Comment thread docfx_yaml/extension.py Outdated
import shutil
import black
import logging
import json
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done. I was able to sort through the first party libraries.

Comment thread docfx_yaml/extension.py Outdated

for entry in yaml_data:
if not app.env.library_shortname:
continue
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You're right, done.

@dandhlee dandhlee merged commit 1318b24 into main Apr 1, 2024
@dandhlee dandhlee deleted the extract_shortname branch April 1, 2024 04:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants