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

Side by Side Diff: recipe_engine/run.py

Issue 2127353003: Include "recipe_result" (None) on StepFailure (Closed) Base URL: https://github.com/luci/recipes-py.git@master
Patch Set: trybots Created 4 years, 5 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
« no previous file with comments | « no previous file | recipe_modules/generator_script/example.expected/always_run.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 try: 412 try:
413 recipe_result = recipe_script.run(api, api._engine.properties) 413 recipe_result = recipe_script.run(api, api._engine.properties)
414 result = { 414 result = {
415 "recipe_result": recipe_result, 415 "recipe_result": recipe_result,
416 "status_code": 0 416 "status_code": 0
417 } 417 }
418 finally: 418 finally:
419 self._close_to_level(0) 419 self._close_to_level(0)
420 except recipe_api.StepFailure as f: 420 except recipe_api.StepFailure as f:
421 result = { 421 result = {
422 # Include "recipe_result" so it doesn't get marked as infra failure.
423 "recipe_result": None,
422 "reason": f.reason, 424 "reason": f.reason,
423 "status_code": f.retcode or 1 425 "status_code": f.retcode or 1
424 } 426 }
425 except types.StepDataAttributeError as ex: 427 except types.StepDataAttributeError as ex:
426 result = { 428 result = {
427 "reason": "Invalid Step Data Access: %r" % ex, 429 "reason": "Invalid Step Data Access: %r" % ex,
428 "traceback": traceback.format_exc().splitlines(), 430 "traceback": traceback.format_exc().splitlines(),
429 "status_code": -1 431 "status_code": -1
430 } 432 }
431 433
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 results.append( 489 results.append(
488 loader._invoke_with_properties( 490 loader._invoke_with_properties(
489 run_recipe, properties, recipe_script.PROPERTIES, 491 run_recipe, properties, recipe_script.PROPERTIES,
490 properties.keys())) 492 properties.keys()))
491 except TypeError as e: 493 except TypeError as e:
492 raise TypeError( 494 raise TypeError(
493 "Got %r while trying to call recipe %s with properties %r" % ( 495 "Got %r while trying to call recipe %s with properties %r" % (
494 e, recipe, properties)) 496 e, recipe, properties))
495 497
496 return results 498 return results
OLDNEW
« no previous file with comments | « no previous file | recipe_modules/generator_script/example.expected/always_run.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698