Skip to content

(xds) decouple SubscriptionBase from SubscriptionCallbacks & rename#44047

Open
antoniovleonti wants to merge 7 commits intoenvoyproxy:mainfrom
antoniovleonti:decouple-base-callbacks
Open

(xds) decouple SubscriptionBase from SubscriptionCallbacks & rename#44047
antoniovleonti wants to merge 7 commits intoenvoyproxy:mainfrom
antoniovleonti:decouple-base-callbacks

Conversation

@antoniovleonti
Copy link
Copy Markdown
Contributor

@antoniovleonti antoniovleonti commented Mar 20, 2026

Commit Message: decouple SubscriptionBase from SubscriptionCallbacks & rename
Additional Description:

Decouple SubscriptionBase from SubscriptionCallbacks so that SubscriptionBase can be used with other types of callbacks (e.g. SingletonSubscriptionCallbacks).

  • Remove inheritance of SubscriptionCallbacks from SubscriptionBase
  • Rename SubscriptionBase to ResourceTypeHelper.
  • For classes previously inheriting from SubscriptionBase:
    • Add a ResourceTypeHelper member
    • Inherit directly from SubscriptionCallbacks

Risk Level: low / none
Testing: no behavior change, all existing tests pass
Docs Changes: none
Release Notes: none
Context: #44237

Disclosure: an LLM was used to generate some of this change

Signed-off-by: antoniovleonti <leonti@google.com>
Signed-off-by: antoniovleonti <leonti@google.com>
Signed-off-by: antoniovleonti <leonti@google.com>
Signed-off-by: antoniovleonti <leonti@google.com>
@antoniovleonti
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the SubscriptionBase class into a new ResourceTypeHelper struct, promoting composition over inheritance for xDS clients. This change involves creating a new header and build target for ResourceTypeHelper and updating all existing xDS clients to use the new helper as a member. Review comments suggest marking the resource_type_helper_ member as const in various classes to enforce immutability, and also propose making resource_decoder_ private with a public getter in ResourceTypeHelper for better encapsulation.

Comment thread contrib/istio/filters/common/source/workload_discovery.cc Outdated
Comment thread source/common/config/resource_type_helper.h
Comment thread source/common/filter/config_discovery_impl.h Outdated
Comment thread source/common/listener_manager/lds_api.h Outdated
Comment thread source/common/router/scoped_rds.h Outdated
Comment thread source/common/upstream/od_cds_api_impl.cc Outdated
Comment thread source/common/upstream/od_cds_api_impl.h Outdated
Comment thread source/extensions/access_loggers/filters/process_ratelimit/provider_singleton.h Outdated
Comment thread source/extensions/clusters/eds/eds.h Outdated
Comment thread source/extensions/clusters/eds/leds.h Outdated
Signed-off-by: antoniovleonti <leonti@google.com>
@antoniovleonti
Copy link
Copy Markdown
Contributor Author

/assign @kyessenov

Comment thread source/extensions/access_loggers/filters/process_ratelimit/provider_singleton.cc Outdated
kyessenov
kyessenov previously approved these changes Mar 25, 2026
Signed-off-by: antoniovleonti <leonti@google.com>
@antoniovleonti
Copy link
Copy Markdown
Contributor Author

/assign @wbpcode

Signed-off-by: antoniovleonti <leonti@google.com>
@antoniovleonti
Copy link
Copy Markdown
Contributor Author

/retest

@kyessenov kyessenov removed their assignment Mar 26, 2026
@antoniovleonti
Copy link
Copy Markdown
Contributor Author

/assign @krinkinmu

@antoniovleonti
Copy link
Copy Markdown
Contributor Author

/assign @adisuissa

Copy link
Copy Markdown
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

Nice, LGTM, thanks!

const envoy::config::endpoint::v3::ClusterLoadAssignment& cluster_load_assignment_;
};

const Config::ResourceTypeHelper<envoy::config::endpoint::v3::ClusterLoadAssignment>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Something to think about in the future: this is essentially the same resource_type_helper object that is created for all the EdsClusterImpl objects. In the future it may make more sense to create a single map between the type and the decoder, and use that.

@adisuissa
Copy link
Copy Markdown
Contributor

/assign-from @envoyproxy/senior-maintainers

@repokitteh-read-only
Copy link
Copy Markdown

@envoyproxy/senior-maintainers assignee is @wbpcode

🐱

Caused by: a #44047 (comment) was created by @adisuissa.

see: more, trace.

@antoniovleonti
Copy link
Copy Markdown
Contributor Author

@wbpcode bump

@phlax
Copy link
Copy Markdown
Member

phlax commented Apr 14, 2026

@wbpcode this seems to be waiting on your sign off

@antoniovleonti
Copy link
Copy Markdown
Contributor Author

/assign-from @envoyproxy/senior-maintainers

@repokitteh-read-only
Copy link
Copy Markdown

@envoyproxy/senior-maintainers assignee is @wbpcode

🐱

Caused by: a #44047 (comment) was created by @antoniovleonti.

see: more, trace.

@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Apr 16, 2026

Sorry for the delay. Because this is a pure code improvement. It should be good to delay this until 1.38 to be released first? Slack me once 1.38 is out.

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.

6 participants