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: deprecate FLASK_ENV and improve conf.ENVIRONMENT_TAG_CONFIG #24404

Merged
merged 10 commits into from
Jun 29, 2023

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Jun 14, 2023

Flask is deprecating FLASK_ENV, leading to this msg in the interpreter:

'FLASK_ENV' is deprecated and will not be used in Flask 2.3. Use 'FLASK_DEBUG' instead.

SUMMARY

Moving away from using FLASK_ENV and creating a SUPERSET_ENV instead. Cleaning up the code around the configuration ENVIRONMENT_TAG_CONFIG too that relied on that.

Adding a note on UPDATING.md at it may affect some environments, mostly should just affect whether and how that warning tag in the navbar shows up.

TESTED

  • export SUPERSET_ENV=development leads to Development tag showing in navbar
  • export SUPERSET_ENV=production leads to no tag showing in navbar
  • unset SUPERSET_ENV leads to flask-debug tag in navbar
  • export SUPERSET_ENV=giberrish leads to flask-debug tag in navbar
  • tested custom "amazing" config
ENVIRONMENT_TAG_CONFIG = {
    "variable": "SUPERSET_ENV",
    "values": {
        "debug": {
            "color": "error.base",
            "text": "flask-debug",
        },
        "amazing": {
            "color": "warning.base",
            "text": "AMAZING",
        },
    },
}
Screen Shot 2023-06-14 at 4 09 29 PM

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen Shot 2023-06-14 at 1 47 46 PM

@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Merging #24404 (8824f3c) into master (884a8b5) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 8824f3c differs from pull request most recent head 0844faf. Consider uploading reports for the commit 0844faf to get more accurate results

@@           Coverage Diff           @@
##           master   #24404   +/-   ##
=======================================
  Coverage   68.93%   68.93%           
=======================================
  Files        1904     1904           
  Lines       73880    73886    +6     
  Branches     8119     8119           
=======================================
+ Hits        50929    50935    +6     
  Misses      20840    20840           
  Partials     2111     2111           
Flag Coverage Δ
hive 53.95% <100.00%> (+<0.01%) ⬆️
javascript 55.65% <ø> (ø)
mysql 79.25% <100.00%> (+<0.01%) ⬆️
postgres 79.34% <100.00%> (+<0.01%) ⬆️
presto 53.87% <100.00%> (+<0.01%) ⬆️
python 83.33% <100.00%> (+<0.01%) ⬆️
sqlite 77.84% <100.00%> (+<0.01%) ⬆️
unit 54.64% <18.18%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset/config.py 91.97% <100.00%> (ø)
superset/views/base.py 73.33% <100.00%> (+0.54%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

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

Nice!

superset/views/base.py Outdated Show resolved Hide resolved
superset/views/base.py Outdated Show resolved Hide resolved
@rusackas
Copy link
Member

Two questions on this one:

  1. Do we need to pull the thread on the sweater and tackle all this other stuff? Particularly the contributing docs:
image
  1. Does this create issues and edge cases around scripts and automation that might be considered a breaking change by some?

@rusackas rusackas merged commit 6a8f60f into apache:master Jun 29, 2023
@mistercrunch mistercrunch added the 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels label Mar 8, 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 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants