DEP-242: Change trigger for environment detection - #2808
Conversation
jareth-whitney
left a comment
There was a problem hiding this comment.
Looks good and should be more reliable than FLASK_ENV, since that doesn't work in dev/test. It could be good to add the same env value for web, so we don't have to parse the URL there to get it. My only note is regarding the FLASK_ENV fallback. I chose production since it's more secure, but maybe that's not necessary.
| (current_app.config.get('ENVIRONMENT') if has_app_context() else '') or | ||
| os.getenv('ENVIRONMENT') or | ||
| os.getenv('DEPLOYMENT_ENV') or | ||
| os.getenv('FLASK_ENV', 'development') |
There was a problem hiding this comment.
Should we default to production for FLASK_ENV since production has higher security?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2808 +/- ##
==========================================
- Coverage 75.32% 75.31% -0.02%
==========================================
Files 526 525 -1
Lines 20147 20135 -12
Branches 1566 1564 -2
==========================================
- Hits 15176 15164 -12
- Misses 4964 4965 +1
+ Partials 7 6 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|



Issue #: 🎟️ DEP-242
Description of changes:
ENVin the API deployment, which is then used by the API to determine the current environment (dev/test/prod).User Guide update ticket (if applicable):
Common component changes: