forked from linkerd/linkerd2-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[pull] main from linkerd:main #197
Merged
Merged
Conversation
This file contains 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
elsewhere in our codebase, we follow a pattern that can be called a "new service". this is a `Service<T>` whose response `S` is itself a `Service<U>`. new services are often useful for dealing with particular connection semantics, and provide us a way to model a connection that services many requests. our test server code makes use of a `Svc`, which wraps a reference to a map of uri's and routes. there is an associated `NewSvc` type that does not provide any material benefit. this `NewSvc` type is a `Service<()>` that never exerts backpressure, nor performs any action besides `Arc::clone`ing the map of routes. this commit golfs down `linkerd_app_integration::server::Server`, by directly cloning the routes into a `Svc(_)`, without the need for polling a future or handling an (impossible) error. Signed-off-by: katelyn martin <[email protected]>
`linkerd_app_integration::tcp` provides a `TcpServer` type that is distinct from the primary `linkerd_app_integration::server::Server` type broadly used in integration tests. this commit makes a small change to reduce indirection, and clarify that this is constructing a different server implementation from a different submodule. this removes `linkerd_app_integration::server::tcp()`, and updates test code to call the `tcp::server()` function that this is masking. Signed-off-by: katelyn martin <[email protected]>
the test server implementation in `linkerd_app_integration` defines an `BoxError` alias. we have a boxed error type in `linkerd_app_core::Error` that achieves the same purpose, that we can use instead. this commit replaces this type alias with a reëxport of `linkerd_app_core::Error`. see also, #3685, which removed another similar alias. Signed-off-by: katelyn martin <[email protected]>
these constants exist, and are generally considered a best practice for these situations. this commit replaces numeric literals with named constants. Signed-off-by: katelyn martin <[email protected]>
* nit(app/integration): add whitespace for consistency we follow a convention of an empty line between functions. this commit adds an empty line. Signed-off-by: katelyn martin <[email protected]> * nit(app/integration): remove whitespace for consistency Signed-off-by: katelyn martin <[email protected]> * nit(app/integration): add whitespace for consistency Signed-off-by: katelyn martin <[email protected]> --------- Signed-off-by: katelyn martin <[email protected]>
* refactor(app/integration): remove `Request`, `Response` aliases see linkerd/linkerd2#8733. this commit removes two type aliases from our test server implementation. these are each tied to the defunct `hyper::Body` type. since much of this code was originally written (between 2017 and 2020) we've since developed some patterns / idioms elsewhere for dealing with request and response bodies. to help set the stage for tweaks to which interfaces need `hyper::body::Incoming`, which types work with our general default of `BoxBody`, and which can be generic across arbitrary `B`-typed bodies, we remove these aliases and provide the body parameter to `Request` and `Response`. Signed-off-by: katelyn martin <[email protected]> * refactor(app/integration): remove `Request`, `Response` aliases see linkerd/linkerd2#8733. this commit removes two type aliases from our test client implementation. these are each tied to the defunct `hyper::Body` type. since much of this code was originally written (between 2017 and 2020) we've since developed some patterns / idioms elsewhere for dealing with request and response bodies. to help set the stage for tweaks to which interfaces need `hyper::body::Incoming`, which types work with our general default of `BoxBody`, and which can be generic across arbitrary `B`-typed bodies, we remove these aliases and provide the body parameter to `Request` and `Response`. Signed-off-by: katelyn martin <[email protected]> --------- Signed-off-by: katelyn martin <[email protected]>
this commit removes some misdirection from the various constructors for our test server. currently, we expose a family of constructor functions `server::new()`, `server::http1()`, ..., and so forth. each of these invoke a private `server::Server::http1()`, `server::Server::http2()`, `server::Server::http2_tls()`, ..., counterpart, which then delegates down once more to another private constructor `server::Server::new()`. this is all a bit roundabout, particularly because these private constructors are not used by any other internal code in the `server` submodule. this commit removes these inherent `Server` constructors, since they are private and not used by any test code. each free-standing constructor function is altered to instead directly construct a `Server`. Signed-off-by: katelyn martin <[email protected]>
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )