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

fix: use FeatureFlags in @superset-ui/core #13679

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

ktmud
Copy link
Member

@ktmud ktmud commented Mar 17, 2021

SUMMARY

Feature flag typing has been added to @superset-ui/core, since there is now two copies of the same typing, sometimes it leads to TS errors when npm link is used or when in Jest.

This change means all future feature flags used in the front-end have to be added to @superset-ui and go through the npm publish process. This is inconvenient but probably necessary to ensure correctness and consistency. Considering we are merging superset-ui to this repo soon, this should not be that much of a problem.

cc @graceguo-supercat @villebro

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TEST PLAN

  1. npm link ../superset-ui/packages/superset-ui-core
  2. npm run type
  3. You will see this error in master:
node_modules/@superset-ui/core/src/utils/featureFlags.ts:53:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'featureFlags' must be of type 'FeatureFlagMap', but here has type 'FeatureFlagMap'.

53     featureFlags: FeatureFlagMap;
       ~~~~~~~~~~~~

  src/featureFlags.ts:54:5
    54     featureFlags: FeatureFlagMap;
           ~~~~~~~~~~~~
    'featureFlags' was also declared here.


Found 1 error.

This PR should fix it.

ADDITIONAL INFORMATION

@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #13679 (3391eba) into master (abf2c87) will decrease coverage by 4.01%.
The diff coverage is 50.00%.

❗ Current head 3391eba differs from pull request most recent head 0bf5706. Consider uploading reports for the commit 0bf5706 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13679      +/-   ##
==========================================
- Coverage   77.10%   73.08%   -4.02%     
==========================================
  Files         921      611     -310     
  Lines       46745    21695   -25050     
  Branches     5733     5732       -1     
==========================================
- Hits        36043    15856   -20187     
+ Misses      10567     5704    -4863     
  Partials      135      135              
Flag Coverage Δ
cypress 56.54% <ø> (-0.07%) ⬇️
javascript 63.11% <50.00%> (-0.04%) ⬇️
mysql ?
python ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/setup/setupApp.ts 25.00% <0.00%> (ø)
superset-frontend/src/featureFlags.ts 100.00% <100.00%> (ø)
superset-frontend/src/filters/utils.ts 88.88% <0.00%> (-11.12%) ⬇️
superset/views/dashboard/views.py
superset/viz.py
superset/db_engine_specs/oracle.py
superset/databases/schemas.py
superset/utils/urls.py
superset/reports/notifications/__init__.py
... and 304 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abf2c87...0bf5706. Read the comment docs.

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

this is a bit inconvenient, but necessary because we moved featureflags into superset-ui and we don't want to change in two places everytime. stamping with one comment

Comment on lines +28 to +34
// eslint-disable-next-line @typescript-eslint/no-unused-vars
declare global {
interface Window {
$: any;
jQuery: any;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

is this related to the feature flag change? i didn't see how

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not, but these globals used to be declared in the featureFlags.ts file. I moved them closer to where they are actually used.

@ktmud ktmud merged commit 69a5ed9 into apache:master Mar 18, 2021
@ktmud ktmud deleted the frontend-feature-flags branch March 18, 2021 16:13
allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 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 size/M 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants