taskcluster-taskgraph 4.2.0__tar.gz → 4.3.0__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 (128) hide show
  1. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/MANIFEST.in +0 -1
  2. {taskcluster-taskgraph-4.2.0/src/taskcluster_taskgraph.egg-info → taskcluster-taskgraph-4.3.0}/PKG-INFO +1 -6
  3. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/requirements/base.in +1 -0
  4. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/requirements/base.txt +103 -2
  5. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/requirements/test.txt +0 -4
  6. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/setup.py +6 -4
  7. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0/src/taskcluster_taskgraph.egg-info}/PKG-INFO +1 -6
  8. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskcluster_taskgraph.egg-info/SOURCES.txt +0 -1
  9. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskcluster_taskgraph.egg-info/entry_points.txt +0 -1
  10. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskcluster_taskgraph.egg-info/requires.txt +1 -0
  11. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/__init__.py +1 -0
  12. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/decision.py +3 -1
  13. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/main.py +76 -0
  14. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/run-task/fetch-content +1 -1
  15. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_decision.py +50 -0
  16. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_main.py +72 -7
  17. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_parameters.py +1 -4
  18. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_vcs.py +4 -136
  19. taskcluster-taskgraph-4.2.0/version.txt +0 -1
  20. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/LICENSE +0 -0
  21. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/README.rst +0 -0
  22. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/pyproject.toml +0 -0
  23. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/requirements/dev.in +0 -0
  24. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/requirements/dev.txt +0 -0
  25. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/requirements/test.in +0 -0
  26. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/setup.cfg +0 -0
  27. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskcluster_taskgraph.egg-info/dependency_links.txt +0 -0
  28. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskcluster_taskgraph.egg-info/top_level.txt +0 -0
  29. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/actions/__init__.py +0 -0
  30. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/actions/add_new_jobs.py +0 -0
  31. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/actions/cancel.py +0 -0
  32. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/actions/cancel_all.py +0 -0
  33. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/actions/rebuild_cached_tasks.py +0 -0
  34. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/actions/registry.py +0 -0
  35. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/actions/retrigger.py +0 -0
  36. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/actions/util.py +0 -0
  37. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/config.py +0 -0
  38. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/create.py +0 -0
  39. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/docker.py +0 -0
  40. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/files_changed.py +0 -0
  41. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/filter_tasks.py +0 -0
  42. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/generator.py +0 -0
  43. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/graph.py +0 -0
  44. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/loader/__init__.py +0 -0
  45. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/loader/transform.py +0 -0
  46. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/morph.py +0 -0
  47. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/optimize/__init__.py +0 -0
  48. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/optimize/base.py +0 -0
  49. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/optimize/strategies.py +0 -0
  50. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/parameters.py +0 -0
  51. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/run-task/hgrc +0 -0
  52. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/run-task/robustcheckout.py +0 -0
  53. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/run-task/run-task +0 -0
  54. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/target_tasks.py +0 -0
  55. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/task.py +0 -0
  56. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/taskgraph.py +0 -0
  57. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/__init__.py +0 -0
  58. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/base.py +0 -0
  59. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/cached_tasks.py +0 -0
  60. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/code_review.py +0 -0
  61. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/docker_image.py +0 -0
  62. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/fetch.py +0 -0
  63. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/job/__init__.py +0 -0
  64. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/job/common.py +0 -0
  65. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/job/index_search.py +0 -0
  66. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/job/run_task.py +0 -0
  67. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/job/toolchain.py +0 -0
  68. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/notify.py +0 -0
  69. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/transforms/task.py +0 -0
  70. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/__init__.py +0 -0
  71. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/archive.py +0 -0
  72. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/attributes.py +0 -0
  73. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/cached_tasks.py +0 -0
  74. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/decision.py +0 -0
  75. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/docker.py +0 -0
  76. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/hash.py +0 -0
  77. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/keyed_by.py +0 -0
  78. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/memoize.py +0 -0
  79. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/parameterization.py +0 -0
  80. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/path.py +0 -0
  81. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/python_path.py +0 -0
  82. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/readonlydict.py +0 -0
  83. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/schema.py +0 -0
  84. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/shell.py +0 -0
  85. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/taskcluster.py +0 -0
  86. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/taskgraph.py +0 -0
  87. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/templates.py +0 -0
  88. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/time.py +0 -0
  89. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/treeherder.py +0 -0
  90. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/vcs.py +0 -0
  91. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/verify.py +0 -0
  92. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/workertypes.py +0 -0
  93. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/src/taskgraph/util/yaml.py +0 -0
  94. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_actions_rebuild_cached_tasks.py +0 -0
  95. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_actions_registry.py +0 -0
  96. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_create.py +0 -0
  97. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_files_changed.py +0 -0
  98. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_generator.py +0 -0
  99. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_graph.py +0 -0
  100. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_morph.py +0 -0
  101. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_optimize.py +0 -0
  102. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_optimize_strategies.py +0 -0
  103. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_scripts_fetch_content.py +0 -0
  104. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_scripts_run_task.py +0 -0
  105. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_target_tasks.py +0 -0
  106. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_taskgraph.py +0 -0
  107. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_transforms_base.py +0 -0
  108. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_transforms_fetch.py +0 -0
  109. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_transforms_job.py +0 -0
  110. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_transforms_job_run_task.py +0 -0
  111. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_transforms_job_toolchain.py +0 -0
  112. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_transforms_notify.py +0 -0
  113. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_transforms_task.py +0 -0
  114. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_attributes.py +0 -0
  115. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_docker.py +0 -0
  116. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_memoize.py +0 -0
  117. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_parameterization.py +0 -0
  118. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_path.py +0 -0
  119. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_python_path.py +0 -0
  120. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_readonlydict.py +0 -0
  121. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_schema.py +0 -0
  122. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_taskcluster.py +0 -0
  123. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_templates.py +0 -0
  124. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_time.py +0 -0
  125. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_treeherder.py +0 -0
  126. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_verify.py +0 -0
  127. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_workertypes.py +0 -0
  128. {taskcluster-taskgraph-4.2.0 → taskcluster-taskgraph-4.3.0}/test/test_util_yaml.py +0 -0
@@ -4,4 +4,3 @@ include requirements/test.in
4
4
  include requirements/test.txt
5
5
  include requirements/dev.in
6
6
  include requirements/dev.txt
7
- include version.txt
@@ -1,10 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: taskcluster-taskgraph
3
- Version: 4.2.0
3
+ Version: 4.3.0
4
4
  Summary: Build taskcluster taskgraphs
5
5
  Home-page: https://github.com/taskcluster/taskgraph
6
- License: UNKNOWN
7
- Platform: UNKNOWN
8
6
  Classifier: Development Status :: 5 - Production/Stable
9
7
  Classifier: Environment :: Console
10
8
  Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
@@ -17,6 +15,3 @@ Classifier: Programming Language :: Python :: 3.11
17
15
  Classifier: Topic :: Software Development
18
16
  Provides-Extra: load-image
19
17
  License-File: LICENSE
20
-
21
- UNKNOWN
22
-
@@ -1,5 +1,6 @@
1
1
  appdirs>=1.4
2
2
  attrs>=19.1.0
3
+ cookiecutter~=2.1
3
4
  json-e>=2.7
4
5
  mozilla-repo-urls
5
6
  PyYAML>=5.4
@@ -1,4 +1,4 @@
1
- # SHA1:c6a8ad3c4813e559ba8c8588097a33743e8da1a4
1
+ # SHA1:a199a11be56ce347d10dd1fce8de55752b42b141
2
2
  #
3
3
  # This file is autogenerated by pip-compile-multi
4
4
  # To update, run:
@@ -9,14 +9,26 @@ appdirs==1.4.4 \
9
9
  --hash=sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41 \
10
10
  --hash=sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128
11
11
  # via -r requirements/base.in
12
+ arrow==1.2.3 \
13
+ --hash=sha256:3934b30ca1b9f292376d9db15b19446088d12ec58629bc3f0da28fd55fb633a1 \
14
+ --hash=sha256:5a49ab92e3b7b71d96cd6bfcc4df14efefc9dfa96ea19045815914a6ab6b1fe2
15
+ # via jinja2-time
12
16
  attrs==22.2.0 \
13
17
  --hash=sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836 \
14
18
  --hash=sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99
15
19
  # via -r requirements/base.in
20
+ binaryornot==0.4.4 \
21
+ --hash=sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061 \
22
+ --hash=sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4
23
+ # via cookiecutter
16
24
  certifi==2022.12.7 \
17
25
  --hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \
18
26
  --hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18
19
27
  # via requests
28
+ chardet==5.1.0 \
29
+ --hash=sha256:0d62712b956bc154f85fb0a266e2a3c5913c2967e00348701b32411d6def31e5 \
30
+ --hash=sha256:362777fb014af596ad31334fde1e8c327dfdb076e1960d1694662d46a6917ab9
31
+ # via binaryornot
20
32
  charset-normalizer==3.0.1 \
21
33
  --hash=sha256:00d3ffdaafe92a5dc603cb9bd5111aaa36dfa187c8285c543be562e61b755f6b \
22
34
  --hash=sha256:024e606be3ed92216e2b6952ed859d86b4cfa52cd5bc5f050e7dc28f9b43ec42 \
@@ -107,6 +119,14 @@ charset-normalizer==3.0.1 \
107
119
  --hash=sha256:f9d0c5c045a3ca9bedfc35dca8526798eb91a07aa7a2c0fee134c6c6f321cbd7 \
108
120
  --hash=sha256:ff6f3db31555657f3163b15a6b7c6938d08df7adbfc9dd13d9d19edad678f1e8
109
121
  # via requests
122
+ click==8.1.3 \
123
+ --hash=sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e \
124
+ --hash=sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48
125
+ # via cookiecutter
126
+ cookiecutter==2.1.1 \
127
+ --hash=sha256:9f3ab027cec4f70916e28f03470bdb41e637a3ad354b4d65c765d93aad160022 \
128
+ --hash=sha256:f3982be8d9c53dac1261864013fdec7f83afd2e42ede6f6dd069c5e149c540d5
129
+ # via -r requirements/base.in
110
130
  giturlparse==0.10.0 \
111
131
  --hash=sha256:04ba1a3a099c3093fa8d24a422913c6a9b2c2cd22bcffc939cf72e3e98f672d7 \
112
132
  --hash=sha256:2595ab291d30717cda8474b874c9fd509f1b9802ad7f6968c36a45e4b13eb337
@@ -115,14 +135,84 @@ idna==3.4 \
115
135
  --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \
116
136
  --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2
117
137
  # via requests
138
+ jinja2==3.1.2 \
139
+ --hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \
140
+ --hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61
141
+ # via
142
+ # cookiecutter
143
+ # jinja2-time
144
+ jinja2-time==0.2.0 \
145
+ --hash=sha256:d14eaa4d315e7688daa4969f616f226614350c48730bfa1692d2caebd8c90d40 \
146
+ --hash=sha256:d3eab6605e3ec8b7a0863df09cc1d23714908fa61aa6986a845c20ba488b4efa
147
+ # via cookiecutter
118
148
  json-e==4.5.0 \
119
149
  --hash=sha256:618a94aecc8b8bc7733d6cd0ee7b676e45675566625a38958aa8b30379d9758f \
120
150
  --hash=sha256:e733ce77b4acbbc2c48211057f8cb5af45999e6be4ce0f07585c5580df45826e
121
151
  # via -r requirements/base.in
152
+ markupsafe==2.1.2 \
153
+ --hash=sha256:0576fe974b40a400449768941d5d0858cc624e3249dfd1e0c33674e5c7ca7aed \
154
+ --hash=sha256:085fd3201e7b12809f9e6e9bc1e5c96a368c8523fad5afb02afe3c051ae4afcc \
155
+ --hash=sha256:090376d812fb6ac5f171e5938e82e7f2d7adc2b629101cec0db8b267815c85e2 \
156
+ --hash=sha256:0b462104ba25f1ac006fdab8b6a01ebbfbce9ed37fd37fd4acd70c67c973e460 \
157
+ --hash=sha256:137678c63c977754abe9086a3ec011e8fd985ab90631145dfb9294ad09c102a7 \
158
+ --hash=sha256:1bea30e9bf331f3fef67e0a3877b2288593c98a21ccb2cf29b74c581a4eb3af0 \
159
+ --hash=sha256:22152d00bf4a9c7c83960521fc558f55a1adbc0631fbb00a9471e097b19d72e1 \
160
+ --hash=sha256:22731d79ed2eb25059ae3df1dfc9cb1546691cc41f4e3130fe6bfbc3ecbbecfa \
161
+ --hash=sha256:2298c859cfc5463f1b64bd55cb3e602528db6fa0f3cfd568d3605c50678f8f03 \
162
+ --hash=sha256:28057e985dace2f478e042eaa15606c7efccb700797660629da387eb289b9323 \
163
+ --hash=sha256:2e7821bffe00aa6bd07a23913b7f4e01328c3d5cc0b40b36c0bd81d362faeb65 \
164
+ --hash=sha256:2ec4f2d48ae59bbb9d1f9d7efb9236ab81429a764dedca114f5fdabbc3788013 \
165
+ --hash=sha256:340bea174e9761308703ae988e982005aedf427de816d1afe98147668cc03036 \
166
+ --hash=sha256:40627dcf047dadb22cd25ea7ecfe9cbf3bbbad0482ee5920b582f3809c97654f \
167
+ --hash=sha256:40dfd3fefbef579ee058f139733ac336312663c6706d1163b82b3003fb1925c4 \
168
+ --hash=sha256:4cf06cdc1dda95223e9d2d3c58d3b178aa5dacb35ee7e3bbac10e4e1faacb419 \
169
+ --hash=sha256:50c42830a633fa0cf9e7d27664637532791bfc31c731a87b202d2d8ac40c3ea2 \
170
+ --hash=sha256:55f44b440d491028addb3b88f72207d71eeebfb7b5dbf0643f7c023ae1fba619 \
171
+ --hash=sha256:608e7073dfa9e38a85d38474c082d4281f4ce276ac0010224eaba11e929dd53a \
172
+ --hash=sha256:63ba06c9941e46fa389d389644e2d8225e0e3e5ebcc4ff1ea8506dce646f8c8a \
173
+ --hash=sha256:65608c35bfb8a76763f37036547f7adfd09270fbdbf96608be2bead319728fcd \
174
+ --hash=sha256:665a36ae6f8f20a4676b53224e33d456a6f5a72657d9c83c2aa00765072f31f7 \
175
+ --hash=sha256:6d6607f98fcf17e534162f0709aaad3ab7a96032723d8ac8750ffe17ae5a0666 \
176
+ --hash=sha256:7313ce6a199651c4ed9d7e4cfb4aa56fe923b1adf9af3b420ee14e6d9a73df65 \
177
+ --hash=sha256:7668b52e102d0ed87cb082380a7e2e1e78737ddecdde129acadb0eccc5423859 \
178
+ --hash=sha256:7df70907e00c970c60b9ef2938d894a9381f38e6b9db73c5be35e59d92e06625 \
179
+ --hash=sha256:7e007132af78ea9df29495dbf7b5824cb71648d7133cf7848a2a5dd00d36f9ff \
180
+ --hash=sha256:835fb5e38fd89328e9c81067fd642b3593c33e1e17e2fdbf77f5676abb14a156 \
181
+ --hash=sha256:8bca7e26c1dd751236cfb0c6c72d4ad61d986e9a41bbf76cb445f69488b2a2bd \
182
+ --hash=sha256:8db032bf0ce9022a8e41a22598eefc802314e81b879ae093f36ce9ddf39ab1ba \
183
+ --hash=sha256:99625a92da8229df6d44335e6fcc558a5037dd0a760e11d84be2260e6f37002f \
184
+ --hash=sha256:9cad97ab29dfc3f0249b483412c85c8ef4766d96cdf9dcf5a1e3caa3f3661cf1 \
185
+ --hash=sha256:a4abaec6ca3ad8660690236d11bfe28dfd707778e2442b45addd2f086d6ef094 \
186
+ --hash=sha256:a6e40afa7f45939ca356f348c8e23048e02cb109ced1eb8420961b2f40fb373a \
187
+ --hash=sha256:a6f2fcca746e8d5910e18782f976489939d54a91f9411c32051b4aab2bd7c513 \
188
+ --hash=sha256:a806db027852538d2ad7555b203300173dd1b77ba116de92da9afbc3a3be3eed \
189
+ --hash=sha256:abcabc8c2b26036d62d4c746381a6f7cf60aafcc653198ad678306986b09450d \
190
+ --hash=sha256:b8526c6d437855442cdd3d87eede9c425c4445ea011ca38d937db299382e6fa3 \
191
+ --hash=sha256:bb06feb762bade6bf3c8b844462274db0c76acc95c52abe8dbed28ae3d44a147 \
192
+ --hash=sha256:c0a33bc9f02c2b17c3ea382f91b4db0e6cde90b63b296422a939886a7a80de1c \
193
+ --hash=sha256:c4a549890a45f57f1ebf99c067a4ad0cb423a05544accaf2b065246827ed9603 \
194
+ --hash=sha256:ca244fa73f50a800cf8c3ebf7fd93149ec37f5cb9596aa8873ae2c1d23498601 \
195
+ --hash=sha256:cf877ab4ed6e302ec1d04952ca358b381a882fbd9d1b07cccbfd61783561f98a \
196
+ --hash=sha256:d9d971ec1e79906046aa3ca266de79eac42f1dbf3612a05dc9368125952bd1a1 \
197
+ --hash=sha256:da25303d91526aac3672ee6d49a2f3db2d9502a4a60b55519feb1a4c7714e07d \
198
+ --hash=sha256:e55e40ff0cc8cc5c07996915ad367fa47da6b3fc091fdadca7f5403239c5fec3 \
199
+ --hash=sha256:f03a532d7dee1bed20bc4884194a16160a2de9ffc6354b3878ec9682bb623c54 \
200
+ --hash=sha256:f1cd098434e83e656abf198f103a8207a8187c0fc110306691a2e94a78d0abb2 \
201
+ --hash=sha256:f2bfb563d0211ce16b63c7cb9395d2c682a23187f54c3d79bfec33e6705473c6 \
202
+ --hash=sha256:f8ffb705ffcf5ddd0e80b65ddf7bed7ee4f5a441ea7d3419e861a12eaf41af58
203
+ # via jinja2
122
204
  mozilla-repo-urls==0.1.1 \
123
205
  --hash=sha256:30510d3519479aa70211145d0ac9cf6e2fadcb8d30fa3b196bb957bd773502ba \
124
206
  --hash=sha256:7364da790751db2a060eb45adbf1d7db89a145ed279ba235f3425db9dd255915
125
207
  # via -r requirements/base.in
208
+ python-dateutil==2.8.2 \
209
+ --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \
210
+ --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9
211
+ # via arrow
212
+ python-slugify==8.0.1 \
213
+ --hash=sha256:70ca6ea68fe63ecc8fa4fcf00ae651fc8a5d02d93dcd12ae6d4fc7ca46c4d395 \
214
+ --hash=sha256:ce0d46ddb668b3be82f4ed5e503dbc33dd815d83e2eb6824211310d3fb172a27
215
+ # via cookiecutter
126
216
  pyyaml==6.0 \
127
217
  --hash=sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf \
128
218
  --hash=sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293 \
@@ -164,7 +254,9 @@ pyyaml==6.0 \
164
254
  --hash=sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f \
165
255
  --hash=sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174 \
166
256
  --hash=sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5
167
- # via -r requirements/base.in
257
+ # via
258
+ # -r requirements/base.in
259
+ # cookiecutter
168
260
  redo==2.0.4 \
169
261
  --hash=sha256:81066955041c853b0e6491eb65a0877dce45131c4cfa3d42d923fc2aa8f7a043 \
170
262
  --hash=sha256:c76e4c23ab2f8840261736a851323cd98493710e7a9d36a1058535dca501f293
@@ -174,11 +266,16 @@ requests==2.28.2 \
174
266
  --hash=sha256:98b1b2782e3c6c4904938b84c0eb932721069dfdb9134313beff7c83c2df24bf
175
267
  # via
176
268
  # -r requirements/base.in
269
+ # cookiecutter
177
270
  # requests-unixsocket
178
271
  requests-unixsocket==0.3.0 \
179
272
  --hash=sha256:28304283ea9357d45fff58ad5b11e47708cfbf5806817aa59b2a363228ee971e \
180
273
  --hash=sha256:c685c680f0809e1b2955339b1e5afc3c0022b3066f4f7eb343f43a6065fc0e5d
181
274
  # via -r requirements/base.in
275
+ six==1.16.0 \
276
+ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
277
+ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
278
+ # via python-dateutil
182
279
  slugid==2.0.0 \
183
280
  --hash=sha256:a950d98b72691178bdd4d6c52743c4a2aa039207cf7a97d71060a111ff9ba297 \
184
281
  --hash=sha256:aec8b0e01c4ad32e38e12d609eab3ec912fd129aaf6b2ded0199b56a5f8fd67c
@@ -188,6 +285,10 @@ taskcluster-urls==13.0.1 \
188
285
  --hash=sha256:b25e122ecec249c4299ac7b20b08db76e3e2025bdaeb699a9d444556de5fd367 \
189
286
  --hash=sha256:f66dcbd6572a6216ab65949f0fa0b91f2df647918028436c384e6af5cd12ae2b
190
287
  # via -r requirements/base.in
288
+ text-unidecode==1.3 \
289
+ --hash=sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8 \
290
+ --hash=sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93
291
+ # via python-slugify
191
292
  urllib3==1.26.14 \
192
293
  --hash=sha256:076907bf8fd355cde77728471316625a4d2f7e713c125f51953bb5b3eecf4f72 \
193
294
  --hash=sha256:75edcdc2f7d85b137124a6c3c9fc3933cdeaa12ecb9a6a959f22797a0feca7e1
@@ -10,10 +10,6 @@ cachetools==5.2.1 \
10
10
  --hash=sha256:5991bc0e08a1319bb618d3195ca5b6bc76646a49c21d55962977197b301cc1fe \
11
11
  --hash=sha256:8462eebf3a6c15d25430a8c27c56ac61340b2ecf60c9ce57afc2b97e450e47da
12
12
  # via tox
13
- chardet==5.1.0 \
14
- --hash=sha256:0d62712b956bc154f85fb0a266e2a3c5913c2967e00348701b32411d6def31e5 \
15
- --hash=sha256:362777fb014af596ad31334fde1e8c327dfdb076e1960d1694662d46a6917ab9
16
- # via tox
17
13
  colorama==0.4.6 \
18
14
  --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
19
15
  --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6
@@ -1,19 +1,21 @@
1
1
  import os
2
+ from distutils.util import convert_path
2
3
 
3
4
  from setuptools import find_packages, setup
4
5
 
5
6
  project_dir = os.path.abspath(os.path.dirname(__file__))
6
7
 
8
+ namespace = {}
9
+ version_file = convert_path("src/taskgraph/__init__.py")
10
+ with open(version_file) as fh:
11
+ exec(fh.read(), namespace)
7
12
 
8
13
  with open(os.path.join(project_dir, "requirements/base.in")) as fp:
9
14
  requirements = fp.read().splitlines()
10
15
 
