Fix CI, again #527

Closed
opened 2026-06-07 11:25:12 +00:00 by guettli · 1 comment
guettli commented 2026-06-07 11:25:12 +00:00 (Migrated from codeberg.org)

Fix CI

https://codeberg.org/guettli/sharedinbox/actions/runs/2173/jobs/0/attempt/1



Agentloop runs

# Started (UTC) Ended (UTC) Status Tokens in Tokens out
1 2026-06-07 11:38:21 2026-06-07 12:03:17 success 97 64 497
Fix CI https://codeberg.org/guettli/sharedinbox/actions/runs/2173/jobs/0/attempt/1 --- --- <!-- agentloop-summary --> **Agentloop runs** | # | Started (UTC) | Ended (UTC) | Status | Tokens in | Tokens out | |---|---------------------|---------------------|---------|-----------|------------| | 1 | 2026-06-07 11:38:21 | 2026-06-07 12:03:17 | success | 97 | 64 497 |
guettlibot commented 2026-06-07 12:03:17 +00:00 (Migrated from codeberg.org)

Auto-merge is enabled (squash, delete branch on merge). PR will merge automatically once CI checks pass.

Summary

PR opened: https://codeberg.org/guettli/sharedinbox/pulls/529 — auto-merge enabled.

Root cause of #527

The Detect Changed Files job in deploy.yml has been failing every hour since run #2165. Two compounding bugs:

  1. #522/#524 wait-time fix was incomplete. Switched the endpoint from /actions/tasks/actions/runs but didn't update the field lookups. Runs expose index_in_repo + created; tasks expose run_number + created_at. So the script always silently printed "unknown (API lookup failed)". Harmless on its own — but the same flavour of bug was lurking in the deploy-change-detection logic.
  2. LAST_DEPLOYED_SHA called /actions/runs/{run_id}/jobs, which Forgejo does not expose (404). The script swallowed each 404, walked all 285 successful runs, and urlopen had no timeout — when Codeberg got slow (intermittent 504s, which I reproduced), the step would hang past the 5-minute job timeout and fail.

Fix

  • All 9 wait-time steps now query /actions/runs?run_number=$RUN_NUMBER (swagger-documented filter, returns one run, ~4KB instead of 1.1MB) and read the created field. Curl gets --max-time 30, the assignment gets || true so a transient API hiccup can never fail the step.
  • LAST_DEPLOYED_SHA in deploy.yml/website.yml now queries /actions/tasks?status=success&limit=100 once and filters client-side for the target job + workflow. Task records already expose head_sha, so the broken per-run-jobs lookup is gone. urlopen gets timeout=60.

Both queries verified against the live Codeberg API — wait-time returns the correct queued timestamp for run #2173, and LAST_DEPLOYED_SHA resolves to the expected most-recent successful Play Store / Website deploy SHAs.

Auto-merge is enabled (squash, delete branch on merge). PR will merge automatically once CI checks pass. ## Summary PR opened: https://codeberg.org/guettli/sharedinbox/pulls/529 — auto-merge enabled. **Root cause of #527** The `Detect Changed Files` job in `deploy.yml` has been failing every hour since run #2165. Two compounding bugs: 1. **#522/#524 wait-time fix was incomplete.** Switched the endpoint from `/actions/tasks` → `/actions/runs` but didn't update the field lookups. Runs expose `index_in_repo` + `created`; tasks expose `run_number` + `created_at`. So the script always silently printed "unknown (API lookup failed)". Harmless on its own — but the same flavour of bug was lurking in the deploy-change-detection logic. 2. **LAST_DEPLOYED_SHA called `/actions/runs/{run_id}/jobs`, which Forgejo does not expose** (404). The script swallowed each 404, walked all 285 successful runs, and `urlopen` had **no timeout** — when Codeberg got slow (intermittent 504s, which I reproduced), the step would hang past the 5-minute job timeout and fail. **Fix** - All 9 wait-time steps now query `/actions/runs?run_number=$RUN_NUMBER` (swagger-documented filter, returns one run, ~4KB instead of 1.1MB) and read the `created` field. Curl gets `--max-time 30`, the assignment gets `|| true` so a transient API hiccup can never fail the step. - LAST_DEPLOYED_SHA in `deploy.yml`/`website.yml` now queries `/actions/tasks?status=success&limit=100` once and filters client-side for the target job + workflow. Task records already expose `head_sha`, so the broken per-run-jobs lookup is gone. `urlopen` gets `timeout=60`. Both queries verified against the live Codeberg API — wait-time returns the correct queued timestamp for run #2173, and LAST_DEPLOYED_SHA resolves to the expected most-recent successful Play Store / Website deploy SHAs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: guettli/sharedinbox#527