fix(get): return a non-zero exit code and report why a download failed - #110
Merged
Merged
Conversation
feat(repository): turn unsuccessful API responses into actionable errors
feat(downloader): report why every download attempt failed
fix(downloader): fail when nothing matches the extraction rules
docs(readme): document failure reporting and GITHUB_TOKEN limits in CI
A failed run used to be indistinguishable from a successful one: the command
always exited with 0, and any API failure (invalid token, exhausted rate limit,
missing repository) was swallowed by `catch (\Throwable) { return; }` in the
repository page loaders, surfacing only as "0 releases found".
Responses are now validated centrally per provider, so the message names the
HTTP status, whether a token was configured and what to do about it. Repository
fallback is preserved: the reasons are collected per attempt and printed as a
single report with matched releases, release assets and the filters that
rejected them.
Assisted-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fix(downloader): distinguish an unfetched asset list from an empty one in reports fix(repository): keep truncated API messages valid UTF-8 fix(get): escape the software name in the failure header A rate limit hit on a follow-up page used to stop pagination silently, so the failure report claimed the repository had nothing more to offer. GitLab pagination failures are now logged the same way as GitHub ones. Assisted-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 What was changed
dload getnow exits with a non-zero code when at least one requested package was not installed. A failure of one package no longer cancels the remaining ones.x-ratelimit-remaining, primary and secondary limits, with reset time), invalid token (401), denied access (403), missing repository (404), server errors and malformed bodies. Every message states whether a token was configured and what to do withGITHUB_TOKEN/GITLAB_TOKEN.NothingExtracted) instead of a silent success — the message lists the rules and the files inside the asset.Why?
A broken run was indistinguishable from a successful one. In this CI run the
Download binariesstep reported success while nothing was downloaded, and the build failed later withRoadrunner is not installed. The only trace was0 releases found, becausecatch (\Throwable) { return; }inGitHubRepository::getReleases()andcatch (ClientExceptionInterface) { return; }inRepositoryApi::getReleases()turned any HTTP error into an empty release list, and the rate limit check only recognised one legacy body format.Checklist
NothingExtracted;ClientTestrewritten around a 12-case status/exception providerNotes for review
secrets.GITHUB_TOKENin GitHub Actions is scoped to its own repository and shares a 1,000 requests/hour limit across the whole job matrix, which is the likely trigger of the linked run. The exact status code cannot be recovered from that log — with this change it would have been printed.psalmsuppressions were added next to the existing ones inpsalm-baseline.xml(InternalMethodon collection iteration,PropertyNotSetInConstructorfor the two new context fields).GitHubRateLimitExceptionandGitLabRateLimitExceptionnow extend the sharedModule\Repository\Exception\RateLimitException; their constructor signatures changed andGitHubRateLimitException::fromApiResponse()was removed. Both classes are@internal.getchanges for anyone who relied on it always being 0.