Skip to content
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

Merged

Conversation

SiarheiKrystseu
Copy link
Contributor

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

  • Tests
  • Documentation

@cla-assistant
Copy link

cla-assistant bot commented Mar 13, 2023

CLA assistant check
All committers have signed the CLA.

@SiarheiKrystseu
Copy link
Contributor Author

Hello @CCFenner, please review the changes.

@@ -20,9 +20,34 @@ type Build interface {
// WaitForBuildToFinish waits till a build is finished.
func WaitForBuildToFinish(ctx context.Context, build Build, pollInterval time.Duration) {
Copy link
Contributor Author

@SiarheiKrystseu SiarheiKrystseu Apr 17, 2023

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 {

Copy link
Member

@anilkeshav27 anilkeshav27 left a 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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ashlymat
Copy link
Member

ashlymat commented May 2, 2023

/it-go

@ashlymat ashlymat merged commit fbb27b2 into SAP:master May 2, 2023
maxatsap pushed a commit to maxatsap/jenkins-library that referenced this pull request Jul 23, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants