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

feat(storybook): Co-habitating/Upgrading Storybooks to v7 (dependency madness ensues) #26907

Merged
merged 88 commits into from
Feb 15, 2024

Conversation

rusackas
Copy link
Member

@rusackas rusackas commented Jan 31, 2024

SUMMARY

This PR does the following:

  • Temporarily removes the deny-list for license types. For some reason it's blocking a goofily-licensed submodule, which is perfectly license compatible (MIT). I'll flip this back on once I'm done with this effort. Resolved.
  • Upgrades BOTH the Superset Storybook and superset-ui-demo to Storybook 7
  • Migrates all the Stories to use Controls instead of Knobs
  • Includes all the Stories from superset-ui-demo in the main Superset storybook (you can still run superset-ui-demo on its own as well, though)
  • Migrates mdx stories (overviews) to tsx - these might need touchups
  • Fixes a bunch of little random bugs along the way
  • Removes a bunch of package vulnerabilities (1 critical, 17 high, 11 moderate)
  • Bumps ESLint and Prettier by necessity, and for the sake of making this PR mergable, disables the new offences - we'll get those in follow-up PRs, I promise.
  • Touches many other moving parts - it's all a house of cards... but things seem to be running stably.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

Run the root storybook and look at all the bells and whistles!

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@rusackas rusackas marked this pull request as draft January 31, 2024 00:06
@rusackas rusackas changed the title chore(storybook): Upgrading to storybook 7 feat(storybook): Co-habitating/Upgrading Storybooks to 7 Feb 2, 2024
@github-actions github-actions bot added plugins github_actions Pull requests that update GitHub Actions code packages labels Feb 8, 2024
@rusackas rusackas marked this pull request as ready for review February 14, 2024 19:38
Copy link

codecov bot commented Feb 14, 2024

Codecov Report

Attention: 24 lines in your changes are missing coverage. Please review.

Comparison is base (af577d6) 67.16% compared to head (1019a4d) 67.16%.
Report is 2 commits behind head on master.

Files Patch % Lines
...end/src/visualizations/TimeTable/transformProps.ts 0.00% 4 Missing ⚠️
...ugin-chart-echarts/src/Waterfall/transformProps.ts 0.00% 3 Missing ⚠️
...-frontend/src/components/UiConfigContext/index.tsx 25.00% 3 Missing ⚠️
...rols/MetricControl/AdhocMetricEditPopoverTitle.tsx 86.95% 0 Missing and 3 partials ⚠️
...hart-pivot-table/src/react-pivottable/utilities.js 0.00% 2 Missing ⚠️
.../cell-renderers/ActionCell/ActionCell.overview.tsx 0.00% 2 Missing ⚠️
...res/alerts/components/AlertReportCronScheduler.tsx 87.50% 1 Missing and 1 partial ⚠️
...perset-ui-chart-controls/src/components/Select.tsx 0.00% 1 Missing ⚠️
...gin-chart-echarts/src/Timeseries/transformProps.ts 0.00% 0 Missing and 1 partial ⚠️
...d/components/DashboardBuilder/DashboardBuilder.tsx 66.66% 0 Missing and 1 partial ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26907      +/-   ##
==========================================
- Coverage   67.16%   67.16%   -0.01%     
==========================================
  Files        1900     1901       +1     
  Lines       74447    74452       +5     
  Branches     8297     8301       +4     
==========================================
  Hits        50005    50005              
- Misses      22387    22392       +5     
  Partials     2055     2055              
Flag Coverage Δ
javascript 56.84% <78.94%> (-0.01%) ⬇️

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.

@github-actions github-actions bot removed the github_actions Pull requests that update GitHub Actions code label Feb 14, 2024
@github-actions github-actions bot added the github_actions Pull requests that update GitHub Actions code label Feb 14, 2024
Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

Wow! 🎉

