Commit 16d2ae8c authored by Paweł Hajdan, Jr's avatar Paweł Hajdan, Jr Committed by Commit Bot

bot_update: fix regression with swallowed exception

This was regressed in https://chromium-review.googlesource.com/475950

Downstream regression test added in https://chromium-review.googlesource.com/c/508697/

Bug: 723572
Change-Id: I44dbaf9e4996388b898359141db879bd0a1023d9
Reviewed-on: https://chromium-review.googlesource.com/508790
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: 's avatarDaniel Jacques <dnj@chromium.org>
Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: 's avatarDirk Pranke <dpranke@chromium.org>
parent aafff1fa
......@@ -303,6 +303,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
if patch_body:
e.result.presentation.logs['patch error'] = (
patch_body.splitlines())
raise e
# bot_update actually just sets root to be the folder name of the
# first solution.
......
......@@ -90,92 +90,10 @@
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]",
"--patch_root",
"src",
"--revision_mapping_file",
"{\"got_cr_revision\": \"src\", \"got_revision\": \"src\"}",
"--git-cache-dir",
"[GIT_CACHE]",
"--rietveld_server",
"https://rietveld.example.com/",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9"
],
"env": {
"GIT_HTTP_LOW_SPEED_LIMIT": "1000",
"GIT_HTTP_LOW_SPEED_TIME": "300",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"infra_step": true,
"name": "bot_update (without patch)",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"failed_patch_body\": \"Downloading patch...\\nApplying the patch...\\nPatch: foo/bar.py\\nIndex: foo/bar.py\\ndiff --git a/foo/bar.py b/foo/bar.py\\nindex HASH..HASH MODE\\n--- a/foo/bar.py\\n+++ b/foo/bar.py\\ncontext\\n+something\\n-something\\nmore context\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"manifest\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"repository\": \"https://fake.org/src.git\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_apply_return_code\": 1, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"PATCH_FAILURE\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"import sys; sys.exit(1)"
],
"name": "Patch failure (2)",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_TEXT@See attached log. Try rebasing?@@@",
"@@@STEP_LOG_LINE@patch error@Downloading patch...@@@",
"@@@STEP_LOG_LINE@patch error@Applying the patch...@@@",
"@@@STEP_LOG_LINE@patch error@Patch: foo/bar.py@@@",
"@@@STEP_LOG_LINE@patch error@Index: foo/bar.py@@@",
"@@@STEP_LOG_LINE@patch error@diff --git a/foo/bar.py b/foo/bar.py@@@",
"@@@STEP_LOG_LINE@patch error@index HASH..HASH MODE@@@",
"@@@STEP_LOG_LINE@patch error@--- a/foo/bar.py@@@",
"@@@STEP_LOG_LINE@patch error@+++ b/foo/bar.py@@@",
"@@@STEP_LOG_LINE@patch error@context@@@",
"@@@STEP_LOG_LINE@patch error@+something@@@",
"@@@STEP_LOG_LINE@patch error@-something@@@",
"@@@STEP_LOG_LINE@patch error@more context@@@",
"@@@STEP_LOG_END@patch error@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"name": "$result",
"reason": "Step('Patch failure') failed with return_code 1",
"recipe_result": null,
"status_code": 0
"status_code": 1
}
]
\ No newline at end of file
......@@ -90,92 +90,10 @@
"@@@STEP_EXCEPTION@@@"
]
},
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]",
"--patch_root",
"src",
"--revision_mapping_file",
"{\"got_cr_revision\": \"src\", \"got_revision\": \"src\"}",
"--git-cache-dir",
"[GIT_CACHE]",
"--rietveld_server",
"https://rietveld.example.com/",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9"
],
"env": {
"GIT_HTTP_LOW_SPEED_LIMIT": "1000",
"GIT_HTTP_LOW_SPEED_TIME": "300",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"infra_step": true,
"name": "bot_update (without patch)",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"failed_patch_body\": \"Downloading patch...\\nApplying the patch...\\nPatch: foo/bar.py\\nIndex: foo/bar.py\\ndiff --git a/foo/bar.py b/foo/bar.py\\nindex HASH..HASH MODE\\n--- a/foo/bar.py\\n+++ b/foo/bar.py\\ncontext\\n+something\\n-something\\nmore context\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"manifest\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"repository\": \"https://fake.org/src.git\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_apply_return_code\": 3, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@"
]
},
{
"cmd": [
"python",
"-u",
"import sys; sys.exit(1)"
],
"infra_step": true,
"name": "Patch failure (2)",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_TEXT@Git reported a download failure@@@",
"@@@STEP_LOG_LINE@patch error@Downloading patch...@@@",
"@@@STEP_LOG_LINE@patch error@Applying the patch...@@@",
"@@@STEP_LOG_LINE@patch error@Patch: foo/bar.py@@@",
"@@@STEP_LOG_LINE@patch error@Index: foo/bar.py@@@",
"@@@STEP_LOG_LINE@patch error@diff --git a/foo/bar.py b/foo/bar.py@@@",
"@@@STEP_LOG_LINE@patch error@index HASH..HASH MODE@@@",
"@@@STEP_LOG_LINE@patch error@--- a/foo/bar.py@@@",
"@@@STEP_LOG_LINE@patch error@+++ b/foo/bar.py@@@",
"@@@STEP_LOG_LINE@patch error@context@@@",
"@@@STEP_LOG_LINE@patch error@+something@@@",
"@@@STEP_LOG_LINE@patch error@-something@@@",
"@@@STEP_LOG_LINE@patch error@more context@@@",
"@@@STEP_LOG_END@patch error@@@",
"@@@STEP_EXCEPTION@@@"
]
},
{
"name": "$result",
"reason": "Infra Failure: Step('Patch failure') returned 1",
"recipe_result": null,
"status_code": 0
"status_code": 1
}
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment