-
Notifications
You must be signed in to change notification settings - Fork 593
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
DESS-1710: modified WaitForBuildToFinish function #4270
DESS-1710: modified WaitForBuildToFinish function #4270
Conversation
Hello @CCFenner, please review the changes. |
pkg/jenkins/build.go
Outdated
@@ -20,9 +20,34 @@ type Build interface { | |||
// WaitForBuildToFinish waits till a build is finished. | |||
func WaitForBuildToFinish(ctx context.Context, build Build, pollInterval time.Duration) { |
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 want to abort build if the server is unavailable in case of network problems. Is it possible to pass error and not change the signature in sapXmakeExecuteBuild? In the next step we want to add some logic to sapXmakeExecuteBuild.
Example:
func WaitForBuildToFinish(ctx context.Context, build Build, pollInterval time.Duration) error {
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.
the effected piper step will need an upgrade to sap/jenkins library for the package changes to get reflected
Kudos, SonarCloud Quality Gate passed! |
/it-go |
* DESS-1710: modified WaitForBuildToFinish function - added exception handling * DESS-1710: fixed parameters in WaitForBuildToFinish * DESS-1710: added error handling in WaitForBuildToFinish * DESS-1710: formatted build.go * DESS-1710: fixed error logging * DESS-1710: fixed Poll retrying * DESS-1710: renamed WaitForBuildToFinish * DESS-1710: refactored WaitForBuildToFinish * DESS-1710: changed maxRetries to 4 attempt * DESS-1710: fixed error handling --------- Co-authored-by: Christopher Fenner <[email protected]> Co-authored-by: Ashly Mathew <[email protected]>
The PR based on https://jira.tools.sap/browse/DESS-1710
There are some issues raised because sapXmakeExecuteBuild tries to download artifacts while the build is still running.
After investigations it seems the problem comes from a wrong connection with the Jenkins which result to a null answer.
The check of the build running seems to return null and this is wrongly considered as build stopped.
Changes
Added exception handling for WaitForBuildToFinish function