fix: gitea controller
runner nix smoke / nix label and flake smoke (push) Canceled after 0s
runner ubuntu smoke / ubuntu-latest label smoke (push) Canceled after 0s

This commit is contained in:
2026-11-03 15:17:38 +00:00
parent 2093f17fa5
commit c6a504c951
9 changed files with 1080 additions and 34 deletions
+18 -3
View File
@@ -321,6 +321,8 @@ gcr_handle_webhook() {
conclusion="$(printf '%s' "$gcr_body" | jq -r '.workflow_job.conclusion // ""')"
repo="$(printf '%s' "$gcr_body" | jq -r '.repository.full_name // ""')"
labels_json="$(printf '%s' "$gcr_body" | jq -c '.workflow_job.labels // []')"
runner_id="$(printf '%s' "$gcr_body" | jq -r '.workflow_job.runner_id // ""')"
runner_name="$(printf '%s' "$gcr_body" | jq -r '.workflow_job.runner_name // ""')"
[ -n "$action" ] && [ -n "$repo" ] \
|| { gcr_respond 400 "malformed payload"; exit 0; }
@@ -336,12 +338,25 @@ gcr_handle_webhook() {
gcr_log info --ns=alloc "queued job=$job_id repo=$repo code=$RESPONSE_CODE $RESPONSE_BODY"
;;
in_progress)
gcr_mark_in_progress "$job_id" "$attempt" "$repo"
case "$runner_id" in
''|0|*[!0-9]*) gcr_respond 400 "malformed runner identity"; exit 0 ;;
esac
if ! gcr_apply_actual_job "$repo" "$runner_id" "$runner_name" \
"$job_id" "$attempt" vm_active webhook; then
gcr_log warn --ns=alloc \
"unresolved in-progress assignment job=$job_id repo=$repo runner_id=$runner_id"
fi
RESPONSE_CODE=204
;;
completed)
gcr_deallocate "$job_id" "$attempt" \
"completed:${conclusion:-unknown}" "$repo"
case "$runner_id" in
''|0|*[!0-9]*) gcr_respond 400 "malformed runner identity"; exit 0 ;;
esac
if ! gcr_apply_actual_job "$repo" "$runner_id" "$runner_name" \
"$job_id" "$attempt" "completed:${conclusion:-unknown}" webhook; then
gcr_log warn --ns=alloc \
"unresolved terminal assignment job=$job_id repo=$repo runner_id=$runner_id"
fi
RESPONSE_CODE=204
;;
*)