Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(java-templates): custom templates needs to load partial metadata #788

Merged
merged 4 commits into from
Oct 8, 2020

Conversation

chingor13
Copy link
Contributor

@chingor13 chingor13 commented Oct 7, 2020

Refactors partial parsing into a separate module for re-use.

For java, we are using CommonTemplates.render() which does not include any magic metadata loading like CommonTemplates._generic_library() does. Instead allow the partial yaml parsing to be used externally and explicitly load the partial metadata in the java.custom_templates() helper. This fixes the README generation from our README autosynth.

Fixes #791

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 7, 2020
def load_partials(files: List[str] = _DEFAULT_PARTIAL_FILES) -> Dict:
"""
hand-crafted artisinal markdown can be provided in a .readme-partials.yml.
The following fields are currently supported:
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this refactor 👍

It might be worth running the branch against one Node.js repo that uses partials, just to make sure it behaves as expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ran this against nodejs-storage and it succeeded with no changes to the README.md

@chingor13 chingor13 merged commit b6164c2 into googleapis:master Oct 8, 2020
@chingor13 chingor13 deleted the partials branch October 8, 2020 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split Java README job is not loading readme-partials.yaml
4 participants