summaryrefslogtreecommitdiffstats
path: root/third_party/python/taskcluster_taskgraph/taskgraph/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/python/taskcluster_taskgraph/taskgraph/config.py')
-rw-r--r--third_party/python/taskcluster_taskgraph/taskgraph/config.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/third_party/python/taskcluster_taskgraph/taskgraph/config.py b/third_party/python/taskcluster_taskgraph/taskgraph/config.py
index 7ea7dc7b33..ac384eab86 100644
--- a/third_party/python/taskcluster_taskgraph/taskgraph/config.py
+++ b/third_party/python/taskcluster_taskgraph/taskgraph/config.py
@@ -40,6 +40,11 @@ graph_config_schema = Schema(
description="Default 'deadline' for tasks, in relative date format. "
"Eg: '1 week'",
): optionally_keyed_by("project", str),
+ Optional(
+ "task-expires-after",
+ description="Default 'expires-after' for level 1 tasks, in relative date format. "
+ "Eg: '90 days'",
+ ): str,
Required("workers"): {
Required("aliases"): {
str: {
@@ -62,6 +67,10 @@ graph_config_schema = Schema(
"Defaults to `trust-domain`.",
): str,
Optional(
+ "cache-pull-requests",
+ description="Should tasks from pull requests populate the cache",
+ ): bool,
+ Optional(
"index-path-regexes",
description="Regular expressions matching index paths to be summarized.",
): [str],
@@ -102,28 +111,27 @@ class GraphConfig:
Add the project's taskgraph directory to the python path, and register
any extensions present.
"""
- modify_path = os.path.dirname(self.root_dir)
if GraphConfig._PATH_MODIFIED:
- if GraphConfig._PATH_MODIFIED == modify_path:
+ if GraphConfig._PATH_MODIFIED == self.root_dir:
# Already modified path with the same root_dir.
# We currently need to do this to enable actions to call
# taskgraph_decision, e.g. relpro.
return
raise Exception("Can't register multiple directories on python path.")
- GraphConfig._PATH_MODIFIED = modify_path
- sys.path.insert(0, modify_path)
+ GraphConfig._PATH_MODIFIED = self.root_dir
+ sys.path.insert(0, self.root_dir)
register_path = self["taskgraph"].get("register")
if register_path:
find_object(register_path)(self)
@property
def vcs_root(self):
- if path.split(self.root_dir)[-2:] != ["taskcluster", "ci"]:
+ if path.split(self.root_dir)[-1:] != ["taskcluster"]:
raise Exception(
"Not guessing path to vcs root. "
"Graph config in non-standard location."
)
- return os.path.dirname(os.path.dirname(self.root_dir))
+ return os.path.dirname(self.root_dir)
@property
def taskcluster_yml(self):