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 workflow to verify installation of the plugin zip and dashboards … #165

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

derek-ho
Copy link
Contributor

@derek-ho derek-ho commented Feb 26, 2024

…comes up healthy

I have observed some issues within other plugins of issues being only caught at run time. This is because several things can go wrong during the build process, which may not be caught in a dev setup. This adds a workflow to verify that building and installing into OSD works on every PR.

Related issues:
opensearch-project/security-dashboards-plugin#1709
opensearch-project/security-analytics-dashboards-plugin#875
opensearch-project/dashboards-observability#309
opensearch-project/OpenSearch-Dashboards#5952

Issues Resolved

[List any issues this PR will resolve]

Check List

  • 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.

@derek-ho
Copy link
Contributor Author

derek-ho commented Feb 26, 2024

@SuZhou-Joe @xluo-aws I updated the snapshots since it seems to be out of date. I assume it is because of dependency bump and not anything fundamental. Let me know if you want me to revert that commit. I'll add baackport 2.x since we would want the workflow in 2.x but may fail backport, depending on if the change is in 2.x of core/dependencies.

@@ -129,7 +129,7 @@ jobs:
- name: OpenSearch Dashboards Plugin Bootstrap
run: |
cd ./OpenSearch-Dashboards/plugins/dashboards-notifications
yarn osd bootstrap
yarn osd bootstrap --single-version=loose
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.70%. Comparing base (1fc2abe) to head (4e3fdea).

❗ Current head 4e3fdea differs from pull request most recent head 89e4c0b. Consider uploading reports for the commit 89e4c0b to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #165   +/-   ##
=======================================
  Coverage   86.70%   86.70%           
=======================================
  Files          52       52           
  Lines        1497     1497           
  Branches      373      373           
=======================================
  Hits         1298     1298           
  Misses        196      196           
  Partials        3        3           
Flag Coverage Δ
dashboards-notifications 86.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@SuZhou-Joe SuZhou-Joe left a comment

Choose a reason for hiding this comment

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

LGTM.

…comes up healthy

Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>

on: [push, pull_request]
env:
OPENSEARCH_VERSION: '3.0.0'
Copy link
Member

@SuZhou-Joe SuZhou-Joe Mar 22, 2024

Choose a reason for hiding this comment

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

Seems this env variable is not needed as it will be overwrite in the step of set env

@derek-ho derek-ho requested a review from AWSHurneyt as a code owner April 19, 2024 18:54
@derek-ho
Copy link
Contributor Author

curl: (7) Failed to connect to localhost port 5601 after 0 ms: Connection refused
{"type":"log","@timestamp":"2024-04-19T18:52:41Z","tags":["fatal","root"],"pid":2551,"message":"Error: Cannot find module '../../public/utils/constants'\nRequire stack:\n- /home/runner/work/opensearch-dashboards-functional-test/opensearch-dashboards-functional-test/opensearch-dashboards-3.0.0/plugins/notificationsDashboards/server/routes/configRoutes.js\n- /home/runner/work/opensearch-dashboards-functional-test/opensearch-dashboards-functional-test/opensearch-dashboards-3.0.0/plugins/notificationsDashboards/server/routes/index.js\n- /home/runner/work/opensearch-dashboards-functional-test/opensearch-dashboards-functional-test/opensearch-dashboards-3.0.0/plugins/notificationsDashboards/server/plugin.js\n- /home/runner/work/opensearch-dashboards-functional-test/opensearch-dashboards-functional-test/opensearch-dashboards-3.0.0/plugins/notificationsDashboards/server/index.js\n- /home/runner/work/opensearch-dashboards-functional-test/opensearch-dashboards-functional-test/opensearch-dashboards-3.0.0/src/core/server/
 FATAL  Error: Cannot find module '../../public/utils/constants'
Require stack:
- /home/runner/work/opensearch-dashboards-functional-test/opensearch-dashboards-functional-test/opensearch-dashboards-3.0.0/plugins/notificationsDashboards/server/routes/configRoutes.js

@derek-ho
Copy link
Contributor Author

derek-ho commented Apr 19, 2024

Seeing failures in the functional test repo, related to the notifications dashboard. Here is a PR run after I merge in main to this branch showing this new workflow would have caught this issue: https://github.com/opensearch-project/dashboards-notifications/actions/runs/8758297634/job/24038789620?pr=165. @SuZhou-Joe @Hailong-am @xluo-aws @AWSHurneyt can we get this merged to prevent future issues?

@Hailong-am Hailong-am merged commit 0405502 into opensearch-project:main Apr 24, 2024
6 of 7 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/dashboards-notifications/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/dashboards-notifications/backport-2.x
# Create a new branch
git switch --create backport/backport-165-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 0405502f8f47e48ae7561c560da56b36215dbc09
# Push it to GitHub
git push --set-upstream origin backport/backport-165-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-notifications/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-165-to-2.x.

@BionIT
Copy link

BionIT commented Apr 24, 2024

Thanks @derek-ho ! @riysaxen-amzn looks like the same issue has been captured, and now just need to fix. Having server side depends on the constants defined in public might be the cause, can you try moving to the common folder and see if it would pass this workflow Derek added?

riysaxen-amzn pushed a commit to riysaxen-amzn/dashboards-notifications that referenced this pull request Apr 26, 2024
opensearch-project#165)

* Add workflow to verify installation of the plugin zip and dashboards comes up healthy

Signed-off-by: Derek Ho <dxho@amazon.com>

* Add loose

Signed-off-by: Derek Ho <dxho@amazon.com>

---------

Signed-off-by: Derek Ho <dxho@amazon.com>
(cherry picked from commit 0405502)
@riysaxen-amzn riysaxen-amzn mentioned this pull request Apr 26, 2024
1 task
AWSHurneyt pushed a commit that referenced this pull request Apr 26, 2024
* bumping up the opensearch dashboards versions

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* Add workflow to verify installation of the plugin zip and dashboards … (#165)

* Add workflow to verify installation of the plugin zip and dashboards comes up healthy

Signed-off-by: Derek Ho <dxho@amazon.com>

* Add loose

Signed-off-by: Derek Ho <dxho@amazon.com>

---------

Signed-off-by: Derek Ho <dxho@amazon.com>
(cherry picked from commit 0405502)

---------

Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Co-authored-by: Derek Ho <derek01778@gmail.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.

4 participants