fix(collector): Forgejo 16 Actions shapes + bind the forge read token (U-I2b) #1
Loading…
Reference in a new issue
No description provided.
Delete branch "ditdash-u-i2b-forgejo16"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Run selection accepts Forgejo (status=success) and GitHub (completed+success); artifacts accept bare arrays; archive_download_url preferred; expired skipped. End-to-end stub-server test of refresh(). Manifest binds DITDASH_FORGE_TOKEN (ditdash-reader). Critic: approve-with-fixes; R1/R4 fixed.
The reader required GitHub's status=="completed" && conclusion=="success" and {"artifacts":[...]} listings, so on the live Forgejo 16.0.4 it found neither a run nor its bundle: a finished run reports status=="success" with conclusion null, and the per-run artifacts endpoint answers with a bare JSON array. Accept both shapes — run selection takes either success form, the artifact listing takes bare-array or object, and the download URL prefers archive_download_url, then download_url, then url + "/zip" (a non-expired named artifact; the expired-only case names that as the miss). Selection is factored into pure helpers (run_succeeded, select_run_id, artifact_items, pick_bundle_download, resolve_download_url) with unit tests on the observed forge fixtures plus GitHub-shaped fixtures. Also, in this file only: Snapshot's Default derives (clippy::derivable_impls) and clock() passes the fn to unwrap_or_else (clippy::redundant_closure) — both were pre-existing -D warnings blockers — and the file is rustfmt normalized, clearing its 19 pre-existing fmt hunks. Crate-wide clippy/fmt still fail on surface.rs, views.rs, and tests/ (identical at base; outside this contract's files owned). Assisted-by: worker-local:sage-ai/sage