Skip to content

Commit ac26282

Browse files
authored
Add debug logging for decision tasks (#498)
* feat: add --verbose option to `taskgraph decision` * feat(optimize): add more info to task replacement debug logging
1 parent 2d0d41e commit ac26282

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

.taskcluster.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ tasks:
264264
ln -s /builds/worker/artifacts artifacts &&
265265
pip3 install --user --break-system-packages . &&
266266
taskgraph decision
267+
--verbose
267268
--pushlog-id='0'
268269
--pushdate='0'
269270
--project='${project}'

src/taskgraph/decision.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def taskgraph_decision(options, parameters=None):
7474
* generating a set of artifacts to memorialize the graph
7575
* calling TaskCluster APIs to create the graph
7676
"""
77+
if options.get("verbose"):
78+
logging.root.setLevel(logging.DEBUG)
7779

7880
parameters = parameters or (
7981
lambda graph_config: get_decision_parameters(graph_config, options)

src/taskgraph/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,9 @@ def image_digest(args):
697697
"--tasks-for", required=True, help="the tasks_for value used to generate this task"
698698
)
699699
@argument("--try-task-config-file", help="path to try task configuration file")
700+
@argument(
701+
"--verbose", "-v", action="store_true", help="include debug-level logging output"
702+
)
700703
def decision(options):
701704
from taskgraph.decision import taskgraph_decision
702705

src/taskgraph/optimize/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def replace_tasks(
316316
removed_tasks.add(label)
317317
else:
318318
logger.debug(
319-
f"replace_tasks: {label} replaced by optimization strategy"
319+
f"replace_tasks: {label} replaced with {repl} by optimization strategy"
320320
)
321321
label_to_taskid[label] = repl
322322
replaced.add(label)

0 commit comments

Comments
 (0)