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

[docs] Remove outdated statements #6743

Closed
wants to merge 3 commits into from

Conversation

derekargueta
Copy link
Member

Description: v1 has been deprecated, remove statements about API methods being "optional until v1 is deprecated". Somewhat related to #2832.
Risk Level: none
Testing: N/A
Docs Changes: included
Release Notes: N/A

Signed-off-by: Derek Argueta [email protected]

Signed-off-by: Derek Argueta <[email protected]>
Signed-off-by: Derek Argueta <[email protected]>
@derekargueta derekargueta changed the title Dereka/doc nit Remove outdated docstring statements. Apr 29, 2019
@derekargueta derekargueta changed the title Remove outdated docstring statements. [docs] Remove outdated statements Apr 29, 2019
@zuercher
Copy link
Member

There's one more function marked "compulsory when v1 is deprecated" in that file (for createEmptyConfigProto).

That said, I think the way these methods actually become compulsory is to remove their default implementations (such that it becomes a compile error not to implement them in subclasses). I'm not sure if all the current filter factories would pass in that case, however.

@htuch are we ready to start requiring these functions to be implemented or is there another step that needs to happen first?

Signed-off-by: Derek Argueta <[email protected]>
@derekargueta
Copy link
Member Author

@zuercher agreed about true compulsory would be removing the default implementations. Looks like NamedListenerFilterConfigFactory::createEmptyConfigProto is already PURE so it's at least safe to call that one compulsory.

For the others, I believe the only thing that would prevent us from removing the default implementation for now is testing code that still uses the v1 API. For production filters, I think it's safe to call v2 "compulsory" since

  1. production Envoys don't use v1 APIs for the actual runtime
  2. If a factory subclassing NamedHttpFilterConfigFactory or NamedNetworkFilterConfigFactory doesn't implement the createEmptyConfigProto methods (which will return nullptr by default), this release assert gets triggered when using the v2 API (the only version supported for running Envoy).

So they currently are "compulsory" in a way for actually running Envoy, but not for unit tests (yet). For example, when updating the listener manager impl tests, I had to implement those methods to move those tests to v2 (here).

@htuch
Copy link
Member

htuch commented Apr 29, 2019

I agree, we should make these compulsory. The question is what is a sensible implementation for filters that don't require any configuration? It could just be google.protobuf.Empty. Maybe this should be the default?

I actually had an idea while looking at this and thinking about #6271. We could avoid having filters explicitly provide their semantic release version if they couple it with their config protobuf type URL. There are pros/cons here, but this was a useful reminder that this is possible.

@derekargueta
Copy link
Member Author

I removed the default implementation for all these methods, making them PURE, and so far all builds are working fine. so far tested:

bazel build //source/exe:envoy-static
bazel test //test/common/...
bazel test //test/server/...

It could just be google.protobuf.Empty. Maybe this should be the default?

Yeah that seems the default practice right now, i.e. in EmptyHttpFilterConfig

ProtobufTypes::MessagePtr createEmptyConfigProto() override {

@zuercher
Copy link
Member

So sounds like remove the default, aborting implementations of the createFilterFactoryFromProto methods and change the createEmptyConfigProto methods to return an empty config message.

@zuercher zuercher self-assigned this Apr 30, 2019
@stale
Copy link

stale bot commented May 7, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label May 7, 2019
@stale
Copy link

stale bot commented May 14, 2019

This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot closed this May 14, 2019
@derekargueta derekargueta deleted the dereka/doc-nit branch June 28, 2019 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants