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

chore: Cleaning up ENABLE_REACT_CRUD_VIEWS config #11496

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Oct 29, 2020

SUMMARY

Now that ENABLE_REACT_CRUD_VIEWS is behind a feature flag (#11371) there seems to be merit in deprecating the config parameter with the same name (DRY) and using the feature flag framework to check the status, otherwise you'll likely need to override this in two places.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

CI.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Member

@nytai nytai left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the cleanup!

Comment on lines -852 to -854
# Enables the replacement react views for all the FAB views (list, edit, show) with
# designs introduced in SIP-34: https://github.com/apache/incubator-superset/issues/8976
# This is a work in progress so not all features available in FAB have been implemented
Copy link
Member

Choose a reason for hiding this comment

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

Should we move these comments to the feature flag lines?

@john-bodley john-bodley force-pushed the john-bodley--cleanup-enable-react-crud-views-feature-flag branch 2 times, most recently from 30c3edb to 39e076d Compare October 29, 2020 20:56
@codecov-io
Copy link

codecov-io commented Oct 29, 2020

Codecov Report

Merging #11496 into master will decrease coverage by 10.20%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #11496       +/-   ##
===========================================
- Coverage   66.64%   56.43%   -10.21%     
===========================================
  Files         863      407      -456     
  Lines       41230    13741    -27489     
  Branches     3719     3502      -217     
===========================================
- Hits        27477     7755    -19722     
+ Misses      13653     5819     -7834     
- Partials      100      167       +67     
Flag Coverage Δ
#cypress 56.43% <ø> (-0.04%) ⬇️
#javascript ?
#python ?

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

Impacted Files Coverage Δ
...uperset-frontend/src/dashboard/util/dnd-reorder.js 0.00% <0.00%> (-100.00%) ⬇️
...rset-frontend/src/dashboard/util/getEmptyLayout.js 0.00% <0.00%> (-100.00%) ⬇️
...et-frontend/src/components/Menu/LanguagePicker.tsx 0.00% <0.00%> (-100.00%) ⬇️
...dashboard/components/resizable/ResizableHandle.jsx 0.00% <0.00%> (-100.00%) ⬇️
.../src/dashboard/util/getFilterScopeFromNodesTree.js 0.00% <0.00%> (-93.48%) ⬇️
...uperset-frontend/src/utils/getClientErrorObject.ts 0.00% <0.00%> (-89.19%) ⬇️
...ntend/src/views/CRUD/annotation/AnnotationList.tsx 3.57% <0.00%> (-88.74%) ⬇️
...c/explore/components/controls/withVerification.jsx 9.09% <0.00%> (-87.88%) ⬇️
...src/dashboard/components/gridComponents/Header.jsx 10.52% <0.00%> (-86.85%) ⬇️
...rset-frontend/src/profile/components/Favorites.tsx 0.00% <0.00%> (-86.67%) ⬇️
... and 677 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 f918ca1...39e076d. Read the comment docs.

@ktmud
Copy link
Member

ktmud commented Oct 29, 2020

The CI is breaking probably because of this: https://github.com/apache/incubator-superset/blob/39e076d0566b12c115c6098fe5adaadec9cb7176/tests/superset_test_config.py#L76

I think we should clean this up and update is_feature_enabled to support env variables in a unified way:

    def is_feature_enabled(self, feature: str) -> bool:
        """Utility function for checking whether a feature is turned on"""
        env_key = f"SUPERSET_{feature}"
        if env_key in os.env:
            return True

        feature_flags = self.get_feature_flags()
        if feature_flags and feature in feature_flags:
            return feature_flags[feature]

        return False

@john-bodley john-bodley force-pushed the john-bodley--cleanup-enable-react-crud-views-feature-flag branch from 39e076d to 8c476b3 Compare October 29, 2020 22:44
@@ -55,6 +55,7 @@
"KV_STORE": True,
"SHARE_QUERIES_VIA_KV_STORE": True,
"ENABLE_TEMPLATE_PROCESSING": True,
"ENABLE_REACT_CRUD_VIEWS": os.environ.get("ENABLE_REACT_CRUD_VIEWS", False),
Copy link
Member Author

Choose a reason for hiding this comment

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

@ktmud this should hopefully resolve the issue.

Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

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

Still think it is worth having a generalized way to override feature flags via env variables. But I guess this works, too.

Copy link
Member

@hughhhh hughhhh left a comment

Choose a reason for hiding this comment

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

nice! 🚢

@john-bodley john-bodley merged commit a8eb3fe into apache:master Oct 29, 2020
@john-bodley john-bodley deleted the john-bodley--cleanup-enable-react-crud-views-feature-flag branch October 29, 2020 23:47
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
Co-authored-by: John Bodley <john.bodley@airbnb.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.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.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants