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.
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+
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
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
You need to log in before you can comment on or make changes to this bug.