Guest User

Untitled

a guest
Apr 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.65 KB | None | 0 0
  1. diff --git a/taskcluster/taskgraph/actions/release_promotion.py b/taskcluster/taskgraph/actions/release_promotion.py
  2. --- a/taskcluster/taskgraph/actions/release_promotion.py
  3. +++ b/taskcluster/taskgraph/actions/release_promotion.py
  4. @@ -16,76 +16,76 @@ from .util import (find_decision_task, f
  5. from taskgraph.util.taskcluster import get_artifact
  6. from taskgraph.util.partials import populate_release_history
  7. from taskgraph.util.partners import fix_partner_config
  8. from taskgraph.taskgraph import TaskGraph
  9. from taskgraph.decision import taskgraph_decision
  10. from taskgraph.parameters import Parameters
  11. from taskgraph.util.attributes import RELEASE_PROMOTION_PROJECTS
  12.  
  13. -RELEASE_PROMOTION_CONFIG = {
  14. - 'promote_fennec': {
  15. +RELEASE_PROMOTION_CONFIG = [
  16. + {'promote_fennec': {
  17. 'target_tasks_method': 'promote_fennec',
  18. 'product': 'fennec',
  19. - },
  20. - 'ship_fennec': {
  21. + }},
  22. + {'ship_fennec': {
  23. 'target_tasks_method': 'ship_fennec',
  24. 'product': 'fennec',
  25. - },
  26. - 'ship_fennec_rc': {
  27. + }},
  28. + {'ship_fennec_rc': {
  29. 'target_tasks_method': 'ship_fennec',
  30. 'product': 'fennec',
  31. 'release_type': 'rc',
  32. - },
  33. - 'promote_firefox': {
  34. + }},
  35. + {'promote_firefox': {
  36. 'target_tasks_method': 'promote_firefox',
  37. 'product': 'firefox',
  38. - },
  39. - 'push_firefox': {
  40. + }},
  41. + {'push_firefox': {
  42. 'target_tasks_method': 'push_firefox',
  43. 'product': 'firefox',
  44. - },
  45. - 'ship_firefox': {
  46. + }},
  47. + {'ship_firefox': {
  48. 'target_tasks_method': 'ship_firefox',
  49. 'product': 'firefox',
  50. - },
  51. - 'promote_firefox_rc': {
  52. + }},
  53. + {'promote_firefox_rc': {
  54. 'target_tasks_method': 'promote_firefox',
  55. 'product': 'firefox',
  56. 'release_type': 'rc',
  57. - },
  58. - 'ship_firefox_rc': {
  59. + }},
  60. + {'ship_firefox_rc': {
  61. 'target_tasks_method': 'ship_firefox',
  62. 'product': 'firefox',
  63. 'release_type': 'rc',
  64. - },
  65. - 'promote_firefox_partners': {
  66. + }},
  67. + {'promote_firefox_partners': {
  68. 'target_tasks_method': 'promote_firefox',
  69. 'product': 'firefox',
  70. 'rebuild_kinds': [
  71. 'release-partner-repack',
  72. 'release-partner-beetmover',
  73. 'release-partner-repack-chunking-dummy',
  74. 'release-partner-repackage-signing',
  75. 'release-partner-repackage',
  76. 'release-partner-signing',
  77. ],
  78. - },
  79. - 'promote_devedition': {
  80. + }},
  81. + {'promote_devedition': {
  82. 'target_tasks_method': 'promote_devedition',
  83. 'product': 'devedition',
  84. - },
  85. - 'push_devedition': {
  86. + }},
  87. + {'push_devedition': {
  88. 'target_tasks_method': 'push_devedition',
  89. 'product': 'devedition',
  90. - },
  91. - 'ship_devedition': {
  92. + }},
  93. + {'ship_devedition': {
  94. 'target_tasks_method': 'ship_devedition',
  95. 'product': 'devedition',
  96. - },
  97. + }},
  98. }
  99.  
  100. VERSION_BUMP_FLAVORS = (
  101. 'ship_fennec',
  102. 'ship_firefox',
  103. 'ship_devedition',
  104. )
  105.  
  106. @@ -144,17 +144,17 @@ def is_release_promotion_available(param
  107. 'description': ('Optional: the revision to promote. If specified, '
  108. 'and if neither `pushlog_id` nor `previous_graph_kinds` '
  109. 'is specified, find the `pushlog_id using the '
  110. 'revision.'),
  111. },
  112. 'release_promotion_flavor': {
  113. 'type': 'string',
  114. 'description': 'The flavor of release promotion to perform.',
  115. - 'enum': sorted(RELEASE_PROMOTION_CONFIG.keys()),
  116. + 'enum': RELEASE_PROMOTION_CONFIG.map(lambda x: x.keys()[0]),
  117. },
  118. 'rebuild_kinds': {
  119. 'type': 'array',
  120. 'description': ('Optional: an array of kinds to ignore from the previous '
  121. 'graph(s).'),
  122. 'items': {
  123. 'type': 'string',
  124. },
  125. @@ -257,17 +257,17 @@ def is_release_promotion_available(param
  126. 'description': ('Toggle for creating EME-free repacks'),
  127. },
  128. },
  129. "required": ['release_promotion_flavor', 'build_number'],
  130. }
  131. )
  132. def release_promotion_action(parameters, graph_config, input, task_group_id, task_id, task):
  133. release_promotion_flavor = input['release_promotion_flavor']
  134. - promotion_config = RELEASE_PROMOTION_CONFIG[release_promotion_flavor]
  135. + promotion_config = RELEASE_PROMOTION_CONFIG.filter(lambda x: x.keys()[0] == release_promotion_flavor)[0].values()[0]
  136. release_history = {}
  137. product = promotion_config['product']
  138.  
  139. next_version = str(input.get('next_version') or '')
  140. if release_promotion_flavor in VERSION_BUMP_FLAVORS:
  141. # We force str() the input, hence the 'None'
  142. if next_version in ['', 'None']:
  143. raise Exception(
  144. @@ -285,17 +285,17 @@ def release_promotion_action(parameters,
  145. )
  146. balrog_prefix = product.title()
  147. os.environ['PARTIAL_UPDATES'] = partial_updates
  148. release_history = populate_release_history(
  149. balrog_prefix, parameters['project'],
  150. partial_updates=input['partial_updates']
  151. )
  152.  
  153. - promotion_config = RELEASE_PROMOTION_CONFIG[release_promotion_flavor]
  154. + promotion_config = RELEASE_PROMOTION_CONFIG.filter(lambda x: x.keys()[0] == release_promotion_flavor)[0].values()[0]
  155.  
  156. target_tasks_method = promotion_config['target_tasks_method'].format(
  157. project=parameters['project']
  158. )
  159. rebuild_kinds = input.get(
  160. 'rebuild_kinds', promotion_config.get('rebuild_kinds', [])
  161. )
  162. do_not_optimize = input.get(
Add Comment
Please, Sign In to add comment