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

Namespacing Environment Variables #1028

Open
tonyta opened this issue Apr 26, 2018 · 0 comments
Open

Namespacing Environment Variables #1028

tonyta opened this issue Apr 26, 2018 · 0 comments

Comments

@tonyta
Copy link

tonyta commented Apr 26, 2018

I've been auditing the environment variables in our various apps and it took me a bit of time to figure out what was using SLEEP_DELAY.

Some gems and Heroku add-ons/buildpacks prefix their env-vars making it easier to figure out how they are used (e.g. NEW_RELIC_APP_NAME, BUGSNAG_API_KEY, PGBOUNCER_PREPARED_STATEMENTS). This could also preclude collisions with common var names like QUIET and QUEUE that could be used by other libraries.

How would the maintainers feel about prefixing env-vars with DELAYED_JOB_*?

MAX_PRIORITY   👉   DELAYED_JOB_MAX_PRIORITY
MIN_PRIORITY   👉   DELAYED_JOB_MIN_PRIORITY
QUEUE          👉   DELAYED_JOB_QUEUE
QUEUES         👉   DELAYED_JOB_QUEUES
QUIET          👉   DELAYED_JOB_QUIET
READ_AHEAD     👉   DELAYED_JOB_READ_AHEAD
SLEEP_DELAY    👉   DELAYED_JOB_SLEEP_DELAY

Perhaps we can support both versions with a deprecation warning in the next minor version, then require the prefix in the next major version. I'd be happy to contribute, but want to make sure this is something you guys would support first.

💜❤️🧡💛💚💙

tonyta added a commit to tonyta/delayed_job that referenced this issue Aug 22, 2018
Namespace all configuration variables used by Delayed::Job under the
`DELAYED_JOB_`-prefix. This will allow developers to easily figure out
what the env var is used for at a glance and prevent collisions with
other libraries using similarly named variable names.

Allow non-namespaced configuration variables as a fallback, but with a
deprecation warning.

See collectiveidea#1028
tonyta added a commit to tonyta/delayed_job that referenced this issue Aug 24, 2018
Namespace all configuration variables used by Delayed::Job under the
`DELAYED_JOB_`-prefix. This will allow developers to easily figure out
what the env var is used for at a glance and prevent collisions with
other libraries using similarly named variable names.

Allow non-namespaced configuration variables as a fallback, but with a
deprecation warning.

See collectiveidea#1028
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant