Skip to content

Add a deprecation warning for 'ENVIRONMENT' & env fallback#277

Merged
arm4b merged 1 commit intomainfrom
enh/environment-deprecation-warning
Aug 15, 2022
Merged

Add a deprecation warning for 'ENVIRONMENT' & env fallback#277
arm4b merged 1 commit intomainfrom
enh/environment-deprecation-warning

Conversation

@arm4b
Copy link
Copy Markdown
Contributor

@arm4b arm4b commented Aug 11, 2022

In v2.0.0 the ENVIRONMENT was dropped and replaced with BITOPS_ENVIRONMENT.

Per discussion in #269 (comment) instead of erroring, we try to guess if the user is still relying on the old var, try to handle it gracefully by injecting the old value into the new BITOPS_ENVIRONMENT, and give a Deprecation Warning.

@arm4b arm4b added the enhancement ✨ New feature or request label Aug 11, 2022
Comment on lines +54 to +58
# TODO: Drop support for 'ENVIRONMENT' env var
if 'ENVIRONMENT' in os.environ:
logger.warning(
"'ENVIRONMENT' var is deprecated in v2.0.0 and will be removed in the future versions! "
"Use the 'BITOPS_ENVIRONMENT' env var instead!"
Copy link
Copy Markdown
Contributor Author

@arm4b arm4b Aug 11, 2022

Choose a reason for hiding this comment

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

Now that ENVIRONMENT is deprecated in v2.0.0 in favor of new BITOPS_ENVIRONMENT, but we're handling the case gracefully by merging the values.

The question though, in which BitOps version do we want to drop the ENVIRONMENT var completely?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i'd create an issue/discussion so we can discuss (also to add it to the roadmap)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created a note here: #245 (comment) in the "Roadmap" Discussion so it's not lost.

@arm4b arm4b merged commit 62374e9 into main Aug 15, 2022
@arm4b arm4b deleted the enh/environment-deprecation-warning branch August 15, 2022 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants