Skip to content

Commit 5802870

Browse files
authored
Merge pull request #854 from nathanchance/handle-internal-errors-better
Handle internal errors better
2 parents 1919be0 + 8d0bb1f commit 5802870

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"__comment_owner": "internal continuous integration errors",
5+
"owner": "internal",
6+
"pattern": [
7+
{
8+
"__comment_regexp1": "[CI ERROR] Build is not finished on TuxSuite's side!",
9+
"regexp": "^\\[CI (WARNING|ERROR)\\]\\s+(.*)$",
10+
"severity": 1,
11+
"message": 2
12+
}
13+
]
14+
}
15+
]
16+
}

scripts/check-logs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ def verify_build():
5858
retries = 0
5959
max_retries = 9
6060
while retries < max_retries:
61-
if build["tuxbuild_status"] == "complete":
61+
# build never started
62+
if (build_status := build['tuxbuild_status']) == 'error':
63+
print_red(f"msg from tuxsuite: {build['status_message']}")
64+
sys.exit(1)
65+
# build is finished
66+
elif build_status == "complete":
6267
break
6368

6469
if retries:

utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,12 @@ def update_repository_variable(
290290

291291

292292
def print_red(msg):
293-
print(f"\033[91m{msg}\033[0m", file=sys.stderr)
293+
print(f"\033[91m[CI ERROR] {msg}\033[0m", file=sys.stderr)
294294
sys.stderr.flush()
295295

296296

297297
def print_yellow(msg):
298-
print(f"\033[93m{msg}\033[0m", file=sys.stdout)
298+
print(f"\033[93m[CI WARNING] {msg}\033[0m", file=sys.stdout)
299299
sys.stdout.flush()
300300

301301

0 commit comments

Comments
 (0)