-
Notifications
You must be signed in to change notification settings - Fork 53
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
chore: initiate library generation if Dockerfile is changed #2878
Conversation
exit 0 | ||
fi | ||
# copy generation configuration from target branch to current branch. | ||
git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}" | ||
config_diff=$(diff "${generation_config}" "${baseline_generation_config}" || true) | ||
|
||
# install generator locally since we're using a SNAPSHOT version. | ||
mvn -V -B -ntp clean install -DskipTests |
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 not sure we want to move mvn install
and docker build
to the scripts here. It does provide better encapsulation, but people often want to run the scripts directly in local, doing this here would significantly slow things down. I think it's OK to keep them in the workflow at this moment.
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.
This workflow will run on every pull request and it'll take ~5 mins to build the image and install generator only to discovery that there's no config/Dockerfile change or no code change at last.
The trade-off here is to speed up checks in pull requests.
On the other hand, I don't think this script is good for local development since it will checkout branches and create pull request.
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.
This workflow will run on every pull request and it'll take ~5 mins to build the image and install generator only to discovery that there's no config/Dockerfile change or no code change at last.
That's a good point, agreed.
I don't think this script is good for local development
Looks like it does not. Can we add more info regarding local development in a follow up task? For example, what are the steps if I want to generate a random library with a SNAPSHOT version of generator and/or docker images? We have some good stuff already in DEVELOPMENT.md, and we can add more on top of it.
Quality Gate passed for 'gapic-generator-java-root'Issues Measures |
Quality Gate passed for 'java_showcase_integration_tests'Issues Measures |
In this PR:
docker build
andmvn install
in shell script to speed up the workflow run if no changes in thegeneration_config.yaml
andDockerfile
.Example run: https://github.com/JoeWang1127/sdk-platform-java/actions/runs/9473714657/job/26101875644?pr=8