@rusackas rusackas changed the title feat(storybook): Co-habitating/Upgrading Storybooks to 7 feat(storybook): Co-habitating/Upgrading Storybooks to v7, and dependency madness Feb 14, 2024
@rusackas rusackas changed the title feat(storybook): Co-habitating/Upgrading Storybooks to v7, and dependency madness feat(storybook): Co-habitating/Upgrading Storybooks to v7 (dependency madness ensues) Feb 14, 2024
@mistercrunch
Copy link
Member

MERGE QUICK #yolo
giphy (1)

@rusackas
Copy link
Member Author

Just need a final code-owner check from @michael-s-molina @kgabryje or @geido (because I touched Select, MetadataBar, DropdownContainer) and we'll be good to smash this thing in!

Copy link
Member

@geido geido left a comment

Choose a reason for hiding this comment

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

Thanks for all the great work that went into this! Let's keep an eye on Netlify to make sure everything goes smooth when we merge this up.

@@ -161,6 +162,28 @@ module.exports = {
'react/static-property-placement': 0, // re-enable up for discussion
'prettier/prettier': 'error',
'file-progress/activate': 1,
// delete me later: temporary rules to help with migration
Copy link
Member

Choose a reason for hiding this comment

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

* under the License.
*/

// import { Meta, Source, Story, ArgsTable } from '@storybook/addon-docs';
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// import { Meta, Source, Story, ArgsTable } from '@storybook/addon-docs';

Comment on lines +22 to +23
// import { ActionMenuItem } from 'src/components/Table/cell-renderers/index';
// import ActionCell from './index';
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// import { ActionMenuItem } from 'src/components/Table/cell-renderers/index';
// import ActionCell from './index';

Comment on lines +447 to +460
// {
// test: /\.mdx?$/,
// use: [
// {
// loader: require.resolve('@storybook/mdx2-csf/loader'),
// options: {
// skipCsf: false,
// mdxCompileOptions: {
// remarkPlugins: [remarkGfm],
// },
// },
// },
// ],
// },
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// {
// test: /\.mdx?$/,
// use: [
// {
// loader: require.resolve('@storybook/mdx2-csf/loader'),
// options: {
// skipCsf: false,
// mdxCompileOptions: {
// remarkPlugins: [remarkGfm],
// },
// },
// },
// ],
// },

@@ -310,6 +351,24 @@ module.exports = {
'react/static-property-placement': 0, // disabled temporarily
'react-prefer-function-component/react-prefer-function-component': 1,
'prettier/prettier': 'error',
// disabling some things that come with the eslint 7->8 upgrade. Will address these in a separate PR
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

Nothing to add on top of Diego’s comments, amazing work!!

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

Thank you for all the hard work @rusackas!

While testing the PR, I found the following problems:

Some components are not rendering anymore:

Screenshot 2024-02-15 at 08 52 26 Screenshot 2024-02-15 at 08 57 48
Some components are rendering but their content is not: Screenshot 2024-02-15 at 08 55 05
Some controls that used to work are not rendering. In this example, sizes and styles were a select: Screenshot 2024-02-15 at 08 56 31
Some plugins are overflowing the render area: Screenshot 2024-02-15 at 08 58 45 Screenshot 2024-02-15 at 08 59 06

This list is not exhaustive, as I only tested a sample of the stories. I can confirm that these problems don't happen on master. Given the size of the PR and the possibility of conflicts, I'm ok with merging it as is and tackling the problems in a follow-up given that the Storybook is an isolated area.

Amazing work 👏🏼

@@ -161,6 +162,28 @@ module.exports = {
'react/static-property-placement': 0, // re-enable up for discussion
'prettier/prettier': 'error',
'file-progress/activate': 1,
// delete me later: temporary rules to help with migration
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a TODO: prefix to make it discoverable by IDEs?

Suggested change
// delete me later: temporary rules to help with migration
// TODO: Delete me later. Temporary rules to help with migration.

@@ -203,6 +226,22 @@ module.exports = {
],
'no-only-tests/no-only-tests': 'error',
'max-classes-per-file': 0,
// temporary rules to help with migration - please re-enable!
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// temporary rules to help with migration - please re-enable!
// TODO: Temporary rules to help with migration - please re-enable!

@@ -310,6 +351,24 @@ module.exports = {
'react/static-property-placement': 0, // disabled temporarily
'react-prefer-function-component/react-prefer-function-component': 1,
'prettier/prettier': 'error',
// disabling some things that come with the eslint 7->8 upgrade. Will address these in a separate PR
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// disabling some things that come with the eslint 7->8 upgrade. Will address these in a separate PR
// TODO: Disabling some things that come with the eslint 7->8 upgrade. Will address these in a separate PR.

@rusackas rusackas merged commit 753ef69 into master Feb 15, 2024
39 checks passed
@rusackas
Copy link
Member Author

Follow-up PRs to address all of the above coming soon! I was spot checking stories as I ported them to the new format, but knew that some would get screwed up along the way. Let the polishing phase begin!

@rusackas rusackas deleted the upgrade-to-storybook-7 branch February 15, 2024 15:57
@geido
Copy link
Member

geido commented Feb 16, 2024

Thank you for all the hard work @rusackas!

While testing the PR, I found the following problems:

Some components are not rendering anymore:

Screenshot 2024-02-15 at 08 52 26 Screenshot 2024-02-15 at 08 57 48
Some components are rendering but their content is not: Screenshot 2024-02-15 at 08 55 05
Some controls that used to work are not rendering. In this example, sizes and styles were a select: Screenshot 2024-02-15 at 08 56 31
Some plugins are overflowing the render area: Screenshot 2024-02-15 at 08 58 45 Screenshot 2024-02-15 at 08 59 06
This list is not exhaustive, as I only tested a sample of the stories. I can confirm that these problems don't happen on master. Given the size of the PR and the possibility of conflicts, I'm ok with merging it as is and tackling the problems in a follow-up given that the Storybook is an isolated area.

Amazing work 👏🏼

Tracking this here https://github.com/orgs/apache/projects/315/views/1?pane=issue&itemId=53539080

grvoicu added a commit to grvoicu/superset that referenced this pull request Feb 20, 2024
…-to-the-embedded-dashboard

* master: (1182 commits)
  fix(ci): mypy pre-commit issues (apache#27161)
  feat(Alerts and Reports): Modal redesign (apache#26202)
  refactor: Migrate ErrorBoundary to typescript (apache#27143)
  chore(tests): Remove unnecessary explicit Flask-SQLAlchemy session expunges (apache#27136)
  fix(plugins): Apply dashboard filters to comparison query in BigNumber with Time Comparison chart (apache#27138)
  fix: Duplicated toast messages (apache#27135)
  docs: add Geotab to users list (apache#27134)
  fix: Plain error message when visiting a dashboard via permalink without permissions (apache#27132)
  fix: ID param for DELETE ssh_tunnel endpoint (apache#27130)
  chore(hail mary): Update package-lock.json via npm-audit-fix (apache#26693)
  chore: lower cryptography min version to 41.0.2 (apache#27129)
  docs(miscellaneous): Export Datasoruces: export datasources exports to ZIP (apache#27120)
  fix(pivot-table-v2): Added forgotten translation pivot table v2 (apache#22840)
  fix: RLS modal overflow (apache#27128)
  refactor: Updates some database columns to MediumText (apache#27119)
  fix: gevent upgrade to 23.9.1 (apache#27112)
  fix: removes old deprecated sqllab endpoints (apache#27117)
  feat(storybook): Co-habitating/Upgrading Storybooks to v7 (dependency madness ensues) (apache#26907)
  fix: bump grpcio, urllib3 and paramiko (apache#27124)
  chore(internet_port): added new ports and removed unnecessary string class (apache#27078)
  ...
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.0.0 labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels dependencies:npm github_actions Pull requests that update GitHub Actions code packages plugins size/XXL 🚢 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants