| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |