Skip to content
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

Move files, change namespaces #1035

Merged
merged 17 commits into from
Jun 2, 2021
Merged

Move files, change namespaces #1035

merged 17 commits into from
Jun 2, 2021

Conversation

Tratcher
Copy link
Member

@Tratcher Tratcher commented May 29, 2021

Contributes to #462

  • Organizes files in Yarp.ReverseProxy
    • Flatter directory structure, limit 2 deep
    • Organized as outlined in the issue.
    • Split or merged a few files to match the overall organization.
  • Updated namespaces
  • Moved test files to match product layout

Overall there are now fewer and shorter namespaces.

TODO:

In hindsight I should have done only the file moves first, updating namespaces is painful.

I also shouldn't have started this before taking a long weekend 😁. Feel free to continue and push directly to this branch.

As for reviewing, let's focus on the directory structure first, since that drives the namespaces. Is anything horribly out of place? Do the categories still make sense?

@Tratcher Tratcher added this to the YARP 1.0.0-preview12 milestone May 29, 2021
@Tratcher Tratcher self-assigned this May 29, 2021
@Tratcher Tratcher marked this pull request as ready for review May 29, 2021 05:17
@MihaZupan
Copy link
Member

Where does the Discovery namespace come from? It just sounds unfamiliar to me compared to Abstractions, Configuration, etc.

Copy link
Contributor

@alnikola alnikola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall besides a few questions.

@@ -7,7 +7,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;

namespace Yarp.ReverseProxy.Middleware
namespace Yarp.ReverseProxy.Model
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReverseProxyApplicationBuilder is used only for configuration. Would it make sense to move it into some special namespace? In my opinion, Yarp.ReverseProxy.Model is for the types we use in runtime, not configuration.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used to be in the middleware namespace but we got rid of that. All of the other components that are used by the middleware are here in model so I put it there.

@Tratcher
Copy link
Member Author

Tratcher commented Jun 1, 2021

Where does the Discovery namespace come from? It just sounds unfamiliar to me compared to Abstractions, Configuration, etc.

Discovery comes from implementers discovering the routes, clusters, and destinations for their environment. That's what the SF and K8 implementations do.

Abstractions is more commonly used for types people are supposed to implement, we don't have as many of those.
Configuration is relevant here, but overloaded since a common data source is IConfiguration.

We can cover this in today's API review.

@Tratcher
Copy link
Member Author

Tratcher commented Jun 1, 2021

API review:

  • Discovery -> Configuration
  • Discovery.Configuration -> Configuration.ConfigProvider (it's all internal anyways)
  • IReverseProxyBuilderExtensions namespace -> Management, internal. no longer extension methods?

Tracked separately (#462 (comment))

  • Yarp.ReverseProxy.ServiceFabric (package and namespace) -> Yarp.ServiceFabric
  • Yarp.ReverseProxy.Kubernetese.* (package and namespace) -> Yarp.Kubernetese.*

@Tratcher Tratcher requested a review from alnikola June 1, 2021 21:38
@Tratcher
Copy link
Member Author

Tratcher commented Jun 1, 2021

Updated with API review feedback. Please prioritize this review so we can minimize merge conflicts.

Copy link
Member

@MihaZupan MihaZupan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very glad we're getting rid of the nesting and splitting of domains across folders.

Nit: Given that IClusterChangeListener is the only public thing in the Management namespace, could it fit under Configuration/Model instead? What kind of other functionality would we put into Management?

src/ReverseProxy/Proxy/RequestUtilities.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@alnikola alnikola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Tratcher
Copy link
Member Author

Tratcher commented Jun 2, 2021

I'm very glad we're getting rid of the nesting and splitting of domains across folders.

Nit: Given that IClusterChangeListener is the only public thing in the Management namespace, could it fit under Configuration/Model instead? What kind of other functionality would we put into Management?

Moved to Model since this deals with ClusterState objects.

@Tratcher Tratcher merged commit d31b388 into main Jun 2, 2021
@Tratcher Tratcher deleted the tratcher/files branch June 2, 2021 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants