-
Notifications
You must be signed in to change notification settings - Fork 64
chore: re-generate when config or Dockerfile is changed #3146
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
gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \ | ||
--baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \ | ||
--current-generation-config-path="${workspace_name}/${generation_config}" | ||
gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" |
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.
Is the commit history going to be populated correctly if we don't pass the baseline generation config into the image?
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.
No, the commit history has to go through baseline/current config comparison.
However, in this repo, we don't have config changes other than googleapis commit since everything else is baked in the image.
git add --all -- ':!pr_description.txt' | ||
changed_files=$(git diff --cached --name-only) | ||
if [[ "${changed_files}" == "" ]]; then | ||
echo "There is no generated code change with the generation config and Dockerfile change ${config_diff}." |
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.
We actually mentioned Dockerfile change
in the message but it was not achieved before?
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.
Dockerfile is not part of generation config, so the previous docker run
won't generate anything if Dockerfile is the only change.
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.
LGTM. IIUC this is more generic than only allowing changes in the Dockerfile. I think this can allow modifications coming from anything that alters the output of the generation: postprocessing, gapic generator, Dockerfile, etc. And it's great to allow this btw, but maybe the title/description should be something like "re-generate when config or generation workflow has changed"?
From internal discussion with @JoeWang1127, this is wrong. There was a modification on what would allow the generation to start made in 74f20a2. So only the Dockerfile or the config yaml would trigger this. |
|
|
In this PR: - Re-generate common protos and iam if generation config or Dockerfile is changed. I use #3145 to verify the change.
In this PR:
I use #3145 to verify the change.