-
Notifications
You must be signed in to change notification settings - Fork 778
chore: add Cloud Build build retry in deploy helper #1436
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: add Cloud Build build retry in deploy helper #1436
Conversation
@apeabody Could you PTAL? |
retry in 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.
Thanks @daniel-cit!
/gemini review |
1 similar comment
/gemini review |
Important Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services. |
/gemini review |
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.
Code Review
This pull request introduces a retry mechanism for Cloud Build builds that fail with transient errors. The changes are mostly in helpers/foundation-deployer/gcp/gcp.go
, with corresponding updates to tests and call sites. The overall approach is sound, but I've identified a critical issue that could cause a panic, along with a few other suggestions to improve robustness and code quality. Specifically, there's a potential panic when fetching the last build status if no builds are found. I've also suggested improvements to error handling in the init
function, handling of cases where no build is found in the retry loop, and a recommendation to avoid using a package-level context for API calls.
/gemini review |
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.
Code Review
This PR introduces a retry mechanism for failed Cloud Build builds, which is a great addition for resiliency. The implementation is solid, with good use of the Go SDK and comprehensive tests. I've added a few suggestions to improve code style consistency, error message clarity, and code organization. These are minor changes to further improve the maintainability of the code.
Thanks @daniel-cit! |
This PR adds a retry when a build in cloud build fails with an error that can be tried again.
It uses the same configuration for the retry used for deploying with terraform locally