Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: recipe_engine/run.py

Issue 2332833003: Add better documentation, trigger namedtuple. (Closed)
Patch Set: More cleanups. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2016 The LUCI Authors. All rights reserved. 1 # Copyright 2016 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """Entry point for fully-annotated builds. 5 """Entry point for fully-annotated builds.
6 6
7 This script is part of the effort to move all builds to annotator-based 7 This script is part of the effort to move all builds to annotator-based
8 systems. Any builder configured to use the AnnotatorFactory.BaseFactory() 8 systems. Any builder configured to use the AnnotatorFactory.BaseFactory()
9 found in scripts/master/factory/annotator_factory.py executes a single 9 found in scripts/master/factory/annotator_factory.py executes a single
10 AddAnnotatedScript step. That step (found in annotator_commands.py) calls 10 AddAnnotatedScript step. That step (found in annotator_commands.py) calls
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 def run_step(self, step_dict): 359 def run_step(self, step_dict):
360 """ 360 """
361 Runs a step. 361 Runs a step.
362 362
363 Args: 363 Args:
364 step_dict (dict): A step dictionary to run. 364 step_dict (dict): A step dictionary to run.
365 365
366 Returns: 366 Returns:
367 A StepData object containing the result of running the step. 367 A StepData object containing the result of running the step.
368 """ 368 """
369 step_config = recipe_api._make_step_config(**step_dict) 369 step_config = recipe_api.StepConfig.create(**step_dict)
370 with util.raises((recipe_api.StepFailure, OSError), 370 with util.raises((recipe_api.StepFailure, OSError),
371 self._step_runner.stream_engine): 371 self._step_runner.stream_engine):
372 step_result = None 372 step_result = None
373 373
374 self._close_through_level(step_config.nest_level) 374 self._close_through_level(step_config.nest_level)
375 375
376 open_step = self._step_runner.open_step(step_config) 376 open_step = self._step_runner.open_step(step_config)
377 self._step_stack.append(self.ActiveStep( 377 self._step_stack.append(self.ActiveStep(
378 config=step_config, 378 config=step_config,
379 step_result=None, 379 step_result=None,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 results.append( 488 results.append(
489 loader._invoke_with_properties( 489 loader._invoke_with_properties(
490 run_recipe, properties, recipe_script.PROPERTIES, 490 run_recipe, properties, recipe_script.PROPERTIES,
491 properties.keys())) 491 properties.keys()))
492 except TypeError as e: 492 except TypeError as e:
493 raise TypeError( 493 raise TypeError(
494 "Got %r while trying to call recipe %s with properties %r" % ( 494 "Got %r while trying to call recipe %s with properties %r" % (
495 e, recipe, properties)) 495 e, recipe, properties))
496 496
497 return results 497 return results
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698