Skip to content

Commit

Permalink
Bug 1759030 - [gecko_taskgraph] Move 'always_target' implementation o…
Browse files Browse the repository at this point in the history
…utside of generator.py, r=releng-reviewers,gbrown

The `always_target` attribute is a feature which I believe I previously
mis-implemented. It doesn't belong in `generator.py` and should instead be
implemented somewhere in `target_tasks.py`. I chose to wrap the registration
decorator to guarantee backwards compatibility within Gecko. Though we may wish
to move it out to a filter in the future.

I'm making this change now to facilitate merging standalone and Gecko
taskgraphs. The `always_target` feature will be removed from standalone (as it
isn't being used and should consumers need something like it, they can roll
their own implementations).

With the feature removed from both Gecko and standalone in generator.py, this
file will now be identical across both Taskgraphs and can therefore be removed
from Gecko.

Differential Revision: https://phabricator.services.mozilla.com/D159181
  • Loading branch information
ahal committed Oct 14, 2022
1 parent 531fd9f commit 1b90c89
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 95 deletions.
15 changes: 1 addition & 14 deletions taskcluster/gecko_taskgraph/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,20 +358,7 @@ def _run(self):
for t in full_task_graph.tasks.values()
if t.attributes["kind"] == "docker-image"
}
# include all tasks with `always_target` set
if parameters["tasks_for"] == "hg-push":
always_target_tasks = {
t.label
for t in full_task_graph.tasks.values()
if t.attributes.get("always_target")
}
else:
always_target_tasks = set()
logger.info(
"Adding %d tasks with `always_target` attribute"
% (len(always_target_tasks) - len(always_target_tasks & target_tasks))
)
requested_tasks = target_tasks | docker_image_tasks | always_target_tasks
requested_tasks = target_tasks | docker_image_tasks
target_graph = full_task_graph.graph.transitive_closure(requested_tasks)
target_task_graph = TaskGraph(
{l: all_tasks[l] for l in target_graph.nodes}, target_graph
Expand Down
Loading

0 comments on commit 1b90c89

Please sign in to comment.