Skip to content

Commit 8d0bb1f

Browse files
committed
Print internal errors using GitHub problem matchers
Internal errors (explanations of known problematic cases or an unexpected result) should be printed more clearly so that triaging can go quicker. Add a tag to print_red() and print_yellow() so that a problem matcher can print them automatically, making it clear what happened with the build. Signed-off-by: Nathan Chancellor <[email protected]>
1 parent 1775eb2 commit 8d0bb1f

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
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+
}

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)