Allow setting the data retention time via an env variable

RESOLVED FIXED

Status

P3
normal
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

Details

Attachments

(1 attachment)

Apart from rare local development use-cases, we want to stop using local.py to store configuration, since it goes against the 12-factor methodology.

One of the last reasons for needing to have a local.py on stage/prod is that for stage, we specify:

DATA_CYCLE_INTERVAL = timedelta(days=45)

In order to set this via an environment variable we should have the config value be an int, not a timedelta(). To make for an easier transition, we should probably use another variable name - then we can just get it added to the environment on stage ahead of time.
Blocks: 1197186
Depends on: 1212461
Summary: Switch DATA_CYCLE_INTERVAL to an int, not a timedelta → Rename DATA_CYCLE_INTERVAL to DATA_CYCLE_DAYS and make it an int, not a timedelta
Created attachment 8670915 [details] [review]
Rename DATA_CYCLE_INTERVAL and make it an int

With bug 1212461 and then this, we'll be able to stop using local.py on stage/prod, which will mean bug 1197186 is simpler, since we don't have to worry about supporting the old local.py location whilst waiting for puppet to be updated :-)
Attachment #8670915 - Flags: review?(mdoglio)
Attachment #8670915 - Flags: review?(mdoglio) → review+

Comment 2

3 years ago
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/a170d6c04772fdd2f5787c391159bc9d53bf4f3c
Bug 1212447 - Allow setting the data retention time via an env variable

By storing the duration as an int rather than a timedelta, we can set it
via the environment, rather than having to rely on local.py.

The variable has also been renamed to ease the transition and also make
its purpose clearer. Prod/Heroku use the default duration, and stage has
already had DATA_CYCLE_DAYS set to 45 in its environment, for parity
with the old stage local.py DATA_CYCLE_INTERVAL setting.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Blocks: 1176484
Summary: Rename DATA_CYCLE_INTERVAL to DATA_CYCLE_DAYS and make it an int, not a timedelta → Allow setting the data retention time via an env variable
No longer blocks: 1176484, 1197186
You need to log in before you can comment on or make changes to this bug.