-
Notifications
You must be signed in to change notification settings - Fork 28
feat: Github Pages for Javadocs #6069
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
Conversation
.github/workflows/javadocs_scripts/google-cloud-java_javadocs_modules.txt
Outdated
Show resolved
Hide resolved
| SDK_PLATFORM_JAVA_TAG=$(grep -oP "(?<=${SDK_PLATFORM_JAVA}: \")[^\"]*" "$VARIABLES_FILE" | tr -d '\n') | ||
| echo "SDK_PLATFORM_JAVA_TAG=$SDK_PLATFORM_JAVA_TAG" >> $GITHUB_ENV | ||
|
|
||
| - name: Generate javadocs for modules within sdk-platform-java repo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The three new generate workflows have very similar logic, but slightly different setup steps.
Do they need to be different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am definitely open to refactoring how these workflows are set up.
The reason I've separated them into 3 separate ones is mainly due to navigating our repo structures which is why they're all similar but slightly different (more detail below).
-
generate_javadocs_sdk-platform-javaandgenerate_javadocs_google-cloud-javaare most similar where they grab the correct version tag to checkout their respective repos from thevariables.yamlfile, generate the javadocs for the appropriate modules, and then add them. -
generate_javadocs_handwritten_librariesuses a separate file containing the repos/versions tags (handwritten_libraries_javadocs_modules.txt) as it needs to checkout each repo, generate the javadocs, and add them to the site.
We could combine generate_javadocs_sdk-platform-java and generate_javadocs_google-cloud-java, but one benefit of having them as separate repos is that javadoc generation for the google-cloud-java repo takes a while (~1-1.5 hours) so if it fails, it's siloed from the other javadoc generation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See if we can refactor the common config stuff and just have the logic specific to each workflow in the file.
| output_file = 'variables.yaml' | ||
|
|
||
| # Excludes lines in versions.txt files that contain any of the following strings. Since we do not want to publish separate Javadocs for `google-cloud-<service>`, `grpc-google-<service>`, and `proto-google-<service>` artifacts, the latter two packages are excluded. | ||
| exclude_packages = ['gapic-generator-java', 'google-cloud-java', 'grpc-google-cloud', 'proto-google-cloud', 'google-cloud-bom', 'full-convergence-check', 'java-cloud-bom-tests', 'gax-httpjson', 'google-cloud-shared-dependencies'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this list relate to exclude_packages in parse_versionstxt_addl_repos.py?
Root question: Throughout these scripts, we have a mix of configuration (these lists) and logic (what to do). Can we split them, so it becomes easy to add/remove a new library/repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were copied from each other. Have refactored the scripts based on your feedback so that there are only 2 exclusion lists (one in libraryTable_generation.py and one in update_googlecloudjava_javadocs_modules.py), and have also refactored the parse_verionstxt.pyscript such that we no longer needparse_versionstxt_addl_repos.py`.
Understood on the config/logic mix; I've refactored this a bit so that it's hopefully easier to follow. Current logic is as follows:
-
Any modules in the sdk-platform-java repo that we generate javadocs for are explicitly listed in the
sdk-platform-java_javadocs_modules.txtfile. If we add any new modules, we will need to update that file. -
Any new modules in the google-cloud-java repo will be automatically included.
-
Any new handwritten libraries that are part of the
google-cloud-bom/pom.xmlwill be automatically included.
If there are any modules not part of the above, then we will need to figure out how to manually add them.
.github/workflows/javadocs_scripts/parse_versionstxt_addl_repos.py
Outdated
Show resolved
Hide resolved
…d with the update_site_var workflow. Update name of job in generate_javadocs_sdk-platform-java.yaml
…d with the update_site_var workflow
|
Is the |
Yep - there are some files within it that are needed to populate the Github Pages site (e.g. |
meltsufin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions/comments:
- What is the purpose of Hugo? I don't see it described in the design doc.
- Would it be possible to move most of the scripting out of the GitHub workfow configs so that they can be tested locally more easily? I think it is worthwhile to be careful not to lock ourselves into GitHub actions because it hinders local testing and migration to an alternative build system.
- What are the entrypoints? It looks like there are two main problems that are being solved here: (1) For a given libraries-bom version create a table of all modules in that release; (2) generate the javadocs for those modules. So, would it make sense to have an entrypoint script for each of those problems? I prefer this kind of separation because in the future we might want to download pre-built javadocs instead of re-generating them.
Did you hand-write all of those files or imported from somewhere? |
Thanks for pointing that out! I added a section in the design doc for it. Hugo is a static site generator and Docsy is a theme for Hugo (and is used by gRPC for their website which is the primary reason I used it).
I take your point; I need to think through what this might look like. We have time tomorrow to discuss.
I like how you articulated this. All of the scripts under All of entrypoint 2 (aka the javadoc generation) is happening in the 3 other workflows ( |
The The files within Everything else within |
What's the benefit of keeping the generated code in the repository? Also, the whole Hugo and Docsy setup seems a bit heavy for what appears to be a single documentation index page. Can we just use some plain HTML with a bit of CSS? |
|
Had an offline discussion with @burkedavison and @meltsufin; documenting below for reference:
|
|
Closing this in favor of #6083 |

Pared down version of #6032
This only includes the workflows/scripts/config files. The Javadocs should get populated at the next release/manual trigger. This should make it easier to review as it does not contain the static Javadoc files.
Once this is confirmed to work/merged, I will submit a follow up PR that updates the links to the Javadocsto be based off of this repo instead of my fork.