Skip to content
Permalink
Browse files

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

--HG--
extra : moz-landing-system : lando
  • Loading branch information...
glandium committed Mar 6, 2019
1 parent dae7648 commit ac94b1c5153bd302d056369f081bcbd20777c6f1
@@ -356,6 +356,12 @@ def test_no_retry(self):
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()
@@ -141,6 +141,8 @@ 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:
@@ -218,6 +218,7 @@ def parse_message(message):
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
@@ -276,6 +277,7 @@ def __init__(self, parameters, full_task_graph, graph_config):
self.profile = False
self.tag = None
self.no_retry = False
self.artifact = False

options = parameters['try_options']
if not options:
@@ -296,6 +298,7 @@ def __init__(self, parameters, full_task_graph, graph_config):
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):
@@ -635,4 +638,5 @@ def none_for_all(list):
"profile: " + str(self.profile),
"tag: " + str(self.tag),
"no_retry: " + str(self.no_retry),
"artifact: " + str(self.artifact),
])
@@ -89,7 +89,7 @@ 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

0 comments on commit ac94b1c

Please sign in to comment.
You can’t perform that action at this time.