Repository navigation
feat(components): implement custom components configuration parameter inspection - #793
Conversation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for retrieving and displaying custom component configurations in the health service. It extends the CustomComponentsInfoProvider interface with a new GetComponentsConfig method, implements configuration extraction from component records, and integrates these custom configurations into the ListConfigEntries RPC endpoint. The review feedback highlights two important improvements: first, sorting the component dependencies before joining them to ensure deterministic configuration output; second, checking for context cancellation or timeout errors when fetching custom configurations rather than unconditionally logging a warning and proceeding.
There was a problem hiding this comment.
Code Review
This pull request introduces the retrieval and conversion of custom component configurations, integrating them into the health service's ListConfigEntries RPC handler. It adds the GetComponentsConfig method to the CustomComponentsInfoProvider interface, implements configuration extraction in StoreComponentsProvider, and updates the server and tests accordingly. The review feedback suggests addressing a potential issue with formatting IPv6 host addresses when no port is specified, and recommends pre-allocating slices in convertComponentConfigs and extractComponentConfig to optimize performance by avoiding reallocation overhead.
9d7d3d2 to
f7483a7
Compare
60113e3 to
03e6620
Compare
03e6620 to
06c0b84
Compare
06c0b84 to
7d9724f
Compare
7d9724f to
cf4ee7a
Compare
cf4ee7a to
befefb7
Compare
andrzejfudro
left a comment
There was a problem hiding this comment.
LGTM on the health_service and contract side. I have doubts on the value of exposed properties and the ability to extend it in the future.
No code changes are requested for this PR - those can be made in the separate follow-up PR but it should be acknowledged/discussed.
befefb7 to
4c3defc
Compare
4c3defc to
f3f39db
Compare
f3f39db to
42e5705
Compare
42e5705 to
f911755
Compare
andrzejfudro
left a comment
There was a problem hiding this comment.
I've added one comment on config extraction - consider dropping some of the life-cycle properties as they can clutter the returned values. This can be done as a follow-up or we can discuss it if you don't share my opinion.
fc061b5 to
67e91c0
Compare
… inspection Adds GetComponentsConfig to CustomComponentsInfoProvider to extract specification and status metadata from the Spanner Store, and integrates custom component configuration groups into cmd/health_service ListConfigEntries. Fixes b/548436559 TAG=agy CONV=2181912f-1e25-4102-af4e-a8ae3e9b2195
…x err, and preallocate config slices - Sort component dependencies before joining for deterministic configuration display - Wrap IPv6 host addresses in square brackets when port is omitted - Propagate ctx.Err() in ListConfigEntries when context is cancelled or timed out - Preallocate slices in convertComponentConfigs and extractComponentConfig - Add unit tests for sorted dependencies, IPv6 formatting, and context cancellation TAG=agy CONV=2181912f-1e25-4102-af4e-a8ae3e9b2195
…inspection - Document GetComponentsConfig method on CustomComponentsInfoProvider - Document ComponentConfig and ConfigParameter structures - Add Configuration Parameter Extraction guide detailing spec metadata, wrapper CRDs, lifecycle parameters, RFC 3986 IPv6 endpoints, deterministic dependency sorting, and user labels TAG=agy CONV=2181912f-1e25-4102-af4e-a8ae3e9b2195
…config inspection Surfaces component-specific tuning parameters from ComponentSpec.Parameters (e.g., topicName, brokerEndpoints, port) into ConfigParameters alongside platform and lifecycle metadata. Disambiguates collisions with reserved platform attributes using param.<key>. Comment link: #793 (comment) TAG=agy CONV=2181912f-1e25-4102-af4e-a8ae3e9b2195
…full collision safety - Update pkg/components/summary/README.md to reflect resilient startup without in-memory fallbacks - Isolate populateCustomParameters to run after status, dependencies, and labels for full collision protection - Expand TestStoreComponentsProvider_ParametersCollision covering endpoint and dependencies TAG=agy CONV=2181912f-1e25-4102-af4e-a8ae3e9b2195
…pec parameters, version, and endpoint Comment link: #793 (comment) - Streamline extractComponentConfig to focus cleanly on spec.parameters, version, and endpoint - Prune internal reconciliation/lifecycle metadata (state, generation, dependencies, lifecycle, wrapper) from config inspection - Synchronize summary README with streamlined parameter extraction model TAG=agy CONV=2181912f-1e25-4102-af4e-a8ae3e9b2195
67e91c0 to
a10649a
Compare
Summary
Layer 3 of the Custom Components Admin Visibility stack (
b/548436559), building on Layer 2 (feat/components-spec-parameters-b548436559). ExpandsCustomComponentsInfoProviderwith configuration parameter extraction (includingspec.parameters,version, andendpoint) and integrates custom component configuration groups intocmd/health_serviceListConfigEntries.Motivation & Context
The XMC Admin Panel requires visibility into installed Custom Components configuration parameters (service-specific tuning parameters, spec versions, and runtime endpoint coordinates). This layer expands
CustomComponentsInfoProviderto extract and standardize these parameters from the Spanner Store without external RPC calls, presenting them as dedicatedConfigGroupentries inListConfigEntries. Per reviewer feedback, the configuration view is streamlined to focus cleanly on service parameters, version, and access endpoint, omitting internal reconciliation bookkeeping (state,generation,dependencies,lifecycle.*,wrapper.*).Key Changes
pkg/components/summary:GetComponentsConfig(ctx context.Context) ([]ComponentConfig, error)toCustomComponentsInfoProviderinterface andStoreComponentsProvider.spec.parameters(e.g.topicName,brokerEndpoints,port), releaseversion, and runtimeendpointwith IPv6net.JoinHostPortsupport.versionorendpoint, the primary attribute is preserved and the custom parameter is disambiguated with theparam.<key>prefix.pkg/components/summary/README.md:spec.parameters,version,endpoint, collision disambiguation, RFC 3986 endpoints).cmd/health_service:list_configs.go: ImplementedconvertComponentConfigstransforming custom component parameters intoConfigGroupobjects with pre-allocated slice capacities.server.go: AddedcomponentsProvidertoserverandnewServer; wired custom component config groups intoListConfigEntries.main.go: InjectedcustomProviderintonewServer(cfg, checker, guard, customProvider).pkg/components/summary/info_provider_test.go(TestStoreComponentsProvider_ConfigExtraction,TestStoreComponentsProvider_ParametersCollision,TestStoreComponentsProvider_LifecycleAndDependencies) andcmd/health_service(list_configs_test.go,server_test.go).Assumptions
b/548436559), Stage 3 Design Doc Section 1.6, and Prototype PR feat(components): prototype XMC components system with GitOps, CMS, and Spanner SOT #456.Verification & Testing
bazel test //pkg/components/summary:all //cmd/health_service:allpassed cleanly../.githooks/pre-commit).Related Issues / Bugs
Fixes b/548436559
TAG=agy
CONV=2181912f-1e25-4102-af4e-a8ae3e9b2195