-
Notifications
You must be signed in to change notification settings - Fork 89
build: enable hermetic library generation #2566
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
|
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
| gapic_generator_version: 2.42.0 | ||
| googleapis_commitish: b2c018cb067ab01cb5db2170b73a82caef173ae4 | ||
| libraries_bom_version: 26.38.0 |
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.
Will libraries_bom_version and gapic_generator_version be updated by renovate bot, or the update_generation_config action?
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.
They will be updated by update_generation_config
java-storage/.github/scripts/update_generation_config.sh
Lines 97 to 103 in 68ee05a
| # update gapic-generator-java version to the latest | |
| latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java") | |
| update_config "gapic_generator_version" "${latest_version}" "${generation_config}" | |
| # update libraries-bom version to the latest | |
| latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom") | |
| update_config "libraries_bom_version" "${latest_version}" "${generation_config}" |
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.
Could that cause any issues if the version in the library or samples updates via renovate-bot first?
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.
libraries_bom_version is only used to generate the version in README by the hermetic build scripts, it should not cause any conflicts with the libraries bom version in samples.
There is no gapic_generator_version in pom, I guess you mean sdk-patform-java-config, which includes gax changes? If yes, this is similar to what we have right now with owlbot PRs.
The owlbot PR changes from the generator update may require gax changes. Similarly, the Cloud Java Bot PR may require us to merge the sdk-patform-java-config update first. But there should not be any issues the other way around, we should be free to merge sdk-patform-java-config update anytime, without waiting on Cloud Java Bot PRs created from the gapic_generator_version update.
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.
Thanks for clarifying
| runs-on: ubuntu-22.04 | ||
| env: | ||
| # the branch into which the pull request is merged | ||
| base_branch: main |
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.
When we make branches for lts releases will this need to be manually changed?
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.
It depends on the type of LTS.
- If it is an LTS that does not need regular updates to googleapis_commitish or generator version, basically the LTS branches we current have. Then we would not set up any automation for it, and only change the generator version when there is a critical bug fix.
- If it is an LTS that requires regular updates, for example, if we want to introduce a Java 21 branch, then yes we will need to update this config on the Java 21 branch.
BenWhitehead
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.
I'm okay with the changes as outlined here. How do we get the status check to actually turn green?
@BenWhitehead We confirmed it works in a diegomarquezp#10 (diegomarquezp#10). It requires |
This is part of the effort to enable multi-version support in hand-written libraries. More context and details in this doc.
This PR adds two workflows and their scripts:
update_generation_configwhich updatesgeneration_config.yaml(added in this PR) to contain the latestgoogleapis_committish(source of truth of library generation) as well as other dependencies such asgapic_generator_version. This job runs nightly and creates a PR that modifies the config yaml.hermetic_library_generationwhich readsgeneration_config.yamland pushes a new commit to any PR whose latest commit affectsgeneration_config.yaml(e.g. the nightly PR created byupdate_generation_config). It essentially translates changes in the config yaml to changes in the source code (of the generated part). This workflow will be a required check.As an example of how they work in practice:
update_generation_configcreates a PR that updatesgeneration_config.yamlwith the latest dependencies and googleapis committishhermetic_library_generationis triggered by this PR and generates the corresponding code changes. A new commit with the code changes is added to the PR. This step may occur for any PR affectinggeneration_config.yaml.Follow ups
CLOUD_JAVA_BOT_TOKENto repository for the hermetic generation workflow to work. We confirmed it works in a fork (job link).