opensearch-project / security-analytics-dashboards-plugin

Front end (UI) plugin to support security-analytics
Apache License 2.0
8 stars 41 forks source link

Updated dependencies #984

Closed amsiglan closed 3 months ago

amsiglan commented 3 months ago

Description

Updated dependencies to align with other plugin repos

Issues Resolved

847

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.

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 31.61%. Comparing base (5c43a1d) to head (637e25b).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #984 +/- ## ======================================= Coverage 31.61% 31.61% ======================================= Files 159 159 Lines 5304 5304 Branches 993 993 ======================================= Hits 1677 1677 Misses 3436 3436 Partials 191 191 ```

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

amsiglan commented 3 months ago

Fixed the failing test in PR #983

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

The backport to 2.12 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/security-analytics-dashboards-plugin/backport-2.12 2.12
# Navigate to the new working tree
pushd ../.worktrees/security-analytics-dashboards-plugin/backport-2.12
# Create a new branch
git switch --create backport-984-to-2.12
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a94a511f04f7259ef501f7eefb84e8864ff9134d
# Push it to GitHub
git push --set-upstream origin backport-984-to-2.12
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security-analytics-dashboards-plugin/backport-2.12

Then, create a pull request where the base branch is 2.12 and the compare/head branch is backport-984-to-2.12.

AMoo-Miki commented 3 months ago

This change makes husky a dependency as it is used in postinstall. I don't believe the intention of this change was making husky a requirement for building release packages.

nikAizuddin commented 2 months ago

I can't build this commit with yarn build. I got the following error:

husky - .git can't be found (see https://typicode.github.io/husky/#/?id=custom-directory)

So I have to patch package.json with:

diff --git a/package.json b/package.json
index 9d19dd5..53e3dc3 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
     "test:jest:update-snapshots": "yarn run test:jest -u",
     "build": "yarn plugin-helpers build",
     "postbuild": "echo Renaming build artifact to [$npm_package_config_zip_name-$npm_package_version.zip] && mv build/$npm_package_config_id*.zip build/$npm_package_config_zip_name-$npm_package_version.zip",
-    "postinstall": "husky install"
+    "postinstall": "cd ../../../ && husky install"
   },
   "resolutions": {
     "@types/react": "^16.9.8",
nikAizuddin commented 2 months ago

Also I have to bump lint-staged package to ^13.1.0 because I'm having issues with lint-staged ^10.2.0 (if I remember correctly, it says I'm not in a .git directory whenever I use git commit).

I have created a PR that solves my build issue.