labctl pr logs requests the wrong run attempt and misreports the cause as a log-adapter shape mismatch #266
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#266
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found while landing PR #264, where
labctl pr logscould not retrieve the logs of a failing required check and pointed the wrong way for the fix.Symptom
Same result with
--check "ci / native (pull_request)".What is actually happening
The forge serves the log fine — on attempt/1:
Attempt 1's body is the complete 52 KB job log, and its timestamps (22:59:04 → 23:08:07, ≈9m03s) match the
Failing after 9m7sthatlabctl pr checksreported for that same run — so attempt 1 is the run that failed. labctl asked for an attempt that does not exist.Two defects, and the second is the more expensive one:
attempt/2for a run whose only attempt is 1.500is reported as "did not answer the shape lab's log adapter expects" / "lab's Forgejo log adapter does not match this forge version". Nothing about the response shape was wrong — the route was wrong. The message sends the reader off to check adapter/forge-version compatibility and to "debug from local repro", when the actual fix is a URL the tool already had the information to build.Prior art: commit
84f8fc5("chore(ci): retrigger checks after runner outage") records the same attempt/2-serves-no-logs behaviour from a different angle, so the forge returning nothing useful for a non-existent or reaped attempt is a recurring shape worth handling deliberately rather than per-incident.Impact
CI logs are how a lander turns a red required check into an actionable finding. When this fails, the fallback is either reproducing the whole gate locally — impossible in a session with no Go/Node toolchain — or bypassing labctl entirely with
curlagainst the forge, which is what unblocked #264. That defeats the point of the verb.Acceptance criteria
labctl pr logs <N>retrieves the log for the attempt the failing check actually ran (verify against a PR with a single-attempt run and one with a genuine re-run — #264's run 358 is a live single-attempt case)Reproduction