-
Notifications
You must be signed in to change notification settings - Fork 105
Update axum monorepo #6816
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
base: main
Are you sure you want to change the base?
Update axum monorepo #6816
Conversation
|
eb8238b
to
44694e0
Compare
44694e0
to
8a47b67
Compare
8a47b67
to
e5047a0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6816 +/- ##
==========================================
- Coverage 54.68% 54.68% -0.01%
==========================================
Files 1093 1093
Lines 97283 97283
Branches 4544 4544
==========================================
- Hits 53200 53199 -1
- Misses 43495 43496 +1
Partials 588 588
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e5047a0
to
2a13f0e
Compare
2a13f0e
to
7a4f4c5
Compare
7a4f4c5
to
50ffe8e
Compare
63b2bcc
to
e0f82f5
Compare
e0f82f5
to
2eee581
Compare
2eee581
to
d7cee0e
Compare
d7cee0e
to
eef795b
Compare
eef795b
to
9e53e0b
Compare
9e53e0b
to
9b27c64
Compare
9b27c64
to
efa4b08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments:
libs/@local/graph/api/src/rest/principal.rs (line 128):
Axum 0.8 changed path parameter syntax from /:param
to /{param}
, but the code still uses the old syntax which will cause compilation errors.
View Details
📝 Patch Details
diff --git a/libs/@local/graph/api/src/rest/principal.rs b/libs/@local/graph/api/src/rest/principal.rs
index f22269ce0..123d892c8 100644
--- a/libs/@local/graph/api/src/rest/principal.rs
+++ b/libs/@local/graph/api/src/rest/principal.rs
@@ -102,9 +102,9 @@ impl PrincipalResource {
Router::new().nest(
"/identifier",
Router::new()
- .route("/:identifier", get(get_machine_by_identifier::<S>))
+ .route("/{identifier}", get(get_machine_by_identifier::<S>))
.route(
- "/system/:identifier",
+ "/system/{identifier}",
get(get_or_create_system_machine::<S>),
),
),
@@ -113,7 +113,7 @@ impl PrincipalResource {
"/ai",
Router::new().route("/", post(create_ai_actor::<S>)).nest(
"/identifier",
- Router::new().route("/:identifier", get(get_ai_by_identifier::<S>)),
+ Router::new().route("/{identifier}", get(get_ai_by_identifier::<S>)),
),
),
)
@@ -125,34 +125,34 @@ impl PrincipalResource {
Router::new()
.route("/", post(create_org_web::<S>))
.nest(
- "/:web_id",
+ "/{web_id}",
Router::new()
.route("/", get(get_web_by_id::<S>))
.route("/roles", get(get_web_roles::<S>)),
)
- .route("/shortname/:shortname", get(get_web_by_shortname::<S>)),
+ .route("/shortname/{shortname}", get(get_web_by_shortname::<S>)),
)
.nest(
"/teams",
Router::new()
.nest(
- "/:team_id",
+ "/{team_id}",
Router::new().route("/roles", get(get_team_roles::<S>)),
)
- .route("/name/:name", get(get_team_by_name::<S>)),
+ .route("/name/{name}", get(get_team_by_name::<S>)),
)
.nest(
- "/:actor_group_id",
+ "/{actor_group_id}",
Router::new().nest(
"/roles",
Router::new()
- .route("/actors/:actor_id", get(get_actor_group_role::<S>))
+ .route("/actors/{actor_id}", get(get_actor_group_role::<S>))
.nest(
- "/:role/actors",
+ "/{role}/actors",
Router::new()
.route("/", get(get_actor_group_role_assignments::<S>))
.route(
- "/:actor_id",
+ "/{actor_id}",
post(assign_actor_group_role::<S>)
.delete(unassign_actor_group_role::<S>),
),
Analysis
Axum 0.8 runtime panic due to deprecated path parameter syntax
What fails: Router creation in PrincipalResource::routes() panics at runtime with 11 route definitions using the old :param
syntax (lines 105, 107, 116, 128, 133, 139, 142, 145, 149, 151, 155)
How to reproduce:
# Start the graph API server - it will panic immediately on router creation
cargo run --bin hash-graph
Result: Runtime panic: "Path segments must not start with :
. For capture groups, use {capture}
. If you meant to literally match a segment starting with a colon, call without_v07_checks
on the router."
Expected: Server should start without panic using the new Axum 0.8 syntax {param}
instead of :param
Per Axum 0.8 announcement, path parameter syntax changed from /:single
to /{single}
. The old syntax now causes runtime panics unless .without_v07_checks()
is called on the router.
This PR contains the following updates:
=0.7.5
->=0.8.6
=0.5.0
->=0.5.5
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
tokio-rs/axum (axum)
v0.8.6
Compare Source
v0.8.5
: axum v0.8.5Compare Source
OptionalFromRequest
forMultipart
(#3220)Location::{status_code, location}
middleware::ResponseAxumBodyLayer
for mapping response body toaxum::body::Body
(#3469)impl FusedStream for WebSocket
(#3443)sse
module andSse
type no longer depend on thetokio
feature (#3154)Redirect
s constructors is not a valid header value, instead of panicking on construction, theIntoResponse
impl now returns an HTTP 500, just likeJson
does when serialization fails (#3377)v0.8.4
: axum v0.8.4Compare Source
Router::reset_fallback
(#3320)WebSocketUpgrade::selected_protocol
(#3248)serve
without graceful shutdown (#3129)v0.8.3
: axum v0.8.3Compare Source
From<Bytes>
forMessage
(#3273)OptionalFromRequest
forJson
(#3142)OptionalFromRequest
forExtension
(#3157)WebSocketUpgrade
(#3178)v0.8.2
: axum v0.8.2Yanked from crates.io due to unforeseen breaking change, see #3190 for details
OptionalFromRequest
forJson
(#3142)OptionalFromRequest
forExtension
(#3157)status
function of rejections aconst
function, suchas
JsonRejection
,QueryRejection
andPathRejection
(#3168)v0.8.0
: axum v0.8.0Compare Source
since rc.1
axum::extract::ws::Message
now usesBytes
in place ofVec<u8>
,and a new
Utf8Bytes
type in place ofString
, for its variants (#3078)OptionalFromRequestParts
impl forQuery
(#3088)tokio-tungstenite
to 0.26 (#3078)serde_path_to_error
to report fields that failed to parse (#3081)full changelog
You can also read the blog post on tokio
Note: there are further relevant changes in axum-core's changelog
/:single
and/*many
to/{single}
and/{*many}
; the old syntax produces a panic to avoid silent change in behavior (#2645)Sync
for all handlers and services added toRouter
andMethodRouter
(#2473)Path
extractor deserializers now check that the number of parameters matches the tuple length exactly (#2931)Host
extractor toaxum-extra
(#2956)WebSocket::close
. Users should explicitly send close messages themselves. (#2974)serve
generic over the listener and IO types (#2941)Serve::tcp_nodelay
andWithGracefulShutdown::tcp_nodelay
.See
serve::ListenerExt
for an API that let you set arbitrary TCP stream properties. (#2941)Option<Path<T>>
no longer swallows all error conditions,instead rejecting the request in many cases; see its documentation for details (#2475)
axum::extract::ws::Message
now usesBytes
in place ofVec<u8>
,and a new
Utf8Bytes
type in place ofString
, for its variants (#3078)serde_json::RawValue
inEvent::json_data
(#2992)content-length
before middleware.This allows middleware to add bodies to requests without needing to manually set
content-length
(#2897)tokio-tungstenite
to 0.26 (#3078)serde_path_to_error
to report fields that failed to parse (#3081)method_not_allowed_fallback
to set a fallback when a path matches but there is no handler for the given HTTP method (#2903)NoContent
as a self-described shortcut forStatusCode::NO_CONTENT
(#2978)get(ws_endpoint)
handlers toany(ws_endpoint)
(#2894)MethodFilter::CONNECT
,routing::connect[_service]
andMethodRouter::connect[_service]
(#2961)FailedToDeserializePathParams::kind
enum with (ErrorKind::DeserializeError
). This new variant captures bothkey
,value
, andmessage
from named path parameters parse errors, instead of only deserialization error message inErrorKind::Message
. (#2720)v0.7.9
: axum - v0.7.9Compare Source
v0.7.8
: axum - v0.7.8Compare Source
serde_json::RawValue
inEvent::json_data
(#2992)method_not_allowed_fallback
to set a fallback when a path matches but there is no handler for the given HTTP method (#2903)MethodFilter::CONNECT
,routing::connect[_service]
and
MethodRouter::connect[_service]
(#2961)NoContent
as a self-described shortcut forStatusCode::NO_CONTENT
(#2978)v0.7.7
: axum - v0.7.7Compare Source
rustdoc now generates tables of content in the sidebar (#2921)
v0.7.6
: axum - v0.7.6Compare Source
Arc
during deserialization ofPath
axum::serve::Serve::tcp_nodelay
andaxum::serve::WithGracefulShutdown::tcp_nodelay
(#2653)Router::has_routes
function (#2790)Serve::local_addr
andWithGracefulShutdown::local_addr
functions (#2881)Configuration
📅 Schedule: Branch creation - "before 4am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Renovate Bot.