security/acl: move get_resource_type body to acl.cc#30220
security/acl: move get_resource_type body to acl.cc#30220dotnwat merged 2 commits intoredpanda-data:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Moves security::get_resource_type<T>()’s type-dependent logic out of the public header to reduce transitive dependencies (notably Kafka protocol + Schema Registry types) and improve build fan-out.
Changes:
- Replaced the header-defined
get_resource_type<T>()body insecurity/acl.hwith a declaration, and implemented it insecurity/acl.ccwith explicit instantiations for the supported types. - Updated Bazel deps: moved Kafka protocol + Schema Registry types from
//src/v/securitypublic deps toimplementation_deps. - Fixed downstream compilation fallout by adding explicit includes/deps where those types are referenced directly (security tests, cloud_topics frontend).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/v/security/acl.h | Removes transitive Kafka/SR includes and leaves get_resource_type<T>() as a declaration. |
| src/v/security/acl.cc | Adds the moved get_resource_type<T>() implementation + explicit instantiations. |
| src/v/security/BUILD | Shifts Kafka/SR dependencies to implementation_deps to stop leaking through the public API. |
| src/v/security/tests/authorizer_test.cc | Adds direct include for Kafka protocol types now that acl.h no longer brings them in. |
| src/v/security/tests/BUILD | Adds the needed //src/v/kafka/protocol test dependency. |
| src/v/cloud_topics/frontend/frontend.cc | Adds direct include for Kafka protocol errors now required explicitly. |
| src/v/cloud_topics/frontend/BUILD | Adds //src/v/kafka/protocol dep to match the new include. |
acl.h's consteval get_resource_type<T>() referenced pandaproxy::schema_registry and kafka types inside its body, forcing every consumer of security/acl.h to transitively pull both modules through security's public API. Move the body into acl.cc with explicit instantiations for the six known types, matching the existing get_allowed_operations<T>() pattern in the same file. Drop consteval since all call sites use the function in runtime contexts. Move schema_registry:types and kafka/protocol from security's deps to implementation_deps. Rebuild fan-out on a types.h content-hash bump of //src/v/pandaproxy/schema_registry/...: before: 347 CppCompile actions, 382.6s wall after: 71 CppCompile actions, 88.9s wall delta: -276 actions (-79.5%), -294s (-76.8%)
|
/microbench |
|
Performance change detected in https://buildkite.com/redpanda/redpanda/builds/83385#019daabc-2c66-4874-ad48-2d3c552cfbde: See https://redpandadata.atlassian.net/wiki/x/LQAqLg for docs |
|
The |
acl.h's consteval get_resource_type() referenced
pandaproxy::schema_registry and kafka types inside its body, forcing
every consumer of security/acl.h to transitively pull both modules
through security's public API.
Move the body into acl.cc with explicit instantiations for the six
known types, matching the existing get_allowed_operations() pattern
in the same file. Drop consteval since all call sites use the function
in runtime contexts. Move schema_registry:types and kafka/protocol
from security's deps to implementation_deps.
Rebuild fan-out on a types.h content-hash bump of
//src/v/pandaproxy/schema_registry/...:
TODO
Backports Required
Release Notes