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

Add the feature of showing useful error message during CI #1083

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

RyanL1997
Copy link
Collaborator

@RyanL1997 RyanL1997 commented Aug 24, 2022

Signed-off-by: Ryan Liang [email protected]

Description

Create a separate workflow and implemented environment variable of version to check for the existence of the OpenSearch Security Plugin artifact

Issues Resolved

Testing

CI test case#1 with "403 Forbidden" response
CI test case#2 with "404 Not Found" response
Created a new workflow for "Verify there is matching build of security plugin" by running prerequisites-test

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

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.

@RyanL1997 RyanL1997 force-pushed the Add-error-msg-to-CI branch 3 times, most recently from 045ea0b to 6d689bc Compare August 24, 2022 17:22
@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2022

Codecov Report

Merging #1083 (cac0c5e) into main (7299822) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1083   +/-   ##
=======================================
  Coverage   72.27%   72.27%           
=======================================
  Files          87       87           
  Lines        1915     1915           
  Branches      244      244           
=======================================
  Hits         1384     1384           
  Misses        478      478           
  Partials       53       53           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@RyanL1997 RyanL1997 marked this pull request as ready for review August 24, 2022 17:56
@RyanL1997 RyanL1997 requested a review from a team August 24, 2022 17:56
cliu123
cliu123 previously approved these changes Aug 24, 2022
@@ -16,6 +16,9 @@ jobs:
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.3.0/latest/linux/x64/tar/builds/opensearch/dist/opensearch-min-2.3.0-linux-x64.tar.gz
tar -xzf opensearch-*.tar.gz
rm -f opensearch-*.tar.gz

- name: Check the validation of OpenSearch Security Plugin
run: wget -S --spider https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.3.0/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-security-2.3.0.0.zip || (echo "Please make sure security plugin has been bumped to the same version and added to manifest." && exit 1)
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to create variables in the Github actions files? We use the version in a number of places and it would be nice to define it once.

Copy link
Collaborator Author

@RyanL1997 RyanL1997 Aug 24, 2022

Choose a reason for hiding this comment

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

Hi @cwperks. Thanks for the reply. I think we can only set up the environment variables in the Github actions files. I can definitely try to set it up in the environment variable to see if it works.

@@ -16,6 +16,9 @@ jobs:
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.3.0/latest/linux/x64/tar/builds/opensearch/dist/opensearch-min-2.3.0-linux-x64.tar.gz
tar -xzf opensearch-*.tar.gz
rm -f opensearch-*.tar.gz

- name: Check the validation of OpenSearch Security Plugin
Copy link
Member

Choose a reason for hiding this comment

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

This would fail the integration-test workflow, what would you think about creating a separate workflow called something like prerequisites that could have a task named "Verify there is matching build of security plugin"

Copy link
Collaborator Author

@RyanL1997 RyanL1997 Aug 24, 2022

Choose a reason for hiding this comment

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

Hi @peternied. Thanks for the reply! The reason I set to check it up here because if this one fails, the next test of Download OpenSearch Security Plugin will also be failed and break the integration-test. I was planning to use this test only as the prerequisite for checking the test of Download OpenSearch Security Plugin. Sorry for the confusions anyways. Please correct me if I miss some of the steps.

Copy link
Member

@peternied peternied Aug 24, 2022

Choose a reason for hiding this comment

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

Here is the UI that our users would see on failures with the current design, might be useful to have this spelled out more plainly (Less clicks is better!)
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I get it now! Ya I will create a new work flow with a better name for running this separately! Thanks @peternied!

@RyanL1997 RyanL1997 force-pushed the Add-error-msg-to-CI branch from 5a346cf to cf9334e Compare August 24, 2022 19:18
@RyanL1997 RyanL1997 marked this pull request as draft August 24, 2022 19:22
@RyanL1997 RyanL1997 force-pushed the Add-error-msg-to-CI branch 3 times, most recently from 63d3b75 to 7a7531e Compare August 24, 2022 19:49
@RyanL1997 RyanL1997 marked this pull request as ready for review August 24, 2022 19:58
@RyanL1997
Copy link
Collaborator Author

He guys, I have made the update of this PR:

  1. Instead of directly to implement the test in integration-test, I created a separate workflow called prerequisite-test.
  2. Implemented the environment variable of version numbers in prerequisite-test
    Seems like it is also possible to setup the environment variable of version in the Integration-test. However, we may need another PR for doing that if it is necessary.

@cliu123
Copy link
Member

cliu123 commented Aug 24, 2022

@RyanL1997 Would you please add the new behavior in the PR description?

@RyanL1997 RyanL1997 force-pushed the Add-error-msg-to-CI branch from 7a7531e to ace1a7b Compare August 24, 2022 20:22
@RyanL1997 RyanL1997 force-pushed the Add-error-msg-to-CI branch from ace1a7b to 98cfda1 Compare August 24, 2022 20:29
name: Run prerequisite tests
runs-on: ubuntu-latest
steps:
- name: Check the validation of OpenSearch Security Plugin
Copy link
Member

Choose a reason for hiding this comment

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

The name of this should reflect what the check is performing. How does "Check for the existence of the OpenSearch Security Plugin artifact" sound?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I have updated the commit and also changed the PR description with that. Thx for the review @cwperks!

@RyanL1997 RyanL1997 force-pushed the Add-error-msg-to-CI branch from 98cfda1 to 3c01353 Compare August 24, 2022 20:41
@@ -0,0 +1,14 @@
name: Verify there is matching build of security plugin
Copy link
Member

Choose a reason for hiding this comment

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

This name appears in the checks like this:

Screen Shot 2022-08-24 at 4 44 09 PM

Shorten this to "Prerequisite Checks"?


jobs:
tests:
name: Run prerequisite tests
Copy link
Member

Choose a reason for hiding this comment

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

Similar to above: maybe "Run prerequisite checks"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! I have changed the name for both test's name and the sub tests' name. Please review it.

@RyanL1997 RyanL1997 force-pushed the Add-error-msg-to-CI branch from 3c01353 to cac0c5e Compare August 24, 2022 20:58
cliu123
cliu123 previously approved these changes Aug 24, 2022
@RyanL1997 RyanL1997 force-pushed the Add-error-msg-to-CI branch from cac0c5e to b62d5cd Compare August 24, 2022 21:30
@cliu123 cliu123 merged commit 964e804 into opensearch-project:main Aug 24, 2022
@cliu123 cliu123 added the backport 2.x backport to 2.x branch label Aug 24, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 24, 2022
…sion variable (#1083)

Signed-off-by: Ryan Liang <[email protected]>
(cherry picked from commit 964e804)
cliu123 pushed a commit that referenced this pull request Aug 29, 2022
…sion variable (#1083) (#1085)

Signed-off-by: Ryan Liang <[email protected]>
(cherry picked from commit 964e804)

Co-authored-by: Ryan Liang <[email protected]>
@RyanL1997 RyanL1997 deleted the Add-error-msg-to-CI branch December 6, 2022 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Provide useful errors and next steps when this plugins dependencies are out of alignment
5 participants