From 0a5262d67ce1f092c142f8e35df61412721c80d9 Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Thu, 12 Dec 2024 10:49:23 -0500 Subject: [PATCH] chore: fix head_ref detection in 'release' target tasks method This ensures that the proper head ref is detected whether it is prefixed with `refs/tags/` or not. This also updates the test params to reflect reality. --- taskcluster/self_taskgraph/custom_target_tasks.py | 3 ++- .../test/params/main-repo-release-pytest-taskgraph.yml | 6 +++--- .../test/params/main-repo-release-taskcluster-taskgraph.yml | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/taskcluster/self_taskgraph/custom_target_tasks.py b/taskcluster/self_taskgraph/custom_target_tasks.py index 5c59afc62..e5fea7bf6 100644 --- a/taskcluster/self_taskgraph/custom_target_tasks.py +++ b/taskcluster/self_taskgraph/custom_target_tasks.py @@ -9,7 +9,8 @@ def target_tasks_release(full_task_graph, parameters, graph_config): # Ensure we don't run `taskcluster-taskgraph` release tasks when publishing # `pytest-taskgraph`. - if parameters["head_ref"].startswith("refs/tags/pytest-taskgraph"): + head_ref = parameters.rsplit("/", 1)[-1] + if head_ref.startswith("pytest-taskgraph"): tasks = { l: t for l, t in tasks.items() diff --git a/taskcluster/test/params/main-repo-release-pytest-taskgraph.yml b/taskcluster/test/params/main-repo-release-pytest-taskgraph.yml index 03fd06efc..d56b8cbc3 100644 --- a/taskcluster/test/params/main-repo-release-pytest-taskgraph.yml +++ b/taskcluster/test/params/main-repo-release-pytest-taskgraph.yml @@ -12,10 +12,10 @@ files_changed: - test/test_decision.py filters: - target_tasks_method -head_ref: refs/tags/pytest-taskgraph-v1.0.0 +head_ref: pytest-taskgraph-v1.0.0 head_repository: https://github.com/taskcluster/taskgraph -head_rev: release-test -head_tag: pytest-taskgraph-v1.0.0 +head_rev: pytest-taskgraph-v1.0.0 +head_tag: '' level: '3' moz_build_date: '20240207083344' next_version: null diff --git a/taskcluster/test/params/main-repo-release-taskcluster-taskgraph.yml b/taskcluster/test/params/main-repo-release-taskcluster-taskgraph.yml index 35dc1d350..5fed1bc7b 100644 --- a/taskcluster/test/params/main-repo-release-taskcluster-taskgraph.yml +++ b/taskcluster/test/params/main-repo-release-taskcluster-taskgraph.yml @@ -12,10 +12,10 @@ files_changed: - test/test_decision.py filters: - target_tasks_method -head_ref: refs/tags/1.0.0 +head_ref: 1.0.0 head_repository: https://github.com/taskcluster/taskgraph -head_rev: release-test -head_tag: 1.0.0 +head_rev: 1.0.0 +head_tag: '' level: '3' moz_build_date: '20240207083344' next_version: null