mozilla-taskgraph 2.0.1__tar.gz → 2.0.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 (25) hide show
  1. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/PKG-INFO +1 -1
  2. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph/worker_types.py +16 -10
  3. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph.egg-info/PKG-INFO +1 -1
  4. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/test/test_worker_types.py +59 -15
  5. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/LICENSE +0 -0
  6. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/README.md +0 -0
  7. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/pyproject.toml +0 -0
  8. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/setup.cfg +0 -0
  9. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/setup.py +0 -0
  10. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph/__init__.py +0 -0
  11. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph/actions/__init__.py +0 -0
  12. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph/actions/release_promotion.py +0 -0
  13. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph/config.py +0 -0
  14. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph/transforms/__init__.py +0 -0
  15. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph/transforms/scriptworker/__init__.py +0 -0
  16. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph/transforms/scriptworker/release_artifacts.py +0 -0
  17. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph/transforms/scriptworker/shipit/__init__.py +0 -0
  18. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph/transforms/scriptworker/shipit/mark_as_shipped.py +0 -0
  19. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph/version.py +0 -0
  20. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph.egg-info/SOURCES.txt +0 -0
  21. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph.egg-info/dependency_links.txt +0 -0
  22. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph.egg-info/requires.txt +0 -0
  23. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/src/mozilla_taskgraph.egg-info/top_level.txt +0 -0
  24. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/test/test_register.py +0 -0
  25. {mozilla-taskgraph-2.0.1 → mozilla-taskgraph-2.0.2}/test/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mozilla-taskgraph
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Mozilla-specific transforms and utilities for Taskgraph
5
5
  Home-page: https://github.com/mozilla-releng/mozilla-taskgraph
6
6
  Classifier: Development Status :: 4 - Beta
@@ -17,8 +17,8 @@ from voluptuous import Any, Extra, Optional, Required
17
17
  Any(
18
18
  # Workflow id - no special environment variable
19
19
  str,
20
- # Map of workflow id to environment variables
21
- {str: {str: taskref_or_string}},
20
+ # Map of workflow id to permutations of environment variables
21
+ {str: [{str: taskref_or_string}]},
22
22
  )
23
23
  ],
24
24
  Optional(
@@ -35,16 +35,20 @@ def build_bitrise_payload(config, task, task_def):
35
35
  task_def["tags"]["worker-implementation"] = "scriptworker"
36
36
 
37
37
  # Normalize environment variables to bitrise's format.
38
- workflow_params = {}
38
+ workflow_permutations = {}
39
39
  for workflow in bitrise["workflows"]:
40
40
  if isinstance(workflow, str):
41
41
  # Empty environments
42
42
  continue
43
- for workflow_id, envs in workflow.items():
44
- workflow_params[workflow_id] = {"environments": []}
45
- for k, v in envs.items():
46
- workflow_params[workflow_id]["environments"].append(
47
- {"mapped_to": k, "value": v},
43
+ for workflow_id, env_permutations in workflow.items():
44
+ workflow_permutations.setdefault(workflow_id, [])
45
+ for envs in env_permutations:
46
+ workflow_permutations[workflow_id].append(
47
+ {
48
+ "environments": [
49
+ {"mapped_to": k, "value": v} for k, v in envs.items()
50
+ ]
51
+ }
48
52
  )
49
53
 
50
54
  def get_workflow_ids():
@@ -54,6 +58,8 @@ def build_bitrise_payload(config, task, task_def):
54
58
  ids.append(w)
55
59
  else:
56
60
  ids.extend(w.keys())
61
+ ids = list(set(ids)) # Unique only
62
+ ids.sort() # sorted to allow for proper unit testing
57
63
  return ids
58
64
 
59
65
  scope_prefix = config.graph_config["scriptworker"]["scope-prefix"]
@@ -102,8 +108,8 @@ def build_bitrise_payload(config, task, task_def):
102
108
  global_params["branch_dest_repo_owner"] = base_repository
103
109
 
104
110
  task_def["payload"] = {"global_params": global_params}
105
- if workflow_params:
106
- task_def["payload"]["workflow_params"] = workflow_params
111
+ if workflow_permutations:
112
+ task_def["payload"]["workflow_params"] = workflow_permutations
107
113
 
108
114
  if bitrise.get("artifact_prefix"):
109
115
  task_def["payload"]["artifact_prefix"] = bitrise["artifact_prefix"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mozilla-taskgraph
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Mozilla-specific transforms and utilities for Taskgraph
5
5
  Home-page: https://github.com/mozilla-releng/mozilla-taskgraph
6
6
  Classifier: Development Status :: 4 - Beta
@@ -170,10 +170,30 @@ from mozilla_taskgraph import worker_types
170
170
  "workflows": [
171
171
  "foo",
172
172
  {
173
- "bar": {
174
- "FOO": "bar",
175
- "PATH": {"artifact-reference": "<build/target.zip>"},
176
- }
173
+ "bar": [
174
+ {
175
+ "FOO": "bar",
176
+ "PATH": {
177
+ "artifact-reference": "<build/target.zip>"
178
+ },
179
+ },
180
+ {
181
+ "FOO": "notbar",
182
+ "PATH": {
183
+ "artifact-reference": "<build/target.zip>"
184
+ },
185
+ },
186
+ ]
187
+ },
188
+ {
189
+ "bar": [
190
+ {
191
+ "FOO": "bazzz",
192
+ "PATH": {
193
+ "artifact-reference": "<build/target.zip>"
194
+ },
195
+ },
196
+ ]
177
197
  },
178
198
  ],
179
199
  }
@@ -187,23 +207,47 @@ from mozilla_taskgraph import worker_types
187
207
  "commit_hash": "abcdef",
188
208
  },
189
209
  "workflow_params": {
190
- "bar": {
191
- "environments": [
192
- {"mapped_to": "FOO", "value": "bar"},
193
- {
194
- "mapped_to": "PATH",
195
- "value": {
196
- "artifact-reference": "<build/target.zip>"
210
+ "bar": [
211
+ {
212
+ "environments": [
213
+ {"mapped_to": "FOO", "value": "bar"},
214
+ {
215
+ "mapped_to": "PATH",
216
+ "value": {
217
+ "artifact-reference": "<build/target.zip>"
218
+ },
197
219
  },
198
- },
199
- ]
200
- }
220
+ ]
221
+ },
222
+ {
223
+ "environments": [
224
+ {"mapped_to": "FOO", "value": "notbar"},
225
+ {
226
+ "mapped_to": "PATH",
227
+ "value": {
228
+ "artifact-reference": "<build/target.zip>"
229
+ },
230
+ },
231
+ ]
232
+ },
233
+ {
234
+ "environments": [
235
+ {"mapped_to": "FOO", "value": "bazzz"},
236
+ {
237
+ "mapped_to": "PATH",
238
+ "value": {
239
+ "artifact-reference": "<build/target.zip>"
240
+ },
241
+ },
242
+ ]
243
+ },
244
+ ]
201
245
  },
202
246
  },
203
247
  "scopes": [
204
248
  "foo:bitrise:app:some-app",
205
- "foo:bitrise:workflow:foo",
206
249
  "foo:bitrise:workflow:bar",
250
+ "foo:bitrise:workflow:foo",
207
251
  ],
208
252
  "tags": {"worker-implementation": "scriptworker"},
209
253
  },