-
Notifications
You must be signed in to change notification settings - Fork 25
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
Combine create and close GH issues for build failures into one library #380
Conversation
Signed-off-by: Sayali Gaikawad <[email protected]>
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.
vars/UpdateBuildFailureIssues.groovy
Outdated
label: "autocut,v${currentVersion}" | ||
) | ||
sleep(time:3, unit:'SECONDS') | ||
} else if (passedComponents.contains(component.name) && !failedComponents.contains(component.name)) { |
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.
What is the case for else
here?
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.
Nothing. The component will either pass or fail.
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.
So then the logic has issues.
If there is anything in failed, it will always go to the if
block, and ignore else if
block.
Therefore, you can change the else if
block to just else
block?
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! If the component fail by default it will go in if block and if it passes completely, it will go in else if block. I can add an else block just to print something but the component will either pass or fail. There is no other possible outcome.
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.
After the talk with @gaiksaya offline, this can be improve to be two if
blocks to replace if
else if
:
1st if (failedComponents.contains(component.name)) {
will check if the component has a failure. If so, create issue or keep updating comment.
2nd if (passedComponents.contains(component.name) && !failedComponents.contains(component.name)) {
will check if component shows up in passes but clear of failed, close issues.
For any other cases such as pass is empty or in pass but also in fail, ignore.
Thanks.
Signed-off-by: Sayali Gaikawad <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #380 +/- ##
============================================
+ Coverage 86.11% 86.36% +0.25%
Complexity 29 29
============================================
Files 82 86 +4
Lines 216 220 +4
Branches 12 12
============================================
+ Hits 186 190 +4
Misses 22 22
Partials 8 8 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Sayali Gaikawad <[email protected]>
#380) Signed-off-by: Sayali Gaikawad <[email protected]> (cherry picked from commit 1d3b65f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Combine create and close GH issues for build failures into one library.
TL;DR:
The GH issues won't be blindly closed if one of the platform passes the build in case of distribution failures. It will only be closed if all platforms have passed for given component.
Issues Resolved
resolves opensearch-project/opensearch-build#4357
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.