-
Notifications
You must be signed in to change notification settings - Fork 72
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
[OSCI][CLEAN] Audit unused dependencies in OUI #1135
[OSCI][CLEAN] Audit unused dependencies in OUI #1135
Conversation
Signed-off-by: Samuel Valdes Gutierrez <[email protected]>
Signed-off-by: Johnathon Bowers <[email protected]>
Signed-off-by: Willie Hung <[email protected]>
…into clean/unused-packages
Signed-off-by: Samuel Valdes Gutierrez <[email protected]>
…into clean/unused-packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to hold off on approving this until we have integration testing with OSD, just to be as safe as possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked out this PR on my local machine. I was able to get the OUI site to run without issue. Also, I ran yarn build
, yarn build-docs
, and yarn test
, and everything ran successfully. The suggested changes look good to me, although I know that, as @BSFishy said, we still need to wait for the integration tests to be functional.
Co-authored-by: Matt Provost <[email protected]> Signed-off-by: Samuel Valdes Gutierrez <[email protected]>
Yeah, sure @BSFishy. Make sense! |
Yeah I agree! |
Signed-off-by: Samuel Valdes Gutierrez <[email protected]>
…into clean/unused-packages
Hi @BSFishy, @joshuarrrr Can we retake this Pull Request? What else is required for the merge? I recently updated it to align with the |
It looks like integration with OSD is failing: https://github.com/opensearch-project/oui/actions/runs/7378461865/job/20073761573?pr=1135#step:9:207 We would want to fix that before merging. |
Yeah, I saw that. But is this failure related to something other than our PR? I understand those checks with integration tests to OSD were an issue on your side, didn't it? |
Signed-off-by: Samuel Valdes Gutierrez <[email protected]>
… upgraded in this PR Signed-off-by: Samuel Valdes Gutierrez <[email protected]>
At last, I found the problem. The typescript dependencies listed below through an error in the OSD integration tests when they are installed as "@types/chroma-js": "^2.4.0",
"@types/react-beautiful-dnd": "^13.1.3",
"@types/react-input-autosize": "^2.2.1",
"@types/react-window": "^1.8.5", This is weird. Should not these dependencies only be used in development? Why are they required on runtime? Maybe there is a problem with the build process during the OSD integration tests. |
Yeah this is super weird to me too. I know OSD has some non-standard bootstrap procedures which may be causing these issues. I think @AMoo-Miki might have some more insights into how OSD bootstrap works and why this may be an issue |
So, as you said, @BSFishy, @AMoo-Miki reply to this inquiry in our internal chats. I added his response below to update everyone. So I think we are good to go now, or not? From Miki: "OSD and plugins don’t ONLY use OUI’s disted artifacts and hence, OSD type-checks OUI during build. If OUI doesn’t have its own deps installed when placed in OSD, the type-check and build will fail. So, either OUI will have to redist those types in its own d-ts, or it has to rely on the defs it finds. They chose to use the defs it finds and to avoid conflicts with any types that OSD might have, they just added these as regular deps" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be possible to move these @types/
dependencies into dev dependencies, but this PR fulfills its goals.
If I'm not mistaken, the issue is that OUI exposes types from these dependencies in its own public API. This means that OSD will need to be able to reference these types as well. So if we're able to trick Typescript into inlining these types in the .d.ts
file, we could presumably get rid of these dependencies. This could be taken up in a followup issue
package.json
Outdated
@@ -212,7 +209,6 @@ | |||
"jest": "^24.1.0", | |||
"jest-cli": "^24.1.0", | |||
"moment": "^2.29.4", | |||
"moment-timezone": "^0.5.41", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moment-timezone
enriches moment
and needs to stay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AMoo-Miki dependency added back!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep the ^
that was there before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this branch has some of the flex related changes from another PR.
package.json
Outdated
@@ -212,7 +209,6 @@ | |||
"jest": "^24.1.0", | |||
"jest-cli": "^24.1.0", | |||
"moment": "^2.29.4", | |||
"moment-timezone": "^0.5.41", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep the ^
that was there before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BigSamu It looks like this PR branch got mixed up with the flex changes from another branch. This PR should just have 3 files, right (package.json, yarn.lock, and CHANGELOG.md)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouuuu, you're right!!! My god. Just fixed! Thanks for the heads up @joshuarrrr
fcc6fa9
to
7c08704
Compare
Signed-off-by: Samuel Valdes Gutierrez <[email protected]>
Signed-off-by: Samuel Valdes Gutierrez <[email protected]>
* removing/reassigning unused/wrong-classified runtime dependencies Signed-off-by: Samuel Valdes Gutierrez <[email protected]> * Remove moment-timezone dependency Signed-off-by: Johnathon Bowers <[email protected]> * Remove dependency: eslint-plugin-jest Signed-off-by: Willie Hung <[email protected]> * updating CHANELOG.md with PR 1135 Signed-off-by: Samuel Valdes Gutierrez <[email protected]> * Update CHANGELOG.md typo Co-authored-by: Matt Provost <[email protected]> Signed-off-by: Samuel Valdes Gutierrez <[email protected]> * updating yarn.lock with last changes coming from main (other updates in oui) Signed-off-by: Samuel Valdes Gutierrez <[email protected]> * udpating yarn.lock file Signed-off-by: Samuel Valdes Gutierrez <[email protected]> * downgrading @types/react-window v1.8.7 to v1.8.5 Signed-off-by: Samuel Valdes Gutierrez <[email protected]> * downgrade version of some typescript dependencies that shouldn't been upgraded in this PR Signed-off-by: Samuel Valdes Gutierrez <[email protected]> * adding dev dependency moment-timezone adn update yarn.lock file Signed-off-by: Samuel Valdes Gutierrez <[email protected]> * moving dev dependencies to running dependencies Signed-off-by: Samuel Valdes Gutierrez <[email protected]> --------- Signed-off-by: Samuel Valdes Gutierrez <[email protected]> Signed-off-by: Johnathon Bowers <[email protected]> Signed-off-by: Willie Hung <[email protected]> Co-authored-by: Johnathon Bowers <[email protected]> Co-authored-by: Willie Hung <[email protected]> Co-authored-by: Matt Provost <[email protected]> Co-authored-by: Josh Romero <[email protected]> (cherry picked from commit 335ca98) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* removing/reassigning unused/wrong-classified runtime dependencies * Remove moment-timezone dependency * Remove dependency: eslint-plugin-jest * updating CHANELOG.md with PR 1135 * Update CHANGELOG.md typo * updating yarn.lock with last changes coming from main (other updates in oui) * udpating yarn.lock file * downgrading @types/react-window v1.8.7 to v1.8.5 * downgrade version of some typescript dependencies that shouldn't been upgraded in this PR * adding dev dependency moment-timezone adn update yarn.lock file * moving dev dependencies to running dependencies --------- (cherry picked from commit 335ca98) Signed-off-by: Samuel Valdes Gutierrez <[email protected]> Signed-off-by: Johnathon Bowers <[email protected]> Signed-off-by: Willie Hung <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Johnathon Bowers <[email protected]> Co-authored-by: Willie Hung <[email protected]> Co-authored-by: Matt Provost <[email protected]> Co-authored-by: Josh Romero <[email protected]> Co-authored-by: Miki <[email protected]>
Description
Research was done to clean dependencies not used in OUI. Review finished with actions detailed below, but further work has to be done after resolving issue #594
Actions Performed
Issues Resolved
Issue #595
Check List
yarn lint
yarn test-unit
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.