You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/06/07 17:47:53 UTC
[GitHub] [superset] reesercollins opened a new pull request, #20295: feat: Environment tag
reesercollins opened a new pull request, #20295:
URL: https://github.com/apache/superset/pull/20295
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
It can often be useful to be able 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

After

### TESTING INSTRUCTIONS
1. Start superset in production mode. The tag should appear and say "Production"
2. Start superset in development mode. The tag should appear and say "Development"
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] rusackas commented on pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
rusackas commented on PR #20295:
URL: https://github.com/apache/superset/pull/20295#issuecomment-1156900188
/testenv up
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] rusackas commented on pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
rusackas commented on PR #20295:
URL: https://github.com/apache/superset/pull/20295#issuecomment-1198426806
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] github-actions[bot] commented on pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #20295:
URL: https://github.com/apache/superset/pull/20295#issuecomment-1192900124
@rusackas Ephemeral environment spinning up at http://54.202.1.99:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] lyndsiWilliams commented on a diff in pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
lyndsiWilliams commented on code in PR #20295:
URL: https://github.com/apache/superset/pull/20295#discussion_r933535462
##########
superset-frontend/src/views/components/RightMenu.tsx:
##########
@@ -279,7 +282,16 @@ const RightMenu = ({
/>
)}
{environmentTag.text && (
- <Label css={{ borderRadius: '500px' }} color={environmentTag.color}>
+ <Label
+ css={{ borderRadius: '500px' }}
Review Comment:
```suggestion
css={{ borderRadius: `${theme.gridUnit * 125}px` }}
```
A quick theming nit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] codecov[bot] commented on pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #20295:
URL: https://github.com/apache/superset/pull/20295#issuecomment-1151100042
# [Codecov](https://codecov.io/gh/apache/superset/pull/20295?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#20295](https://codecov.io/gh/apache/superset/pull/20295?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fa6d7c4) into [master](https://codecov.io/gh/apache/superset/commit/77e326fd95f4322951aecfe226a2c47c40af4d55?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (77e326f) will **decrease** coverage by `12.10%`.
> The diff coverage is `92.30%`.
```diff
@@ Coverage Diff @@
## master #20295 +/- ##
===========================================
- Coverage 66.65% 54.55% -12.11%
===========================================
Files 1729 1729
Lines 64904 64915 +11
Branches 6842 6842
===========================================
- Hits 43262 35414 -7848
- Misses 19893 27752 +7859
Partials 1749 1749
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `?` | |
| mysql | `?` | |
| postgres | `?` | |
| presto | `53.57% <100.00%> (+<0.01%)` | :arrow_up: |
| python | `57.73% <100.00%> (-25.05%)` | :arrow_down: |
| sqlite | `?` | |
| unit | `50.15% <33.33%> (-0.01%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/20295?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset-frontend/src/views/components/Menu.tsx](https://codecov.io/gh/apache/superset/pull/20295/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL2NvbXBvbmVudHMvTWVudS50c3g=) | `50.00% <80.00%> (ø)` | |
| [...perset-frontend/src/views/components/MenuRight.tsx](https://codecov.io/gh/apache/superset/pull/20295/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL2NvbXBvbmVudHMvTWVudVJpZ2h0LnRzeA==) | `59.79% <100.00%> (ø)` | |
| [superset/config.py](https://codecov.io/gh/apache/superset/pull/20295/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `91.11% <100.00%> (-0.31%)` | :arrow_down: |
| [superset/views/base.py](https://codecov.io/gh/apache/superset/pull/20295/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvYmFzZS5weQ==) | `55.33% <100.00%> (-18.68%)` | :arrow_down: |
| [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/20295/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/key\_value/commands/upsert.py](https://codecov.io/gh/apache/superset/pull/20295/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL3Vwc2VydC5weQ==) | `0.00% <0.00%> (-89.59%)` | :arrow_down: |
| [superset/key\_value/commands/update.py](https://codecov.io/gh/apache/superset/pull/20295/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `0.00% <0.00%> (-89.37%)` | :arrow_down: |
| [superset/key\_value/commands/delete.py](https://codecov.io/gh/apache/superset/pull/20295/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2RlbGV0ZS5weQ==) | `0.00% <0.00%> (-85.30%)` | :arrow_down: |
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/20295/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
| [superset/key\_value/commands/delete\_expired.py](https://codecov.io/gh/apache/superset/pull/20295/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2RlbGV0ZV9leHBpcmVkLnB5) | `0.00% <0.00%> (-80.77%)` | :arrow_down: |
| ... and [279 more](https://codecov.io/gh/apache/superset/pull/20295/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/20295?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/20295?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [77e326f...fa6d7c4](https://codecov.io/gh/apache/superset/pull/20295?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] rusackas merged pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
rusackas merged PR #20295:
URL: https://github.com/apache/superset/pull/20295
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] reesercollins commented on pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
reesercollins commented on PR #20295:
URL: https://github.com/apache/superset/pull/20295#issuecomment-1202452468
> 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?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] github-actions[bot] commented on pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #20295:
URL: https://github.com/apache/superset/pull/20295#issuecomment-1156901734
@rusackas Ephemeral environment spinning up at http://52.11.246.58:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] github-actions[bot] commented on pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #20295:
URL: https://github.com/apache/superset/pull/20295#issuecomment-1229002442
Ephemeral environment shutdown and build artifacts deleted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] rusackas commented on pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
rusackas commented on PR #20295:
URL: https://github.com/apache/superset/pull/20295#issuecomment-1192897093
/testenv up
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] rusackas commented on a diff in pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
rusackas commented on code in PR #20295:
URL: https://github.com/apache/superset/pull/20295#discussion_r898431349
##########
superset/config.py:
##########
@@ -1289,6 +1289,20 @@ def SQL_QUERY_MUTATOR( # pylint: disable=invalid-name,unused-argument
"port": internet_port,
}
+# Configuration for environment tag shown on the navbar. Setting 'text' to '' will hide the tag.
+ENVIRONMENT_TAG_CONFIG = {
+ "variable": "FLASK_ENV",
+ "values": {
+ "development": {
+ "color": "#c73d2e",
+ "text": "Development",
+ },
+ "production": {
+ "color": "#039dfc",
+ "text": "Production",
+ },
Review Comment:
I have a hunch that most people won't want the "Production" label showing up. Their production environment should probably just look... normal, whereas staging/dev/etc would warrant labeling to differentiate them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] rusackas commented on a diff in pull request #20295: feat: Environment tag
Posted by GitBox <gi...@apache.org>.
rusackas commented on code in PR #20295:
URL: https://github.com/apache/superset/pull/20295#discussion_r902676141
##########
superset-frontend/src/views/components/MenuRight.tsx:
##########
@@ -35,6 +35,7 @@ import Icons from 'src/components/Icons';
import findPermission, { isUserAdmin } from 'src/dashboard/util/findPermission';
import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes';
import { RootState } from 'src/dashboard/types';
+import { Tag } from 'antd';
Review Comment:
Rather than importing the `Tag` component directly from antd, we should probably `import Label from 'src/components/Label';` since that'll be the highly reused and restyled/supported component in most (hopefully all) Superset instances.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org