Bug 1530908 - Unify artifact builds setup between try config and try syntax. r=dustin
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 06 Mar 2019 22:48:28 +0000
changeset 520604 61dd01ed9002ad05dd35640fdbc770e03b7f7c76
parent 520603 ecc39e015e7a877c37212def591574a4531d11f1
child 520605 ad8315f518076b67332cf5639aede5836c0bab7a
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1530908
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1530908 - Unify artifact builds setup between try config and try syntax. r=dustin While try syntax is approaching its EOL, the fact that using it to do artifact builds does some things subtly differently from using try config is not helpful. Depends on D22055 Differential Revision: https://phabricator.services.mozilla.com/D21312
taskcluster/taskgraph/test/test_try_option_syntax.py
taskcluster/taskgraph/transforms/build.py
taskcluster/taskgraph/try_option_syntax.py
testing/mozharness/scripts/fx_desktop_build.py
--- a/taskcluster/taskgraph/test/test_try_option_syntax.py
+++ b/taskcluster/taskgraph/test/test_try_option_syntax.py
@@ -351,11 +351,17 @@ class TestTryOptionSyntax(unittest.TestC
         self.assertEqual(tos.tag, 'tagName')
 
     def test_no_retry(self):
         "--no-retry sets no_retry to true"
         parameters = {'try_options': parse_message('try: --no-retry')}
         tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
         self.assertTrue(tos.no_retry)
 
+    def test_artifact(self):
+        "--artifact sets artifact to true"
+        parameters = {'try_options': parse_message('try: --artifact')}
+        tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
+        self.assertTrue(tos.artifact)
+
 
 if __name__ == '__main__':
     main()
--- a/taskcluster/taskgraph/transforms/build.py
+++ b/taskcluster/taskgraph/transforms/build.py
@@ -136,15 +136,17 @@ def enable_full_crashsymbols(config, job
         yield job
 
 
 @transforms.add
 def use_artifact(config, jobs):
     if config.params['try_mode'] == 'try_task_config':
         use_artifact = config.params['try_task_config'] \
             .get('templates', {}).get('artifact', {}).get('enabled')
+    elif config.params['try_mode'] == 'try_option_syntax':
+        use_artifact = config.params['try_options'].get('artifact')
     else:
         use_artifact = False
     for job in jobs:
         if config.kind == 'build' and use_artifact:
             job['treeherder']['symbol'] += 'a'
             job['worker']['env']['USE_ARTIFACT'] = '1'
         yield job
--- a/taskcluster/taskgraph/try_option_syntax.py
+++ b/taskcluster/taskgraph/try_option_syntax.py
@@ -213,16 +213,17 @@ def parse_message(message):
                         type=int, default=1)
     parser.add_argument('--rebuild-raptor', dest='raptor_trigger_tests', action='store',
                         type=int, default=1)
     parser.add_argument('--setenv', dest='env', action='append')
     parser.add_argument('--geckoProfile', dest='profile', action='store_true')
     parser.add_argument('--tag', dest='tag', action='store', default=None)
     parser.add_argument('--no-retry', dest='no_retry', action='store_true')
     parser.add_argument('--include-nightly', dest='include_nightly', action='store_true')
+    parser.add_argument('--artifact', dest='artifact', action='store_true')
 
     # While we are transitioning from BB to TC, we want to push jobs to tc-worker
     # machines but not overload machines with every try push. Therefore, we add
     # this temporary option to be able to push jobs to tc-worker.
     parser.add_argument('-w', '--taskcluster-worker',
                         dest='taskcluster_worker', action='store_true', default=False)
 
     # In order to run test jobs multiple times
@@ -271,16 +272,17 @@ class TryOptionSyntax(object):
         self.interactive = False
         self.notifications = None
         self.talos_trigger_tests = 0
         self.raptor_trigger_tests = 0
         self.env = []
         self.profile = False
         self.tag = None
         self.no_retry = False
+        self.artifact = False
 
         options = parameters['try_options']
         if not options:
             return None
         self.jobs = self.parse_jobs(options['jobs'])
         self.build_types = self.parse_build_types(options['build_types'], full_task_graph)
         self.platforms = self.parse_platforms(options['platforms'], full_task_graph)
         self.unittests = self.parse_test_option(
@@ -291,16 +293,17 @@ class TryOptionSyntax(object):
         self.interactive = options['interactive']
         self.notifications = options['notifications']
         self.talos_trigger_tests = options['talos_trigger_tests']
         self.raptor_trigger_tests = options['raptor_trigger_tests']
         self.env = options['env']
         self.profile = options['profile']
         self.tag = options['tag']
         self.no_retry = options['no_retry']
+        self.artifact = options['artifact']
         self.include_nightly = options['include_nightly']
 
     def parse_jobs(self, jobs_arg):
         if not jobs_arg or jobs_arg == ['none']:
             return []  # default is `-j none`
         if jobs_arg == ['all']:
             return None
         expanded = []
@@ -630,9 +633,10 @@ class TryOptionSyntax(object):
             "interactive: " + str(self.interactive),
             "notifications: " + str(self.notifications),
             "talos_trigger_tests: " + str(self.talos_trigger_tests),
             "raptor_trigger_tests: " + str(self.raptor_trigger_tests),
             "env: " + str(self.env),
             "profile: " + str(self.profile),
             "tag: " + str(self.tag),
             "no_retry: " + str(self.no_retry),
+            "artifact: " + str(self.artifact),
         ])
--- a/testing/mozharness/scripts/fx_desktop_build.py
+++ b/testing/mozharness/scripts/fx_desktop_build.py
@@ -84,17 +84,17 @@ class FxDesktopBuild(BuildScript, TryToo
             'ConfigClass': BuildingConfig,
         }
         super(FxDesktopBuild, self).__init__(**buildscript_kwargs)
 
     def _pre_config_lock(self, rw_config):
         """grab properties if we are running this in automation"""
         super(FxDesktopBuild, self)._pre_config_lock(rw_config)
         c = self.config
-        if self.try_message_has_flag('artifact') or os.environ.get('USE_ARTIFACT'):
+        if os.environ.get('USE_ARTIFACT'):
             # Not all jobs that look like builds can be made into artifact
             # builds (for example, various SAN builds will not make sense as
             # artifact builds).  By default, only a vanilla debug or opt build
             # will be replaced by an artifact build.
             #
             # In addition, some jobs want to specify their artifact equivalent.
             # Use `artifact_flag_build_variant_in_try` to specify that variant.
             #