Bug 1252003 - Add "publish to balrog" builder r=jlund
authorRail Aliiev <rail@mozilla.com>
Mon, 04 Jul 2016 21:35:45 -0400
changeset 6891 0621d1e393dd8c345b19a3604c8e728f27eecc3c
parent 6890 0a9b2d8b7efbd5d8ca134127edb979ef3668f45f
child 6892 a7e91263a4f13af9333866af90f612f7d1cc8643
push id5138
push userraliiev@mozilla.com
push dateTue, 05 Jul 2016 17:02:32 +0000
reviewersjlund
bugs1252003
Bug 1252003 - Add "publish to balrog" builder r=jlund MozReview-Commit-ID: JNV8fNTBzXg
buildfarm/release/release-runner.py
buildfarm/release/releasetasks_graph_gen.py
lib/python/kickoff/__init__.py
--- a/buildfarm/release/release-runner.py
+++ b/buildfarm/release/release-runner.py
@@ -357,17 +357,16 @@ def main(options):
     # This is not elegant but it should do the job for now
     candidate_release = is_candidate_release(release_channels)
     if candidate_release:
         postrelease_enabled = False
         postrelease_bouncer_aliases_enabled = False
         final_verify_channels = [
             c for c in release_channels if c not in branchConfig.get('mirror_requiring_channels', [])
         ]
-        # TODO - use publish_to_balrog_channels once releasetasks publishes to balrog
         publish_to_balrog_channels = [
             c for c in release_channels if c not in branchConfig.get('mirror_requiring_channels', [])
         ]
         push_to_releases_enabled = False
     else:
         postrelease_enabled = branchConfig['postrelease_version_bump_enabled']
         postrelease_bouncer_aliases_enabled = branchConfig['postrelease_bouncer_aliases_enabled']
         final_verify_channels = release_channels
@@ -434,16 +433,17 @@ def main(options):
                 "tuxedo_server_url": branchConfig['tuxedoServerUrl'],
                 "postrelease_version_bump_enabled": postrelease_enabled,
                 "push_to_releases_enabled": push_to_releases_enabled,
                 "push_to_releases_automatic": branchConfig['push_to_releases_automatic'],
                 "beetmover_candidates_bucket": branchConfig["beetmover_buckets"][release["product"]],
                 "partner_repacks_platforms": branchConfig.get("partner_repacks_platforms", []),
                 "l10n_changesets": l10n_changesets,
                 "extra_balrog_submitter_params": extra_balrog_submitter_params,
+                "publish_to_balrog_channels": publish_to_balrog_channels,
             }
 
             validate_graph_kwargs(queue, gpg_key_path, **kwargs)
             graph = make_task_graph_strict_kwargs(**kwargs)
             rr.update_status(release, "Submitting task graph")
             log.info("Task graph generated!")
             import pprint
             log.debug(pprint.pformat(graph, indent=4, width=160))
--- a/buildfarm/release/releasetasks_graph_gen.py
+++ b/buildfarm/release/releasetasks_graph_gen.py
@@ -41,17 +41,17 @@ def main(release_runner_config, release_
         "balrog_password": release_config['balrog_password'],
         "beetmover_aws_access_key_id": release_config['beetmover_aws_access_key_id'],
         "beetmover_aws_secret_access_key": release_config['beetmover_aws_secret_access_key'],
         "signing_class": "release-signing",  # TODO: stagin specific, make them configurable
 
         # ship-it items
         "version": release_config["version"],
         "revision": release_config["mozilla_revision"],
-        "mozharness_changeset": release_config["mozharness_revision"] or release_config["mozilla_revision"],
+        "mozharness_changeset": release_config["mozharness_changeset"] or release_config["mozilla_revision"],
         "buildNumber": release_config["build_number"],
         "l10n_changesets": release_config["l10n_changesets"],
 
         # was branchConfig items
         "funsize_balrog_api_root": release_config["funsize_balrog_api_root"],
         "balrog_api_root": release_config["balrog_api_root"],
         "build_tools_repo_path": release_config['build_tools_repo_path'],
         "tuxedo_server_url": release_config['tuxedo_server_url'],
@@ -95,17 +95,18 @@ def main(release_runner_config, release_
             l10n_changesets=release_config["l10n_changesets"]
         ),
         "en_US_config": get_en_US_config(
             index=index, product=release_config["product"],
             branch=release_config["branch"],
             revision=release_config["mozilla_revision"],
             platforms=release_config['platforms']
         ),
-        "extra_balrog_submitter_params": release_config['extra_balrog_submitter_params']
+        "extra_balrog_submitter_params": release_config['extra_balrog_submitter_params'],
+        "publish_to_balrog_channels": release_config["publish_to_balrog_channels"],
     }
 
     graph = make_task_graph_strict_kwargs(**kwargs)
     log.info("Submitting task graph")
     import pprint
     log.info(pprint.pformat(graph, indent=4, width=160))
     if not options.dry_run:
         print scheduler.createTaskGraph(graph_id, graph)
@@ -114,34 +115,33 @@ def main(release_runner_config, release_
 def get_items_from_common_tc_task(common_task_id, tc_config):
     tc_task_items = {}
     queue = Queue(tc_config)
     task = queue.task(common_task_id)
     tc_task_items["version"] = task["extra"]["build_props"]["version"]
     tc_task_items["build_number"] = task["extra"]["build_props"]["build_number"]
     tc_task_items["mozilla_revision"] = task["extra"]["build_props"]["revision"]
     tc_task_items["partials"] = task["extra"]["build_props"]["partials"]
+    tc_task_items["mozharness_changeset"] = task["extra"]["build_props"]["mozharness_changeset"]
     return tc_task_items
 
 
 def get_unique_release_items(options, tc_config):
     unique_items = {}
 
     if options.common_task_id:
         # sometimes, we make a release based on a previous release. e.g. a graph that represents
         # part 2 of a Firefox Release Candidate release
-        # TODO extract mozharness_revision, and l10n_changesets from common taskgroup
         unique_items.update(get_items_from_common_tc_task(options.common_task_id, tc_config))
     else:
         unique_items['version'] = options.version
         unique_items['build_number'] = options.build_number
         unique_items['mozilla_revision'] = options.mozilla_revision
         unique_items['partials'] = options.partials
 
-    unique_items['mozharness_revision'] = options.mozharness_revision
     # TODO have ability to pass l10n_changesets whether based on previous release or new one
     unique_items["l10n_changesets"] = {}
 
     return unique_items
 
 
 def get_release_items_from_runner_config(release_runner_ini):
     ini_items = {}
@@ -168,18 +168,16 @@ if __name__ == '__main__':
     parser.add_option('--branch-and-product-config', dest='branch_and_product_config',
                       help='config items specific to certain product and branch')
     parser.add_option('--version', dest='version', help='full version of release, e.g. 46.0b1')
     parser.add_option('--build-number', dest='build_number', help='build number of release')
     parser.add_option('--partials', type="string", dest='partials',
                       help='list of partials for the release')
     parser.add_option('--mozilla-revision', dest='mozilla_revision',
                       help='gecko revision to build ff from')
-    parser.add_option('--mozharness-revision', dest='mozharness_revision',
-                      help='gecko revision for mozharness')
     parser.add_option('--common-task-id', dest='common_task_id',
                       help='a task id of a task that shares the same release info')
     parser.add_option('--dry-run', dest='dry_run', action='store_true', default=False,
                       help="render the task graph from yaml tmpl but don't submit to taskcluster")
 
     options = parser.parse_args()[0]
 
     if not options.release_runner_ini:
--- a/lib/python/kickoff/__init__.py
+++ b/lib/python/kickoff/__init__.py
@@ -240,17 +240,17 @@ def make_task_graph_strict_kwargs(appVer
                                   l10n_changesets, mozharness_changeset, next_version,
                                   partial_updates, partner_repacks_platforms,
                                   postrelease_bouncer_aliases_enabled, uptake_monitoring_enabled,
                                   postrelease_version_bump_enabled,
                                   product, public_key, push_to_candidates_enabled,
                                   push_to_releases_automatic, push_to_releases_enabled, release_channels,
                                   repo_path, revision, signing_class, signing_pvt_key, source_enabled,
                                   tuxedo_server_url, update_verify_enabled, updates_builder_enabled,
-                                  updates_enabled, verifyConfigs, version):
+                                  updates_enabled, verifyConfigs, version, publish_to_balrog_channels):
     """simple wrapper that sanitizes whatever calls make_task_graph uses universally known kwargs"""
 
     kwargs = dict(
         appVersion=appVersion,
         balrog_api_root=balrog_api_root,
         balrog_password=balrog_password,
         balrog_username=balrog_username,
         beetmover_aws_access_key_id=beetmover_aws_access_key_id,
@@ -286,17 +286,18 @@ def make_task_graph_strict_kwargs(appVer
         signing_class=signing_class,
         signing_pvt_key=signing_pvt_key,
         source_enabled=source_enabled,
         tuxedo_server_url=tuxedo_server_url,
         update_verify_enabled=update_verify_enabled,
         updates_builder_enabled=updates_builder_enabled,
         updates_enabled=updates_enabled,
         verifyConfigs=verifyConfigs,
-        version=version
+        version=version,
+        publish_to_balrog_channels=publish_to_balrog_channels,
     )
     if extra_balrog_submitter_params:
         kwargs["extra_balrog_submitter_params"] = extra_balrog_submitter_params
 
     # don't import releasetasks until required within function impl to avoid global failures
     # during nosetests
     from releasetasks import make_task_graph
     return make_task_graph(**kwargs)