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

api: remove hardcoded type urls part.1 #10479

Merged
merged 9 commits into from
Apr 3, 2020

Conversation

Shikugawa
Copy link
Member

@Shikugawa Shikugawa commented Mar 22, 2020

Signed-off-by: shikugawa rei@tetrate.io

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md

Description: #10209. There are hardcoded type URLs in resources.h. In this PR, I removed all of the dependencies of those. Now, codes that depend on that are only test code. In the future, I will remove that from test codes and completely destroy that.

Risk Level: Low
Testing: N/A
Docs Changes: N/A
Release Notes: N/A
[Optional Fixes #Issue]
[Optional Deprecated:]

Signed-off-by: shikugawa <rei@tetrate.io>
Signed-off-by: shikugawa <rei@tetrate.io>
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

In general, I like this cleanup, but would like it split into two PRs. For next steps, I would recommend against trying to do too much in terms of magic in tests. It's fine to hardcode in tests, so any template complexity etc. needs to be warranted.

source/common/upstream/cluster_manager_impl.cc Outdated Show resolved Hide resolved
source/server/lds_api.cc Outdated Show resolved Hide resolved
@@ -22,6 +22,8 @@ EdsClusterImpl::EdsClusterImpl(
Stats::ScopePtr&& stats_scope, bool added_via_api)
: BaseDynamicClusterImpl(cluster, runtime, factory_context, std::move(stats_scope),
added_via_api),
Envoy::Config::SubscriptionBase<envoy::config::endpoint::v3::ClusterLoadAssignment>(
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, we're now slowly drifting into the space of true multiple inheritance, which is used somewhat sparingly in Envoy. Not sure if the horse has fully bolted here, @mattklein123?

Copy link
Member

Choose a reason for hiding this comment

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

TBH I don't really have a strong opinion on this. I guess I'm of an opinion that our default should be no, but if there is a good case for it I don't see any major issue. cc @envoyproxy/maintainers

@Shikugawa
Copy link
Member Author

@htuch That is, We should divide this PR into two, shouldn't we? First, basic cleanup of SubscriptionBase, getResourceName and so on. Second, v2 and v3 resource pause and resume with some tests. OK?

@htuch
Copy link
Member

htuch commented Mar 25, 2020

@Shikugawa yep.

Signed-off-by: shikugawa <rei@tetrate.io>
@Shikugawa Shikugawa changed the title api: remove hardcoded type urls api: remove hardcoded type urls part.1 Mar 28, 2020
@Shikugawa
Copy link
Member Author

@htuch Destroy hardcoded type URLs on this PR. I will create Part.2 that includes hardcoded type URLs removal and some tests with v3 resource names.

…ove_hardcoded_type_url

Signed-off-by: shikugawa <rei@tetrate.io>
Signed-off-by: shikugawa <rei@tetrate.io>
…ove_hardcoded_type_url

Signed-off-by: shikugawa <rei@tetrate.io>
Signed-off-by: shikugawa <rei@tetrate.io>
Signed-off-by: shikugawa <rei@tetrate.io>
htuch
htuch previously approved these changes Mar 30, 2020
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks. I'd ask that we don't do this for tests, as I think it will make them harder to write/understand/debug, conciseness is not necessarily a virtue in test code.

@mattklein123
Copy link
Member

@lizan can you take a look at clang-tidy here? I think this PR should have the fix for the headers issue so I think there might be a different issue?

/wait

Signed-off-by: shikugawa <rei@tetrate.io>
@Shikugawa
Copy link
Member Author

@mattklein123 @htuch LGTM?

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@htuch htuch merged commit 1323ff2 into envoyproxy:master Apr 3, 2020
@marcomagdy
Copy link
Contributor

marcomagdy commented Apr 3, 2020

@Shikugawa @htuch
In this PR, how does the template

template <typename Current> struct SubscriptionBase

Differ from the one in discovery_service_base.h?

Both have the same namespace and looks like they do the same thing more or less??
I'm asking because this is showing up in clang-tidy and failing CI for other PRs.

@lizan
Copy link
Member

lizan commented Apr 3, 2020

@marcomagdy This PR removees discovery_service_base.h, so if you see this failing CI for other PRs, they likely need merge master. Azure pipelines runs on merge commit so it could cause other PRs failing.

@marcomagdy
Copy link
Contributor

Interestingly, my PR failed CI after I merged from master.

htuch pushed a commit that referenced this pull request Apr 22, 2020
To resolve #10209. This is the continuation of #10479. Remove all of hard-coded type URLs, and operate subscriptions that have the same resource name.
Risk Level: Low

Signed-off-by: shikugawa <rei@tetrate.io>
penguingao pushed a commit to penguingao/envoy that referenced this pull request Apr 22, 2020
To resolve envoyproxy#10209. This is the continuation of envoyproxy#10479. Remove all of hard-coded type URLs, and operate subscriptions that have the same resource name.
Risk Level: Low

Signed-off-by: shikugawa <rei@tetrate.io>
Signed-off-by: pengg <pengg@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants