Skip to content

Commit a3539b4

Browse files
committed
Prevent override the autoinst-log context within handle_unreachable
`handle_unreachable` can override the log file passed to the function. This should not allowed because when the `handle_unreviewed` function is reach will run with incorrect logs. Add also some debug messages in other scripts to easy tracking of issues on openqa-gru, because we dont have clear view of the flow https://progress.opensuse.org/issues/166772 Signed-off-by: ybonatakis <[email protected]> Signed-off-by: Ioannis Bonatakis <[email protected]>
1 parent 867408e commit a3539b4

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

openqa-investigate

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ main() {
387387
client_call=("$client_prefix" "${client_call[@]}")
388388
fi
389389
set -u
390+
echo "investigate $id"
390391
clone_call="${clone_call:-"$client_prefix openqa-clone-job --json-output --skip-chained-deps --max-depth 0 --parental-inheritance --within-instance"}"
391392
investigate "$@"
392393
}

openqa-label-known-issues

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ echoerr() { echo "$@" >&2; }
3535

3636
handle_unreachable() {
3737
local testurl=$1
38-
local out=$2
38+
local out
39+
out=$(cat "$2")
3940

4041
if ! curl "${curl_args[@]}" -s --head "$testurl" -o /dev/null; then
4142
# the page might be gone, try the scheme+host we configured (might be different one though)
@@ -51,14 +52,15 @@ handle_unreachable() {
5152
return 1
5253
fi
5354
# resorting to downloading the job details page instead of the
54-
# log, overwrites $out
55+
# log
5556
if ! curl "${curl_args[@]}" -s "$testurl" -o "$out"; then
5657
echoerr "'$testurl' can be reached but not downloaded, bailing out"
5758
curl "${curl_args[@]}" "$testurl"
5859
exit 2
5960
fi
6061

6162
if hxnormalize -x "$out" | hxselect -s '\n' -c '.links_a .resborder' | grep -qPzo '(?s)Gru job failed.*connection error.*Inactivity timeout'; then
63+
echo "POST jobs/${id}/comments"
6264
"${client_call[@]}" -X POST jobs/"$id"/comments text='poo#62456 test incompletes after failing in GRU download task on "Inactivity timeout" with no logs'
6365
"${client_call[@]}" -X POST jobs/"$id"/restart
6466
return 1

openqa-label-known-issues-and-investigate-hook

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ hook() {
4444
result="$(echo "$job_data" | runjq -r '.job.result')" || return $?
4545
[[ "$state" != "done" ]] && return
4646
if [[ "$result" != passed ]]; then
47+
echo "running $0 against $url"
4748
label "$url" | investigate-and-bisect
4849
else
4950
echo "$url" | investigate-and-bisect

0 commit comments

Comments
 (0)