superset icon indicating copy to clipboard operation
superset copied to clipboard

feat: Environment tag

Open reesercollins opened this issue 2 years ago • 7 comments

SUMMARY

It can often be useful to see at a glance what environment you're currently in. This configurable tag can be set to appear based on any environment variable you set. By default, it shows a tag for development or production based on FLASK_ENV.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before image After image

TESTING INSTRUCTIONS

  1. Start superset in production mode. The tag should not appear
  2. Start superset in development mode. The tag should appear and say "Development"

ADDITIONAL INFORMATION

  • [ ] Has associated issue:
  • [ ] Required feature flags:
  • [x] 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

reesercollins avatar Jun 07 '22 17:06 reesercollins

Codecov Report

Merging #20295 (394da2d) into master (96a63bc) will increase coverage by 0.00%. The diff coverage is 81.81%.

:exclamation: Current head 394da2d differs from pull request most recent head 0742f1e. Consider uploading reports for the commit 0742f1e to get more accurate results

@@           Coverage Diff           @@
##           master   #20295   +/-   ##
=======================================
  Coverage   66.38%   66.38%           
=======================================
  Files        1766     1766           
  Lines       67225    67236   +11     
  Branches     7136     7138    +2     
=======================================
+ Hits        44626    44635    +9     
- Misses      20774    20775    +1     
- Partials     1825     1826    +1     
Flag Coverage Δ
javascript 52.11% <60.00%> (+<0.01%) :arrow_up:

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

Impacted Files Coverage Δ
superset-frontend/src/views/components/Menu.tsx 50.00% <ø> (ø)
...perset-frontend/src/views/components/RightMenu.tsx 63.33% <60.00%> (-0.15%) :arrow_down:
superset/config.py 91.50% <100.00%> (+0.02%) :arrow_up:
superset/views/base.py 75.80% <100.00%> (+0.43%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Jun 09 '22 13:06 codecov[bot]

/testenv up

rusackas avatar Jun 15 '22 20:06 rusackas

@rusackas Ephemeral environment spinning up at http://52.11.246.58:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Jun 15 '22 20:06 github-actions[bot]

/testenv up

rusackas avatar Jul 22 '22 20:07 rusackas

@rusackas Ephemeral environment spinning up at http://54.202.1.99:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Jul 22 '22 20:07 github-actions[bot]

One last nitpick here - there are some hard-coded colors, and it would be great to pull these from the SupersetTheme object, so that we can override them later with Theme overrides. Ping me on Slack if you wanna talk through the idea or how to approach it.

rusackas avatar Jul 28 '22 17:07 rusackas

Hey, this looks great! Just a quick nit, also would you mind writing a test for this tag?

There is already a quick test to make sure the tag appears in the DOM. Is that sufficient or would you like some more tests?

reesercollins avatar Aug 02 '22 12:08 reesercollins

Ephemeral environment shutdown and build artifacts deleted.

github-actions[bot] avatar Aug 26 '22 22:08 github-actions[bot]