mozilla-taskgraph 1.3.0__tar.gz → 1.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. mozilla-taskgraph-1.3.2/PKG-INFO +25 -0
  2. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/setup.py +5 -0
  3. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph/worker_types.py +24 -7
  4. mozilla-taskgraph-1.3.2/src/mozilla_taskgraph.egg-info/PKG-INFO +25 -0
  5. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/test/test_worker_types.py +66 -13
  6. mozilla-taskgraph-1.3.0/PKG-INFO +0 -15
  7. mozilla-taskgraph-1.3.0/src/mozilla_taskgraph.egg-info/PKG-INFO +0 -15
  8. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/LICENSE +0 -0
  9. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/README.md +0 -0
  10. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/pyproject.toml +0 -0
  11. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/setup.cfg +0 -0
  12. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph/__init__.py +0 -0
  13. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph/actions/__init__.py +0 -0
  14. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph/actions/release_promotion.py +0 -0
  15. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph/config.py +0 -0
  16. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph/transforms/__init__.py +0 -0
  17. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph/transforms/scriptworker/__init__.py +0 -0
  18. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph/transforms/scriptworker/release_artifacts.py +0 -0
  19. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph/transforms/scriptworker/shipit/__init__.py +0 -0
  20. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph/transforms/scriptworker/shipit/mark_as_shipped.py +0 -0
  21. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph/version.py +0 -0
  22. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph.egg-info/SOURCES.txt +0 -0
  23. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph.egg-info/dependency_links.txt +0 -0
  24. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph.egg-info/requires.txt +0 -0
  25. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/src/mozilla_taskgraph.egg-info/top_level.txt +0 -0
  26. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/test/test_register.py +0 -0
  27. {mozilla-taskgraph-1.3.0 → mozilla-taskgraph-1.3.2}/test/test_version.py +0 -0
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.1
2
+ Name: mozilla-taskgraph
3
+ Version: 1.3.2
4
+ Summary: Mozilla-specific transforms and utilities for Taskgraph
5
+ Home-page: https://github.com/mozilla-releng/mozilla-taskgraph
6
+ Classifier: Development Status :: 4 - Beta
7
+ Classifier: Environment :: Console
8
+ Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
9
+ Classifier: Programming Language :: Python :: 3.8
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Topic :: Software Development
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+
17
+ [![Task Status](https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/mozilla-releng/mozilla-taskgraph/main/badge.svg)](https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/mozilla-releng/mozilla-taskgraph/main/latest)
18
+ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/mozilla-releng/mozilla-taskgraph/main.svg)](https://results.pre-commit.ci/latest/github/taskcluster/taskgraph/main)
19
+ [![Code Coverage](https://codecov.io/gh/mozilla-releng/mozilla-taskgraph/branch/main/graph/badge.svg?token=GJIV52ZQNP)](https://codecov.io/gh/mozilla-releng/mozilla-taskgraph)
20
+ [![Pypi Version](https://badge.fury.io/py/mozilla-taskgraph.svg)](https://badge.fury.io/py/mozilla-taskgraph)
21
+ [![Documentation Status](https://readthedocs.org/projects/mozilla-taskgraph/badge/?version=latest)](https://mozilla-taskgraph.readthedocs.io/en/latest/?badge=latest)
22
+ [![License](https://img.shields.io/badge/license-MPL%202.0-orange.svg)](http://mozilla.org/MPL/2.0)
23
+
24
+ # mozilla-taskgraph
25
+ Mozilla-specific transforms and utilities for Taskgraph
@@ -12,10 +12,15 @@ with open(version_file) as fh:
12
12
  with open(os.path.join(project_dir, "requirements/base.in")) as fp:
13
13
  requirements = fp.read().splitlines()
14
14
 
15
+ with open(os.path.join(project_dir, "README.md")) as fh:
16
+ long_description = fh.read()
17
+
15
18
  setup(
16
19
  name="mozilla-taskgraph",
17
20
  version=version,
18
21
  description="Mozilla-specific transforms and utilities for Taskgraph",
22
+ long_description=long_description,
23
+ long_description_content_type="text/markdown",
19
24
  url="https://github.com/mozilla-releng/mozilla-taskgraph",
20
25
  packages=find_packages("src"),
21
26
  package_dir={"": "src"},
@@ -73,7 +73,7 @@ from voluptuous import Extra, Optional, Required
73
73
  )
74
74
  def build_bitrise_payload(config, task, task_def):
75
75
  bitrise = task["worker"]["bitrise"]
76
- build_params = task_def["payload"] = bitrise.get("build_params") or {}
76
+ build_params = bitrise.get("build_params") or {}
77
77
  task_def["tags"]["worker-implementation"] = "scriptworker"
78
78
 
79
79
  scope_prefix = config.graph_config["scriptworker"]["scope-prefix"]
@@ -87,23 +87,40 @@ def build_bitrise_payload(config, task, task_def):
87
87
  build_params.setdefault("commit_hash", config.params["head_rev"])
88
88
  build_params.setdefault("branch_repo_owner", config.params["head_repository"])
89
89
 
90
- if config.params["head_ref"]:
91
- build_params.setdefault("branch", config.params["head_ref"])
90
+ def normref(ref, type="heads"):
91
+ if ref:
92
+ prefix = f"refs/{type}/"
93
+ if ref.startswith(prefix):
94
+ return ref[len(prefix) :]
95
+ # The ref is a different type than the requested one, return None
96
+ # to indicate this.
97
+ elif ref.startswith("refs/"):
98
+ return None
99
+ return ref
92
100
 
93
- if config.params["head_tag"]:
94
- build_params.setdefault("tag", config.params["head_tag"])
101
+ head_ref = normref(config.params["head_ref"])
102
+ head_tag = normref(config.params["head_tag"], type="tags")
103
+ base_ref = normref(config.params["base_ref"])
104
+
105
+ if head_ref:
106
+ build_params.setdefault("branch", head_ref)
107
+
108
+ if head_tag:
109
+ build_params.setdefault("tag", head_tag)
95
110
 
96
111
  if config.params["tasks_for"] == "github-pull-request":
97
112
  build_params.setdefault("pull_request_author", config.params["owner"])
98
113
 
99
- if config.params["base_ref"]:
100
- build_params.setdefault("branch_dest", config.params["base_ref"])
114
+ if base_ref:
115
+ build_params.setdefault("branch_dest", base_ref)
101
116
 
102
117
  if config.params["base_repository"]:
103
118
  build_params.setdefault(
104
119
  "branch_dest_repo_owner", config.params["base_repository"]
105
120
  )
106
121
 
122
+ task_def["payload"] = {"build_params": build_params}
123
+
107
124
 
108
125
  @payload_builder(
109
126
  "scriptworker-shipit",
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.1
2
+ Name: mozilla-taskgraph
3
+ Version: 1.3.2
4
+ Summary: Mozilla-specific transforms and utilities for Taskgraph
5
+ Home-page: https://github.com/mozilla-releng/mozilla-taskgraph
6
+ Classifier: Development Status :: 4 - Beta
7
+ Classifier: Environment :: Console
8
+ Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
9
+ Classifier: Programming Language :: Python :: 3.8
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Topic :: Software Development
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+
17
+ [![Task Status](https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/mozilla-releng/mozilla-taskgraph/main/badge.svg)](https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/mozilla-releng/mozilla-taskgraph/main/latest)
18
+ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/mozilla-releng/mozilla-taskgraph/main.svg)](https://results.pre-commit.ci/latest/github/taskcluster/taskgraph/main)
19
+ [![Code Coverage](https://codecov.io/gh/mozilla-releng/mozilla-taskgraph/branch/main/graph/badge.svg?token=GJIV52ZQNP)](https://codecov.io/gh/mozilla-releng/mozilla-taskgraph)
20
+ [![Pypi Version](https://badge.fury.io/py/mozilla-taskgraph.svg)](https://badge.fury.io/py/mozilla-taskgraph)
21
+ [![Documentation Status](https://readthedocs.org/projects/mozilla-taskgraph/badge/?version=latest)](https://mozilla-taskgraph.readthedocs.io/en/latest/?badge=latest)
22
+ [![License](https://img.shields.io/badge/license-MPL%202.0-orange.svg)](http://mozilla.org/MPL/2.0)
23
+
24
+ # mozilla-taskgraph
25
+ Mozilla-specific transforms and utilities for Taskgraph
@@ -21,9 +21,11 @@ from mozilla_taskgraph import worker_types
21
21
  {},
22
22
  {
23
23
  "payload": {
24
- "branch": "default",
25
- "branch_repo_owner": "http://example.com/head/repo",
26
- "commit_hash": "abcdef",
24
+ "build_params": {
25
+ "branch": "default",
26
+ "branch_repo_owner": "http://example.com/head/repo",
27
+ "commit_hash": "abcdef",
28
+ },
27
29
  },
28
30
  "scopes": [
29
31
  "foo:bitrise:app:some-app",
@@ -39,12 +41,14 @@ from mozilla_taskgraph import worker_types
39
41
  {"tasks_for": "github-pull-request"},
40
42
  {
41
43
  "payload": {
42
- "branch": "default",
43
- "branch_dest": "123456",
44
- "branch_dest_repo_owner": "http://example.com/base/repo",
45
- "branch_repo_owner": "http://example.com/head/repo",
46
- "commit_hash": "abcdef",
47
- "pull_request_author": "some-owner",
44
+ "build_params": {
45
+ "branch": "default",
46
+ "branch_dest": "123456",
47
+ "branch_dest_repo_owner": "http://example.com/base/repo",
48
+ "branch_repo_owner": "http://example.com/head/repo",
49
+ "commit_hash": "abcdef",
50
+ "pull_request_author": "some-owner",
51
+ },
48
52
  },
49
53
  "scopes": ["foo:bitrise:app:some-app", "foo:bitrise:workflow:bar"],
50
54
  "tags": {"worker-implementation": "scriptworker"},
@@ -62,16 +66,65 @@ from mozilla_taskgraph import worker_types
62
66
  },
63
67
  {
64
68
  "payload": {
65
- "branch_repo_owner": "http://example.com/head/repo",
66
- "commit_hash": "abcdef",
67
- "pull_request_author": "some-owner",
68
- "tag": "some-tag",
69
+ "build_params": {
70
+ "branch_repo_owner": "http://example.com/head/repo",
71
+ "commit_hash": "abcdef",
72
+ "pull_request_author": "some-owner",
73
+ "tag": "some-tag",
74
+ }
69
75
  },
70
76
  "scopes": ["foo:bitrise:app:some-app", "foo:bitrise:workflow:bar"],
71
77
  "tags": {"worker-implementation": "scriptworker"},
72
78
  },
73
79
  id="opposite params", # this test helps hit other half of if statements
74
80
  ),
81
+ pytest.param(
82
+ {"bitrise": {"app": "some-app", "workflows": ["bar"]}},
83
+ {
84
+ "base_ref": "refs/heads/foo",
85
+ "base_repository": "",
86
+ "head_ref": "refs/heads/bar",
87
+ "head_tag": "refs/tags/some-tag",
88
+ "tasks_for": "github-pull-request",
89
+ },
90
+ {
91
+ "payload": {
92
+ "build_params": {
93
+ "branch": "bar",
94
+ "branch_dest": "foo",
95
+ "branch_repo_owner": "http://example.com/head/repo",
96
+ "commit_hash": "abcdef",
97
+ "pull_request_author": "some-owner",
98
+ "tag": "some-tag",
99
+ }
100
+ },
101
+ "scopes": ["foo:bitrise:app:some-app", "foo:bitrise:workflow:bar"],
102
+ "tags": {"worker-implementation": "scriptworker"},
103
+ },
104
+ id="normalize refs",
105
+ ),
106
+ pytest.param(
107
+ {"bitrise": {"app": "some-app", "workflows": ["bar"]}},
108
+ {
109
+ "base_ref": "refs/tags/foo",
110
+ "base_repository": "",
111
+ "head_ref": "refs/tags/bar",
112
+ "head_tag": "refs/heads/some-tag",
113
+ "tasks_for": "github-pull-request",
114
+ },
115
+ {
116
+ "payload": {
117
+ "build_params": {
118
+ "branch_repo_owner": "http://example.com/head/repo",
119
+ "commit_hash": "abcdef",
120
+ "pull_request_author": "some-owner",
121
+ }
122
+ },
123
+ "scopes": ["foo:bitrise:app:some-app", "foo:bitrise:workflow:bar"],
124
+ "tags": {"worker-implementation": "scriptworker"},
125
+ },
126
+ id="normalize refs wrong type",
127
+ ),
75
128
  ),
76
129
  )
77
130
  def test_build_bitrise_payload(
@@ -1,15 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: mozilla-taskgraph
3
- Version: 1.3.0
4
- Summary: Mozilla-specific transforms and utilities for Taskgraph
5
- Home-page: https://github.com/mozilla-releng/mozilla-taskgraph
6
- Classifier: Development Status :: 4 - Beta
7
- Classifier: Environment :: Console
8
- Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
9
- Classifier: Programming Language :: Python :: 3.8
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Topic :: Software Development
14
- License-File: LICENSE
15
- Requires-Dist: taskcluster-taskgraph<8,>=5.4
@@ -1,15 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: mozilla-taskgraph
3
- Version: 1.3.0
4
- Summary: Mozilla-specific transforms and utilities for Taskgraph
5
- Home-page: https://github.com/mozilla-releng/mozilla-taskgraph
6
- Classifier: Development Status :: 4 - Beta
7
- Classifier: Environment :: Console
8
- Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
9
- Classifier: Programming Language :: Python :: 3.8
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Topic :: Software Development
14
- License-File: LICENSE
15
- Requires-Dist: taskcluster-taskgraph<8,>=5.4