opensearch-project / dashboards-notifications

The Notifications plugin provides a central location for all of your notifications from OpenSearch plugins. You can use either OpenSearch Dashboards or the REST API to configure notifications. Dashboards offers a more organized way of selecting a channel type and selecting which OpenSearch plugin sources you want to use.
Apache License 2.0
9 stars 36 forks source link

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

Closed derek-ho closed 4 months ago

derek-ho commented 6 months ago

…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: https://github.com/opensearch-project/security-dashboards-plugin/issues/1709 https://github.com/opensearch-project/security-analytics-dashboards-plugin/pull/875 https://github.com/opensearch-project/dashboards-observability/pull/309 https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5952

Issues Resolved

[List any issues this PR will resolve]

Check List

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 commented 6 months ago

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

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

:exclamation: 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 ```diff @@ 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](https://app.codecov.io/gh/opensearch-project/dashboards-notifications/pull/165/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | Coverage Δ | | |---|---|---| | [dashboards-notifications](https://app.codecov.io/gh/opensearch-project/dashboards-notifications/pull/165/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | `86.70% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

derek-ho commented 5 months ago
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 commented 5 months ago

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?

opensearch-trigger-bot[bot] commented 4 months ago

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 commented 4 months ago

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?