-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add API for crates.io to trigger rebuilds #2534
Merged
Merged
Commits on Jul 11, 2024
-
preparations for API to request rebuild of a crate version
- web: `axum_cached_redirect`: change return type to be concrete - web/routes: add `post_internal` - test: add `TestFrontent::post`
Configuration menu - View commit details
-
Copy full SHA for bb0212b - Browse repository at this point
Copy the full SHA bb0212bView commit details -
web/error: add
JsonAxumNope
for JSON APIsThis aims to satisfy these wishes: - Use the same error enum (`AxumNope`) for both handlers returning HTML or JSON. - Yet allow those handlers to specify whether HTML or JSON should be returned. - Not change the exising code returning `AxumNope`--still convert to HTML by default. Because `AxumNope` also contains a case (`Search`) that is fixed to producing HTML, but shouldn't ever be used by handlers returning JSON, that works with a runtime error in case the latter assumption isn't being followed. The approach is to add a new wrapper around `AxumNope` called `JsonAxumNope` and matching type def `JsonAxumResult`. The wrapper also implements `IntoResponse`, but produces JSON. Endpoints wishing to return JSON errors need to use that wrapper and specify `JsonAxumResult` as their return type.
Configuration menu - View commit details
-
Copy full SHA for aaf7ea5 - Browse repository at this point
Copy the full SHA aaf7ea5View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf58d70 - Browse repository at this point
Copy the full SHA cf58d70View commit details -
web/builds: add API to request rebuild of a crate version
This resolves rust-lang#2442. - adds config variable `DOCSRS_TRIGGER_REBUILD_TOKEN` / `Config.trigger_rebuild_token` - adds `build_trigger_rebuild_handler` and route "/crate/:name/:version/rebuild" Note: does not yet contain any kind of rate limiting!
Configuration menu - View commit details
-
Copy full SHA for 464a4c0 - Browse repository at this point
Copy the full SHA 464a4c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 005a072 - Browse repository at this point
Copy the full SHA 005a072View commit details -
web/error: simplify
JsonAxumNope
implementationThis removes the intermediate `ErrorResponse` type and instead pattern matches AxumNope on both levels, using a new function `redirect_with_policy` to avoid duplication. (Saves 11 lines of code, 7 comment lines, and the indirection via intermediate type, but adds the function instead.)
Configuration menu - View commit details
-
Copy full SHA for d5e6da8 - Browse repository at this point
Copy the full SHA d5e6da8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 247d86b - Browse repository at this point
Copy the full SHA 247d86bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 108356a - Browse repository at this point
Copy the full SHA 108356aView commit details
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.