Repository navigation
feat(captures): error codes and a problem summary for patch apps - #9
Merged
Merged
Conversation
…ear messages for private sources
…, keep rate limits blocked
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
A capture that fails now says why in a form a patch app can act on, and the archive says what to fix.
captures.error_code(migration: one nullable string column):not_public,not_found,blocked,too_large,timeout,tool_failed,unexpected. TheCapturers::Errorsubclass is the code.errorkeeps the message.not_publicwith "Ask the owner to share it, then run the archive again." The sign-in redirect used to be stored as adonecapture with Google's login HTML inside. GitHub's 404 on a private repository, git clone without access, yt-dlp's "Private video" and gallery-dl's "login required" arenot_publictoo. 404 and 410 arenot_found; 403 and 429 areblocked. A badGITHUB_TOKEN(401) blames the token, not the submitter. A video past the size limit istoo_large.Archive#problem: the failed capture whose code matters most to the submitter, withcode,method,messageand ahintwritten for a person. The API returns it asproblemon every archive; the archive page shows it in a callout, and each failed capture shows its code.docs/api.mddocumentserror_code,problemand the table of codes.docs/design.mdexplains the classes.Krater already polls
GET /api/v1/archives/:id; the follow-up in Krater is to readproblemand showproblem.hinton the project page and to the submitter. Krater ignores the new keys until then.Checks
bin/rails test: 81 runs, 0 failures. New tests: the Google export against stubbed 404, 401, 302-to-sign-in and 429 (WebMock), direct downloads at 404 and 403, git and yt-dlp output classification against a stubbed subprocess,Archive#problem, the API shape, the job's codes.bin/rubocop: clean. herb linter and formatter: clean.Migration
add_column :captures, :error_code, :string, nullable, safe under strong_migrations. The repo has nomigrationlabel yet.