-
Notifications
You must be signed in to change notification settings - Fork 316
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
Updating build toolchain and deps of Web App reporter #7952
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7952 +/- ##
============================================
- Coverage 67.69% 66.93% -0.77%
- Complexity 1000 2049 +1049
============================================
Files 247 357 +110
Lines 7904 17081 +9177
Branches 876 2449 +1573
============================================
+ Hits 5351 11434 +6083
- Misses 2173 4625 +2452
- Partials 380 1022 +642
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
7f1585d
to
0635e08
Compare
4f5759e
to
c316a5f
Compare
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.
Looks good to me
Maybe on a second pass you can extend eslint verifications, but for this upgrade no need now.
c316a5f
to
2b1998d
Compare
a2c9736
to
c27b11e
Compare
65cb16f
to
e4e2a72
Compare
@heliocastro Added an eslint config, was already working on it when you wrote your comment but took me a couple of days to get the various rules set up. |
@tsteenbe can we please move forward with this? Or should some one take over? |
@tsteenbe if you still in the middle of the moving process for some time, i can take over these one. |
b823a30
to
a4b8872
Compare
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.
Good to Go, even with recent changes
I've tested it as well by using two evaluation-result.json files and comparing old vs. new report. Besides these, I was not sure about these formatting changes :
Also I've found a bug with the filtering of findings in scan results. This can be reproduced in My suggestion would be to at minimum fix the bug, plus the changed margins. I'm not sure about the graying out of the key. |
Update versions of Node and Yarn used in WebApp's build scripts to the versions used in the official ORT Docker image[1]. [1]: https://github.com/oss-review-toolkit/ort/blob/9707529/.versions Signed-off-by: Thomas Steenbergen <[email protected]>
Replace the create-react-app[1] and the rescripts[2] based build toolchain with vite[3] and vite-plugin-singlefile[4] as: - rescripts project has been archived. - continue using create-react-app is not viable due to upcoming API and packages deprecations. - vite has good community support, it builds faster and its toolchain comes out-of-the-box with almost everything we need. [1]: https://github.com/facebook/create-react-app [2]: https://github.com/harrysolovay/rescripts [3]: https://vitejs.dev/ [4]: https://github.com/richardtallent/vite-plugin-singlefile Signed-off-by: Thomas Steenbergen <[email protected]>
Signed-off-by: Thomas Steenbergen <[email protected]>
Fix up formatting and indentation of JSON ORT result data to 4 spaces so it's aligned with other WebApp code. Signed-off-by: Thomas Steenbergen <[email protected]>
Update all dependencies to latest available versions except Ant Design (antd) whose latest version has breaking API changes. Signed-off-by: Thomas Steenbergen <[email protected]>
Thanks for the effort you've put into testing this! |
301d1e5
to
b00be3c
Compare
@fviernau All your comments have been address. The filtering issue comes from a bug in upstream Ant Design (wrong input data is returned on setting of filters). I have now downgraded the version of Ant Design used to a version without the bug - will fill a bug report upstream. |
Upgrade web app code to use Ant Design (antd) v5 and update ORT WebApp code to migrate off deprecated antd APIs. Signed-off-by: Thomas Steenbergen <[email protected]>
Improve code linting by defining plugins and rules in an eslint configuration file. Signed-off-by: Thomas Steenbergen <[email protected]>
Automatically resolve issues flagged by eslint by running `eslint . --fix`. Signed-off-by: Thomas Steenbergen <[email protected]>
Resolve warning from Vite compiler that `//` should be replaced by `/* */`. Signed-off-by: Thomas Steenbergen <[email protected]>
Fix up check used to determine WebApp report is template used string comparison which in some cases incorrectly evaluated to true. Signed-off-by: Thomas Steenbergen <[email protected]>
Per MDN docs for the viewport meta tag [1] the default for initial-scale is 1 so no needed to include it. [1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag Signed-off-by: Thomas Steenbergen <[email protected]>
b00be3c
to
ba81082
Compare
Could you please link the upstream issue (or create one if none exists yet) so we can upvote / subscribe to it? |
Will do. Did already a quick check of the Ant Design issues (which is easy as many reports are in Mandarin) issue doesn't seem to be reported. Which does not surprise me as I am struggling to reproduce the bug outside of ORT - bug with a small reproducable example usually get fixed fast by Ant Design maintainers. |
I've tested again (similar as above) with latest updated (ba81082). Approving as it seems to work nicely, computes a bit faster and reports are smaller (without understanding every single JS detail). |
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.
Results are same as previous iteraction, so good to go.
As of [1] the web-app reporter build became much faster. The overhead to set up a new job now is bigger than the actual build time in most of the cases / for incremental builds, so include the web-app reporter build into the regular build again to simplify the setup. [1]: #7952 Signed-off-by: Sebastian Schuberth <[email protected]>
As of [1] the web-app reporter build became much faster. The overhead to set up a new job now is bigger than the actual build time in most of the cases / for incremental builds, so include the web-app reporter build into the regular build again to simplify the setup. [1]: #7952 Signed-off-by: Sebastian Schuberth <[email protected]>
This pull request contains a significant changes to how ORT's WebApp (template) is generated and upgrade all dependencies to the latest available versions.
After @mennaElnemr9 created #6598 and #6552 I reviewed the impact of updating dependencies which let me to find issue after issues. Several build toolchain and app dependencies have introduced breaking changes or are not longer maintained. After a lots of research I came to the conclusion major rewrite of the WebApp was needed. Especially use create-react-app (CRA) and rescripts was problematic since rescripts has been archived and updated CRA ORT WebApp builds showed me several deprecated dependencies errors and warnings.
My current plan (subject to change):
Step 1: Change build toolchain and update deps
Step 2: Refactor React component code to use React v18 ways of working e.g. replace component classes with functional components. Possible look into replacing dependency on react-syntax-highlighter
Step 3: Implement new features / bug fixes