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

Mark build stage as unstable if plugins failed to build #4224

Merged
merged 3 commits into from
Dec 13, 2023

Conversation

gaiksaya
Copy link
Member

Description

The continue-on-error option does not throw an error or an non-zero exit code. Hence it comes difficult for component owners to parse jenkins build log to find the exactly failure. This PR marks the stage as unstable if plugins failed to build.

Issues Resolved

resolves #4018

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.

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
Copy link

codecov bot commented Nov 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (91f0c4a) 93.16% compared to head (e0420d9) 93.16%.
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4224   +/-   ##
=======================================
  Coverage   93.16%   93.16%           
=======================================
  Files         188      189    +1     
  Lines        5912     5973   +61     
=======================================
+ Hits         5508     5565   +57     
- Misses        404      408    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


def markStageUnstableIfPluginsFailedToBuild() {
def stageLogs = getLogsForStage(stageName: "${STAGE_NAME}")
if (stageLogs.any{e -> e.contains('Failed plugins are')}) {
Copy link
Member

Choose a reason for hiding this comment

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

Seems like we are reading through all of the logs from Jenkins stage even if there are no failed plugins right?
I feel this might be really inefficient and delay the building process. Can we maybe modify the --continue-on-error from the build workflow so that it could send signal to whenever it skips one plugin?
It could be having a new variable storing a list of failed plugins or just a boolean saying we continued on error.

Copy link
Member Author

Choose a reason for hiding this comment

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

The only time that string is thrown as an error is when continue on error is enabled. Otherwise it is not. I think it will be too many if/else statements to call this function if continue on error is enabled.
Another work around is to only call this upon success as that when this error string is thrown. Will make that change. Making this PR as draft until dependent PRs are merged.

Copy link
Member Author

Choose a reason for hiding this comment

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

Made the changes! The function is only called when CONTINUE_ON_ERROR = true and only for success stage.
Thanks!

@gaiksaya gaiksaya marked this pull request as draft November 22, 2023 01:57
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
@gaiksaya gaiksaya marked this pull request as ready for review December 13, 2023 04:19
@gaiksaya
Copy link
Member Author

Hi @zelinh,
The related PRs have been merged. Can you please take another look?
Thanks!

Copy link
Member

@zelinh zelinh left a comment

Choose a reason for hiding this comment

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

LGTM!

@gaiksaya gaiksaya merged commit 44e2903 into opensearch-project:main Dec 13, 2023
12 checks passed
@gaiksaya gaiksaya deleted the unstable-pr branch December 13, 2023 18:34
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.

Enable different visualization color for staging if unstable
2 participants