-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore: update hermetic library generation workflow #10693
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
Changes from 16 commits
ae8e207
b20b0c5
8cef63a
018be46
003a3e2
932d1a1
8a4293e
064fff2
9ffd66d
19c7912
cca96ea
11e2255
314d136
fc85560
9b612c8
3acdfde
102b46c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remind me what this file is used for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This workflow is used to verify generated files, e.g., There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if we do want to update There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The check will fail. This is a not required check only to remain the author the change is indeed intentional.
root pom and gapic-libraries-bom are generated through hermetic build cli script (just like repo-level post processing). Other checks are done through shell script in this repo, which are not generating any java file, so they are relatively fast. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# Github action job to test core java library features on | ||
# GitHub action job to test core java library features on | ||
# downstream client libraries before they are released. | ||
on: | ||
push: | ||
|
@@ -20,7 +20,7 @@ on: | |
pull_request: | ||
name: generation diff | ||
env: | ||
library_generation_image_tag: latest | ||
library_generation_image_tag: 2.39.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this configured to be updated renovate bot? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I plan to update renovate config in separate PR. |
||
repo_volumes: "-v repo-google-cloud-java:/workspace/google-cloud-java" | ||
jobs: | ||
root-pom: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,42 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# GitHub action job to test core java library features on | ||
# downstream client libraries before they are released. | ||
name: Hermetic library generation upon generation config change through pull requests | ||
on: | ||
pull_request: | ||
types: | ||
- synchronize | ||
paths: | ||
- generation_config.yaml | ||
- "generation_config.yaml" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the trigger only for main branch? If yes, can this be configured to be triggered for other branches, like a future LTS branch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be triggered when a pull request changes Therefore, it can be used in any branch since the pull request is not necessarily based on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see any configuration for a target branch, does it mean if I create a PR with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. |
||
|
||
jobs: | ||
library_generation: | ||
runs-on: ubuntu-latest | ||
env: | ||
library_generation_image_tag: latest | ||
repo_volumes: "-v repo-google-cloud-java:/workspace/google-cloud-java" | ||
library_generation_image_tag: 2.39.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this configured to be updated renovate bot? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I plan to update renovate config in separate PR. |
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: get baseline generation config | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.base_ref }} | ||
path: baseline | ||
sparse-checkout: generation_config.yaml | ||
- name: diff | ||
fetch-depth: 0 | ||
- name: Generate changed libraries | ||
shell: bash | ||
run: | | ||
diff generation_config.yaml baseline/generation_config.yaml | ||
set -x | ||
[ -z "$(git config user.email)" ] && git config --global user.email "[email protected]" | ||
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" | ||
bash generation/hermetic_library_generation.sh \ | ||
--target_branch ${{ github.base_ref }} \ | ||
--current_branch ${{ github.head_ref }} \ | ||
--image_tag "${library_generation_image_tag}" | ||
env: | ||
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# GitHub action job to test core java library features on | ||
# downstream client libraries before they are released. | ||
name: Update googleapis commit | ||
on: | ||
schedule: | ||
- cron: '* 2 * * *' | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
update-googleapis-commit: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
# the branch into which the pull request is merged | ||
base_branch: lts-11 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this is a test value. I changed it to |
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Update googleapis commit to latest | ||
shell: bash | ||
run: | | ||
set -x | ||
[ -z "$(git config user.email)" ] && git config --global user.email "[email protected]" | ||
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" | ||
bash generation/update_googleapis_commit.sh \ | ||
--base_branch "${base_branch}"\ | ||
--repo ${{ github.repository }} | ||
env: | ||
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} |
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.
nit (maybe not in scope): What's the purpose of this script? Maybe a one-liner comment can help.
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.
There's a one-liner comment in each job in the workflow.