tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit aced10ade5446349fa02acfc59c0e6345f66b1c1
parent b82a54f19cf7a8d5164b8adac4fba4ae29d2e060
Author: Julien Cristau <jcristau@mozilla.com>
Date:   Mon,  6 Oct 2025 13:39:16 +0000

Bug 1992386 - set task expiration policy by level. r=taskgraph-reviewers,bhearsum

Differential Revision: https://phabricator.services.mozilla.com/D267403

Diffstat:
Mtaskcluster/config.yml | 6+++---
Mtaskcluster/gecko_taskgraph/config.py | 4+++-
Mtaskcluster/gecko_taskgraph/transforms/job/common.py | 2+-
Mtaskcluster/gecko_taskgraph/transforms/task.py | 15+++++++++++----
4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/taskcluster/config.yml b/taskcluster/config.yml @@ -961,14 +961,14 @@ mac-signing: - "/" # The .app expiration-policy: - by-project: - try: + by-level: + '1': default: 28 days shortest: 7 days short: 14 days medium: 28 days long: 28 days - autoland: + '3': default: 1 year shortest: 14 days short: 3 months diff --git a/taskcluster/gecko_taskgraph/config.py b/taskcluster/gecko_taskgraph/config.py @@ -125,6 +125,8 @@ graph_config_schema = Schema( Length(min=1), ), }, - Required("expiration-policy"): optionally_keyed_by("project", {str: str}), + Required("expiration-policy"): optionally_keyed_by( + "project", "level", {str: str} + ), } ) diff --git a/taskcluster/gecko_taskgraph/transforms/job/common.py b/taskcluster/gecko_taskgraph/transforms/job/common.py @@ -215,6 +215,6 @@ def get_expiration(config, policy="default"): expires = evaluate_keyed_by( config.graph_config["expiration-policy"], "artifact expiration", - {"project": config.params["project"]}, + {"project": config.params["project"], "level": config.params["level"]}, )[policy] return expires diff --git a/taskcluster/gecko_taskgraph/transforms/task.py b/taskcluster/gecko_taskgraph/transforms/task.py @@ -2135,12 +2135,19 @@ def set_task_and_artifact_expiry(config, jobs): now = datetime.datetime.utcnow() # We don't want any configuration leading to anything with an expiry longer # than 28 days on try. - cap = "28 days" if is_try(config.params) else None + cap = ( + "28 days" + if is_try(config.params) and int(config.params["level"]) == 1 + else None + ) cap_from_now = fromNow(cap, now) if cap else None if cap: - for policy, expires in config.graph_config["expiration-policy"]["by-project"][ - "try" - ].items(): + expiration_policy = evaluate_keyed_by( + config.graph_config["expiration-policy"], + "task expiration", + {"project": config.params["project"], "level": config.params["level"]}, + ) + for policy, expires in expiration_policy.items(): if fromNow(expires, now) > cap_from_now: raise Exception( f'expiration-policy "{policy}" is larger than {cap} '