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

Combine create and close GH issues for build failures into one library #380

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

gaiksaya
Copy link
Member

@gaiksaya gaiksaya commented Feb 2, 2024

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.

Copy link
Member

@peterzhuamazon peterzhuamazon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gaiksaya ,

Add some comments. Please review them.

Thanks.

vars/UpdateBuildFailureIssues.groovy Show resolved Hide resolved
vars/UpdateBuildFailureIssues.groovy Show resolved Hide resolved
vars/UpdateBuildFailureIssues.groovy Outdated Show resolved Hide resolved
vars/UpdateBuildFailureIssues.groovy Outdated Show resolved Hide resolved
label: "autocut,v${currentVersion}"
)
sleep(time:3, unit:'SECONDS')
} else if (passedComponents.contains(component.name) && !failedComponents.contains(component.name)) {
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

@peterzhuamazon peterzhuamazon Feb 2, 2024

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.

vars/UpdateBuildFailureIssues.groovy Outdated Show resolved Hide resolved
Signed-off-by: Sayali Gaikawad <[email protected]>
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d7dd07c) 86.11% compared to head (80b617a) 86.36%.
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Signed-off-by: Sayali Gaikawad <[email protected]>
@gaiksaya gaiksaya merged commit 1d3b65f into opensearch-project:main Feb 2, 2024
9 checks passed
@gaiksaya gaiksaya deleted the fix-issue branch February 2, 2024 20:36
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 2, 2024
#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Build Failure issues often open/close within minutes
2 participants