-
Notifications
You must be signed in to change notification settings - Fork 543
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
Service Discovery API refactoring #3114
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
a75d7c9
to
032d309
Compare
davidfowl
reviewed
Mar 25, 2024
src/Microsoft.Extensions.ServiceDiscovery.Abstractions/ServiceEndPointQuery.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Extensions.ServiceDiscovery.Abstractions/ServiceEndPointQuery.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Extensions.ServiceDiscovery.Dns/DnsServiceEndPointResolverBase.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Extensions.ServiceDiscovery.Dns/DnsServiceEndPointResolverBase.cs
Show resolved
Hide resolved
....Extensions.ServiceDiscovery.Yarp/ServiceDiscoveryReverseProxyServiceCollectionExtensions.cs
Show resolved
Hide resolved
2224161
to
619ec31
Compare
adityamandaleeka
approved these changes
Mar 26, 2024
8ce0fe6
to
5b1d46a
Compare
…ing a middleware factory
ee12f51
to
ca68d2d
Compare
ca68d2d
to
4955f3b
Compare
ReubenBond
added a commit
that referenced
this pull request
Mar 26, 2024
* API review feedback & general cleanup including removal of currently unused features * Align namespaces * Hide more of the API, rename for consistency * Hide more, rename more * ResolutionStatus does not need to be equatable * Make ServiceEndPointQuery public to break InternalsVisibleTo with Dns provider * Break InternalsVisibleTo from ServiceDiscovery package to YARP by adding a middleware factory * Remove ResolutionStatus, simplifying Service Discovery interfaces * Clean up ServiceEndPointImpl * Mark ServiceEndPointResolverResult as internal * Remove unnecessary members from ServiceEndPointCollection/Source * Seal service discovery types * Remove IServiceEndPointSelectorFactory and use DI instead * Remove unused endpoint selectors * Remove unused PendingStatusRefreshPeriod option * Rename UseServiceDiscovery to AddServiceDiscovery * Remove possible ambiguity in AddConfigurationServiceEndPointResolver signature * Add configuration delegate overloads to AddServiceDiscovery methods * Clean up logging in configuration-based service endpoint provider * API review: rename ServiceEndPointCollectionSource to IServiceEndPointBuilder * Rename IServiceDiscoveryDelegatingHttpMessageHandlerFactory * Rename IServiceEndPointProvider.ResolveAsync to PopulateAsync * Hide IServiceEndPointSelector * Remove allowedSchemes from ServiceEndPointQuery.TryParse * Rename ServiceEndPointQuery.Host to .ServiceName * Fix build * Review feedback * nit param rename * Improve ServiceEndPointQuery.ToString output * fixup (cherry picked from commit 23104ee)
davidfowl
pushed a commit
that referenced
this pull request
Mar 27, 2024
* API review feedback & general cleanup including removal of currently unused features * Align namespaces * Hide more of the API, rename for consistency * Hide more, rename more * ResolutionStatus does not need to be equatable * Make ServiceEndPointQuery public to break InternalsVisibleTo with Dns provider * Break InternalsVisibleTo from ServiceDiscovery package to YARP by adding a middleware factory * Remove ResolutionStatus, simplifying Service Discovery interfaces * Clean up ServiceEndPointImpl * Mark ServiceEndPointResolverResult as internal * Remove unnecessary members from ServiceEndPointCollection/Source * Seal service discovery types * Remove IServiceEndPointSelectorFactory and use DI instead * Remove unused endpoint selectors * Remove unused PendingStatusRefreshPeriod option * Rename UseServiceDiscovery to AddServiceDiscovery * Remove possible ambiguity in AddConfigurationServiceEndPointResolver signature * Add configuration delegate overloads to AddServiceDiscovery methods * Clean up logging in configuration-based service endpoint provider * API review: rename ServiceEndPointCollectionSource to IServiceEndPointBuilder * Rename IServiceDiscoveryDelegatingHttpMessageHandlerFactory * Rename IServiceEndPointProvider.ResolveAsync to PopulateAsync * Hide IServiceEndPointSelector * Remove allowedSchemes from ServiceEndPointQuery.TryParse * Rename ServiceEndPointQuery.Host to .ServiceName * Fix build * Review feedback * nit param rename * Improve ServiceEndPointQuery.ToString output * fixup (cherry picked from commit 23104ee)
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Our requirements on Service Discovery have evolved since we first created it, eg we added more semantics to the input string. There were also some vestigial types, members, and patterns to clean up. API review also revealed some things which could be simplified or changed to align with prevailing patterns.
This PR addresses these points by refactoring the API:
IServiceEndPointSelector
impls).ResolutionStatus
typeIHttpClientBuilder
extension fromUseServiceDiscovery
toAddServiceDiscovery
to align with existing patterns. The existing method is kept and marked as[Obsolete]
for now.ServiceEndPointQuery
type to communicate the parsed input from the core resolver to the providersIServiceEndPointSelector
from DI instead of using a factory (and register it as transient).ServiceEndPointCollectionSource
toServiceEndPointBuilder
, make internal, and extract public interface:IServiceEndPointBuilder
ServiceEndPointCollection
toServiceEndPointSource
to match existing ASP.NET patternMicrosoft Reviewers: Open in CodeFlow