11
- with open(os.path.join(project_dir, "version.txt")) as f:
12
- version = f.read().rstrip()
13
-
14
16
  setup(
15
17
  name="taskcluster-taskgraph",
16
- version=version,
18
+ version=namespace["__version__"],
17
19
  description="Build taskcluster taskgraphs",
18
20
  url="https://github.com/taskcluster/taskgraph",
19
21
  packages=find_packages("src"),
@@ -1,10 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: taskcluster-taskgraph
3
- Version: 4.2.0
3
+ Version: 4.3.0
4
4
  Summary: Build taskcluster taskgraphs
5
5
  Home-page: https://github.com/taskcluster/taskgraph
6
- License: UNKNOWN
7
- Platform: UNKNOWN
8
6
  Classifier: Development Status :: 5 - Production/Stable
9
7
  Classifier: Environment :: Console
10
8
  Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
@@ -17,6 +15,3 @@ Classifier: Programming Language :: Python :: 3.11
17
15
  Classifier: Topic :: Software Development
18
16
  Provides-Extra: load-image
19
17
  License-File: LICENSE
20
-
21
- UNKNOWN
22
-
@@ -3,7 +3,6 @@ MANIFEST.in
3
3
  README.rst
4
4
  pyproject.toml
5
5
  setup.py
6
- version.txt
7
6
  requirements/base.in
8
7
  requirements/base.txt
9
8
  requirements/dev.in
@@ -1,3 +1,2 @@
1
1
  [console_scripts]
2
2
  taskgraph = taskgraph.main:main
3
-
@@ -1,5 +1,6 @@
1
1
  appdirs>=1.4
2
2
  attrs>=19.1.0
3
+ cookiecutter~=2.1
3
4
  json-e>=2.7
4
5
  mozilla-repo-urls
5
6
  PyYAML>=5.4
@@ -2,6 +2,7 @@
2
2
  # License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
4
 
5
+ __version__ = "4.3.0"
5
6
 
6
7
  # Maximum number of dependencies a single task can have
7
8
  # https://docs.taskcluster.net/reference/platform/taskcluster-queue/references/api#createTask
@@ -227,7 +227,9 @@ def get_decision_parameters(graph_config, options):
227
227
  # ..but can be overridden by the commit message: if it contains the special
228
228
  # string "DONTBUILD" and this is an on-push decision task, then use the
229
229
  # special 'nothing' target task method.
230
- if "DONTBUILD" in commit_message and options["tasks_for"] == "hg-push":
230
+ if "DONTBUILD" in commit_message and (
231
+ options["tasks_for"] in ("hg-push", "github-push")
232
+ ):
231
233
  parameters["target_tasks_method"] = "nothing"
232
234
 
233
235
  if options.get("optimize_target_tasks") is not None:
@@ -728,6 +728,82 @@ def test_action_callback(options):
728
728
  sys.exit(1)
729
729
 
730
730
 
731
+ @command(
732
+ "init", description="Initialize a new Taskgraph setup in a new or existing project."
733
+ )
734
+ @argument(
735
+ "-f",
736
+ "--force",
737
+ action="store_true",
738
+ default=False,
739
+ help="Bypass safety checks.",
740
+ )
741
+ @argument(
742
+ "--prompt",
743
+ dest="no_input",
744
+ action="store_false",
745
+ default=True,
746
+ help="Prompt for input rather than using default values (advanced).",
747
+ )
748
+ @argument(
749
+ "--template",
750
+ default="gh:taskcluster/taskgraph",
751
+ help=argparse.SUPPRESS, # used for testing
752
+ )
753
+ def init_taskgraph(options):
754
+ from cookiecutter.main import cookiecutter
755
+
756
+ import taskgraph
757
+ from taskgraph.util.vcs import get_repository
758
+
759
+ repo = get_repository(os.getcwd())
760
+ root = Path(repo.path)
761
+
762
+ # Clean up existing installations if necessary.
763
+ tc_yml = root.joinpath(".taskcluster.yml")
764
+ if tc_yml.is_file():
765
+ if not options["force"]:
766
+ proceed = input(
767
+ "A Taskcluster setup already exists in this repository, "
768
+ "would you like to overwrite it? [y/N]: "
769
+ ).lower()
770
+ while proceed not in ("y", "yes", "n", "no"):
771
+ proceed = input(f"Invalid option '{proceed}'! Try again: ")
772
+
773
+ if proceed[0] == "n":
774
+ sys.exit(1)
775
+
776
+ tc_yml.unlink()
777
+ tg_dir = root.joinpath("taskcluster")
778
+ if tg_dir.is_dir():
779
+ shutil.rmtree(tg_dir)
780
+
781
+ # Populate some defaults from the current repository.
782
+ context = {"project_name": root.name}
783
+
784
+ repo_url = repo.get_url()
785
+ if repo.tool == "git" and "github.com" in repo_url:
786
+ context["repo_host"] = "github"
787
+ elif repo.tool == "hg" and "hg.mozilla.org" in repo_url:
788
+ context["repo_host"] = "hgmo"
789
+ else:
790
+ raise RuntimeError(
791
+ "Repository not supported! Taskgraph currently only "
792
+ "supports repositories hosted on Github or hg.mozilla.org."
793
+ )
794
+
795
+ # Generate the project.
796
+ cookiecutter(
797
+ options["template"],
798
+ checkout=taskgraph.__version__,
799
+ directory="template",
800
+ extra_context=context,
801
+ no_input=options["no_input"],
802
+ output_dir=root.parent,
803
+ overwrite_if_exists=True,
804
+ )
805
+
806
+
731
807
  def create_parser():
732
808
  parser = argparse.ArgumentParser(description="Interact with taskgraph")
733
809
  subparsers = parser.add_subparsers()
@@ -374,7 +374,7 @@ def extract_archive(path, dest_dir, typ):
374
374
  elif typ == "zip":
375
375
  # unzip from stdin has wonky behavior. We don't use a pipe for it.
376
376
  ifh = open(os.devnull, "rb")
377
- args = ["unzip", "-o", str(path)]
377
+ args = ["unzip", "-q", "-o", str(path)]
378
378
  pipe_stdin = False
379
379
  else:
380
380
  raise ValueError("unknown archive format: %s" % path)
@@ -13,6 +13,7 @@ from pathlib import Path
13
13
  import pytest
14
14
 
15
15
  from taskgraph import decision
16
+ from taskgraph.util.vcs import GitRepository, HgRepository
16
17
  from taskgraph.util.yaml import load_yaml
17
18
 
18
19
  FAKE_GRAPH_CONFIG = {"product-dir": "browser", "taskgraph": {}}
@@ -91,6 +92,55 @@ class TestGetDecisionParameters(unittest.TestCase):
91
92
  params = decision.get_decision_parameters(FAKE_GRAPH_CONFIG, self.options)
92
93
  self.assertEqual(params["owner"], "ffxbld@noreply.mozilla.org")
93
94
 
95
+ @unittest.mock.patch.object(
96
+ GitRepository,
97
+ "get_commit_message",
98
+ unittest.mock.MagicMock(return_value="Add Foo"),
99
+ )
100
+ @unittest.mock.patch.object(
101
+ HgRepository,
102
+ "get_commit_message",
103
+ unittest.mock.MagicMock(return_value="Add Foo"),
104
+ )
105
+ def test_regular_commit_message_yields_default_target_tasks_method(self):
106
+ """
107
+ Ensures `target_tasks_method` is `default` when the commit message does not contain
108
+ `DONTBUILD`.
109
+ """
110
+ self.options["tasks_for"] = "github-push"
111
+ params = decision.get_decision_parameters(FAKE_GRAPH_CONFIG, self.options)
112
+ self.assertEqual(params["target_tasks_method"], "default")
113
+
114
+ self.options["tasks_for"] = "hg-push"
115
+ params = decision.get_decision_parameters(FAKE_GRAPH_CONFIG, self.options)
116
+ self.assertEqual(params["target_tasks_method"], "default")
117
+
118
+ @unittest.mock.patch.object(
119
+ GitRepository,
120
+ "get_commit_message",
121
+ unittest.mock.MagicMock(return_value="DONTBUILD"),
122
+ )
123
+ @unittest.mock.patch.object(
124
+ HgRepository,
125
+ "get_commit_message",
126
+ unittest.mock.MagicMock(return_value="DONTBUILD"),
127
+ )
128
+ def test_dontbuild_commit_message_yields_default_target_tasks_method(self):
129
+ """
130
+ Ensures `target_tasks_method` is `nothing` when the commit message contains `DONTBUILD`.
131
+ """
132
+ self.options["tasks_for"] = "github-release"
133
+ params = decision.get_decision_parameters(FAKE_GRAPH_CONFIG, self.options)
134
+ self.assertNotEqual(params["target_tasks_method"], "nothing")
135
+
136
+ self.options["tasks_for"] = "github-push"
137
+ params = decision.get_decision_parameters(FAKE_GRAPH_CONFIG, self.options)
138
+ self.assertEqual(params["target_tasks_method"], "nothing")
139
+
140
+ self.options["tasks_for"] = "hg-push"
141
+ params = decision.get_decision_parameters(FAKE_GRAPH_CONFIG, self.options)
142
+ self.assertEqual(params["target_tasks_method"], "nothing")
143
+
94
144
 
95
145
  @pytest.mark.parametrize(
96
146
  "candidate_base_ref, base_rev, expected_base_ref",
@@ -1,6 +1,10 @@
1
1
  # Any copyright is dedicated to the public domain.
2
2
  # http://creativecommons.org/publicdomain/zero/1.0/
3
3
 
4
+ import os
5
+ from pathlib import Path
6
+ from textwrap import dedent
7
+
4
8
  import pytest
5
9
 
6
10
  import taskgraph
@@ -9,10 +13,12 @@ from taskgraph.main import get_filtered_taskgraph
9
13
  from taskgraph.main import main as taskgraph_main
10
14
  from taskgraph.task import Task
11
15
  from taskgraph.taskgraph import TaskGraph
16
+ from taskgraph.util.vcs import GitRepository, HgRepository
17
+ from taskgraph.util.yaml import load_yaml
12
18
 
13
19
 
14
20
  @pytest.fixture
15
- def run_main(maketgg, monkeypatch):
21
+ def run_show_taskgraph(maketgg, monkeypatch):
16
22
  def inner(args, **kwargs):
17
23
  kwargs.setdefault("target_tasks", ["_fake-t-0", "_fake-t-1"])
18
24
  tgg = maketgg(**kwargs)
@@ -40,24 +46,24 @@ def run_main(maketgg, monkeypatch):
40
46
  ("morphed", ["_fake-t-0", "_fake-t-1"]),
41
47
  ),
42
48
  )
43
- def test_show_taskgraph(run_main, capsys, attr, expected):
44
- run_main([attr])
49
+ def test_show_taskgraph(run_show_taskgraph, capsys, attr, expected):
50
+ run_show_taskgraph([attr])
45
51
  out, err = capsys.readouterr()
46
52
  assert out.strip() == "\n".join(expected)
47
53
  assert "Dumping result" in err
48
54
 
49
55
 
50
- def test_tasks_regex(run_main, capsys):
51
- run_main(["full", "--tasks=_.*-t-1"])
56
+ def test_tasks_regex(run_show_taskgraph, capsys):
57
+ run_show_taskgraph(["full", "--tasks=_.*-t-1"])
52
58
  out, _ = capsys.readouterr()
53
59
  assert out.strip() == "_fake-t-1"
54
60
 
55
61
 
56
- def test_output_file(run_main, tmpdir):
62
+ def test_output_file(run_show_taskgraph, tmpdir):
57
63
  output_file = tmpdir.join("out.txt")
58
64
  assert not output_file.check()
59
65
 
60
- run_main(["full", f"--output-file={output_file.strpath}"])
66
+ run_show_taskgraph(["full", f"--output-file={output_file.strpath}"])
61
67
  assert output_file.check()
62
68
  assert output_file.read_text("utf-8").strip() == "\n".join(
63
69
  ["_fake-t-0", "_fake-t-1", "_fake-t-2"]
@@ -169,3 +175,62 @@ def test_get_filtered_taskgraph(regex, exclude, expected):
169
175
  graph = TaskGraph(tasks, Graph(set(tasks), {("a", "b", "dep")}))
170
176
  filtered = get_filtered_taskgraph(graph, regex, exclude)
171
177
  assert filtered.to_json() == expected
178
+
179
+
180
+ def test_init_taskgraph(mocker, tmp_path, project_root, repo_with_upstream):
181
+ repo, _ = repo_with_upstream
182
+
183
+ # Mock out upstream url to bypass the repo host check.
184
+ if repo.tool == "hg":
185
+ fake_url = "https://hg.mozilla.org/foo"
186
+ mocker.patch.object(HgRepository, "get_url").return_value = fake_url
187
+ else:
188
+ fake_url = "https://github.com/foo"
189
+ mocker.patch.object(GitRepository, "get_url").return_value = fake_url
190
+
191
+ # Point cookiecutter at temporary directories.
192
+ d = tmp_path / "cookiecutter"
193
+ d.mkdir()
194
+
195
+ config = d / "config.yml"
196
+ config.write_text(
197
+ dedent(
198
+ f"""
199
+ cookiecutters_dir: {d / 'cookiecutters'}
200
+ replay_dir: {d / 'replay'}
201
+ """
202
+ )
203
+ )
204
+ mocker.patch.dict("os.environ", {"COOKIECUTTER_CONFIG": str(config)})
205
+
206
+ repo_root = Path(repo.path)
207
+ oldcwd = Path.cwd()
208
+ try:
209
+ os.chdir(repo_root)
210
+ taskgraph_main(["init", "--template", str(project_root)])
211
+ finally:
212
+ os.chdir(oldcwd)
213
+
214
+ # Make assertions about the repository state.
215
+ name = repo_root.name
216
+ expected_files = [
217
+ ".taskcluster.yml",
218
+ "taskcluster/ci/config.yml",
219
+ "taskcluster/ci/docker-image/kind.yml",
220
+ "taskcluster/ci/hello/kind.yml",
221
+ f"taskcluster/{name}_taskgraph/transforms/hello.py",
222
+ ]
223
+ for f in expected_files:
224
+ assert (repo_root / f).is_file()
225
+
226
+ c = load_yaml(str(repo_root / "taskcluster" / "ci" / "config.yml"))
227
+ assert c["trust-domain"] == "mozilla"
228
+ assert c["taskgraph"]["cached-task-prefix"] == f"{c['trust-domain']}.v2.{name}"
229
+ assert c["taskgraph"]["repositories"] == {name: {"name": name}}
230
+
231
+ # Just assert we got the right .taskcluster.yml for the repo type
232
+ tc_yml = load_yaml(repo_root / ".taskcluster.yml")
233
+ if repo.tool == "hg":
234
+ assert "reporting" not in tc_yml
235
+ else:
236
+ assert tc_yml["reporting"] == "checks-v1"
@@ -26,9 +26,6 @@ from .mockedopen import MockedOpen
26
26
 
27
27
  project_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
28
28
 
29
- with open(os.path.join(project_dir, "version.txt")) as f:
30
- version = f.read().rstrip()
31
-
32
29
 
33
30
  class TestParameters(TestCase):
34
31
  vals = {
@@ -57,7 +54,7 @@ class TestParameters(TestCase):
57
54
  "repository_type": "hg",
58
55
  "target_tasks_method": "default",
59
56
  "tasks_for": "github-push",
60
- "version": version,
57
+ "version": taskgraph.__version__,
61
58
  }
62
59
 
63
60
  def test_Parameters_immutable(self):
@@ -2,9 +2,7 @@
2
2
  # License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
4
 
5
-
6
5
  import os
7
- import shutil
8
6
  import subprocess
9
7
  from textwrap import dedent
10
8
 
@@ -12,110 +10,7 @@ import pytest
12
10
 
13
11
  from taskgraph.util.vcs import HgRepository, Repository, get_repository
14
12
 
15
- _FORCE_COMMIT_DATE_TIME = "2019-11-04T10:03:58+00:00"
16
-
17
-
18
- @pytest.fixture(scope="package")
19
- def hg_repo(tmpdir_factory):
20
- tmpdir = tmpdir_factory.mktemp("hgrepo")
21
- repo_dir = _init_repo(tmpdir, "hg")
22
- with open(os.path.join(repo_dir, ".hg", "hgrc"), "a") as f:
23
- f.write(
24
- """[ui]
25
- username = Integration Tests <integration@tests.test>
26
- """
27
- )
28
-
29
- # hg sometimes errors out with "nothing changed" even though the commit succeeded
30
- subprocess.call(
31
- ["hg", "commit", "-m", "First commit", "--date", _FORCE_COMMIT_DATE_TIME],
32
- cwd=repo_dir,
33
- )
34
- yield repo_dir
35
-
36
-
37
- _GIT_DATE_ENV_VARS = ("GIT_AUTHOR_DATE", "GIT_COMMITTER_DATE")
38
-
39
-
40
- @pytest.fixture(scope="package")
41
- def git_repo(tmpdir_factory):
42
- env = _build_env_with_git_date_env_vars(_FORCE_COMMIT_DATE_TIME)
43
- tmpdir = tmpdir_factory.mktemp("gitrepo")
44
- repo_dir = _init_repo(tmpdir, "git")
45
-
46
- subprocess.check_output(
47
- ["git", "config", "user.email", "integration@tests.test"], cwd=repo_dir, env=env
48
- )
49
- subprocess.check_output(
50
- ["git", "config", "user.name", "Integration Tests"], cwd=repo_dir, env=env
51
- )
52
-
53
- # This is mostly for local dev
54
- # If gpg signing is on it will fail calculating the head ref
55
- subprocess.check_output(
56
- ["git", "config", "commit.gpgsign", "false"], cwd=repo_dir, env=env
57
- )
58
-
59
- subprocess.check_output(
60
- ["git", "commit", "-m", "First commit"], cwd=repo_dir, env=env
61
- )
62
-
63
- yield repo_dir
64
-
65
-
66
- def _build_env_with_git_date_env_vars(date_time_string):
67
- env = os.environ.copy()
68
- env.update({env_var: date_time_string for env_var in _GIT_DATE_ENV_VARS})
69
- return env
70
-
71
-
72
- def _init_repo(tmpdir, repo_type):
73
- repo_dir = os.path.join(tmpdir.strpath, repo_type)
74
- os.mkdir(repo_dir)
75
- first_file_path = tmpdir.join(repo_type, "first_file")
76
- first_file_path.write("first piece of data")
77
-
78
- subprocess.check_output([repo_type, "init"], cwd=repo_dir)
79
- subprocess.check_output([repo_type, "add", first_file_path.strpath], cwd=repo_dir)
80
-
81
- return repo_dir
82
-
83
-
84
- @pytest.fixture(params=("git", "hg"))
85
- def repo(request, hg_repo, git_repo, monkeypatch, tmpdir):
86
- """
87
- The repo fixture depends on the session-scoped git and hg repo fixtures, and
88
- copies the contents of the initialized repos to a temp folder
89
- """
90
- repodir = tmpdir.join(request.param)
91
- if request.param == "hg":
92
- monkeypatch.setenv("HGPLAIN", "1")
93
- shutil.copytree(hg_repo, repodir)
94
- return get_repository(repodir)
95
- shutil.copytree(git_repo, repodir)
96
- return get_repository(repodir)
97
-
98
-
99
- def _create_remote_repo(tmpdir, repo, remote_name, remote_path):
100
- if repo.tool == "hg":
101
- repo.run("phase", "--public", ".")
102
-
103
- shutil.copytree(repo.path, str(tmpdir / remote_path))
104
-
105
- if repo.tool == "git":
106
- repo.run("remote", "add", remote_name, f"{tmpdir}/{remote_path}")
107
- repo.run("fetch", remote_name)
108
- repo.run("branch", "--set-upstream-to", f"{remote_name}/master")
109
- if repo.tool == "hg":
110
- with open(os.path.join(repo.path, ".hg/hgrc"), "a") as f:
111
- f.write(f"[paths]\n{remote_name} = {tmpdir}/{remote_path}\n")
112
-
113
-
114
- @pytest.fixture
115
- def repo_with_remote(tmpdir, repo):
116
- remote_name = "upstream"
117
- _create_remote_repo(tmpdir, repo, remote_name, "remote_repo")
118
- return repo, remote_name
13
+ from .fixtures.vcs import create_remote_repo
119
14
 
120
15
 
121
16
  def test_get_repository(repo):
@@ -267,13 +162,13 @@ def test_remote_name(repo_with_remote):
267
162
  def test_all_remote_names(tmpdir, repo_with_remote):
268
163
  repo, remote_name = repo_with_remote
269
164
  assert repo.all_remote_names == [remote_name]
270
- _create_remote_repo(tmpdir, repo, "upstream2", "remote_path2")
165
+ create_remote_repo(tmpdir, repo, "upstream2", "remote_path2")
271
166
  assert repo.all_remote_names == [remote_name, "upstream2"]
272
167
 
273
168
 
274
169
  def test_remote_name_many_remotes(tmpdir, repo_with_remote):
275
170
  repo, _ = repo_with_remote
276
- _create_remote_repo(tmpdir, repo, "upstream2", "remote_path2")
171
+ create_remote_repo(tmpdir, repo, "upstream2", "remote_path2")
277
172
 
278
173
  if repo.tool == "git":
279
174
  assert repo.remote_name == "upstream2" # Branch is set to an upstream one
@@ -285,7 +180,7 @@ def test_remote_name_many_remotes(tmpdir, repo_with_remote):
285
180
  def test_remote_name_default_and_origin(tmpdir, repo_with_remote):
286
181
  repo, _ = repo_with_remote
287
182
  remote_name = "origin" if repo.tool == "git" else "default"
288
- _create_remote_repo(tmpdir, repo, remote_name, "remote_path2")
183
+ create_remote_repo(tmpdir, repo, remote_name, "remote_path2")
289
184
 
290
185
  if repo.tool == "git":
291
186
  repo.run("branch", "--unset-upstream")
@@ -435,33 +330,6 @@ def test_get_changed_files_two_revisions(repo):
435
330
  )
436
331
 
437
332
 
438
- @pytest.fixture
439
- def repo_with_upstream(tmpdir, repo):
440
- with open(os.path.join(repo.path, "second_file"), "w") as f:
441
- f.write("some data for the second file")
442
-
443
- repo.run("add", ".")
444
- repo.run("commit", "-m", "Add second_file")
445
-
446
- if repo.tool == "hg":
447
- repo.run("phase", "--public", ".")
448
-
449
- shutil.copytree(repo.path, str(tmpdir / "remoterepo"))
450
- upstream_location = None
451
-
452
- if repo.tool == "git":
453
- upstream_location = "upstream/master"
454
- repo.run("remote", "add", "upstream", f"{tmpdir}/remoterepo")
455
- repo.run("fetch", "upstream")
456
- repo.run("branch", "--set-upstream-to", upstream_location)
457
- if repo.tool == "hg":
458
- upstream_location = f"{tmpdir}/remoterepo"
459
- with open(os.path.join(repo.path, ".hg/hgrc"), "w") as f:
460
- f.write(f"[paths]\ndefault = {upstream_location}")
461
-
462
- return repo, upstream_location
463
-
464
-
465
333
  def test_workdir_outgoing(repo_with_upstream):
466
334
  repo, upstream_location = repo_with_upstream
467
335
 
@@ -1 +0,0 @@
1
- 4.2.0