8000 feat(components): implement custom components configuration parameter inspection by VLukiantsev · Pull Request #793 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content

feat(components): implement custom components configuration parameter inspection - #793

Merged
VLukiantsev merged 6 commits into
feat/components-spec-parameters-b548436559from
feat/components-config-inspection-flow-b548436559
Sep 9, 2026
Merged

VLukiantsev merged 6 commits into
feat/components-spec-parameters-b548436559from
feat/components-config-inspection-flow-b548436559

Conversation

@VLukiantsev
@VLukiantsev VLukiantsev commented Sep 7, 2026 •
Copy link
Copy Markdown
Collaborator

Summary

Layer 3 of the Custom Components Admin Visibility stack (b/548436559), building on Layer 2 (feat/components-spec-parameters-b548436559). Expands CustomComponentsInfoProvider with configuration parameter extraction (including spec.parameters, version, and endpoint) and integrates custom component configuration groups into cmd/health_service ListConfigEntries.

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 CustomComponentsInfoProvider to extract and standardize these parameters from the Spanner Store without external RPC calls, presenting them as dedicated ConfigGroup entries in ListConfigEntries. 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:
    • Added GetComponentsConfig(ctx context.Context) ([]ComponentConfig, error) to CustomComponentsInfoProvider interface and StoreComponentsProvider.
    • Implemented streamlined parameter extraction focusing cleanly on spec.parameters (e.g. topicName, brokerEndpoints, port), release version, and runtime endpoint with IPv6 net.JoinHostPort support.
    • Implemented collision disambiguation: if a custom parameter key collides with version or endpoint, the primary attribute is preserved and the custom parameter is disambiguated with the param.<key> prefix.
  • pkg/components/summary/README.md:
    • Documented Configuration Parameter Extraction (spec.parameters, version, endpoint, collision disambiguation, RFC 3986 endpoints).
    • Synchronized resilient startup and hermetic dependency injection documentation.
  • cmd/health_service:
    • list_configs.go: Implemented convertComponentConfigs transforming custom component parameters into ConfigGroup objects with pre-allocated slice capacities.
    • server.go: Added componentsProvider to server and newServer; wired custom component config groups into ListConfigEntries.
    • main.go: Injected customProvider into newServer(cfg, checker, guard, customProvider).
  • Unit Tests:
    • Added unit tests in pkg/components/summary/info_provider_test.go (TestStoreComponentsProvider_ConfigExtraction, TestStoreComponentsProvider_ParametersCollision, TestStoreComponentsProvider_LifecycleAndDependencies) and cmd/health_service (list_configs_test.go, server_test.go).

Assumptions

Verification & Testing

  • Bazel Unit Tests:
    • bazel test //pkg/components/summary:all //cmd/health_service:all passed cleanly.
  • Diff Sizing (against Layer 2):
    • Production code: ~135 lines (< 400 threshold)
    • Test code: ~185 lines
    • Total code: ~320 lines (< 1,000 threshold)
  • Pre-Commit Linters:
    • Buildifier, gofmt, golangci-lint, Go test determinism checker, and addlicense passed cleanly (./.githooks/pre-commit).

Related Issues / Bugs

Fixes b/548436559

TAG=agy
CONV=2181912f-1e25-4102-af4e-a8ae3e9b2195

@VLukiantsev
Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
Copy Markdown

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 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.

Comment thread pkg/components/summary/info_provider.go Resolved
Comment thread cmd/health_service/server.go Resolved
@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
Copy Markdown

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 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.

Comment thread pkg/components/summary/info_provider.go Resolved
Comment thread cmd/health_service/list_configs.go Resolved
Comment thread pkg/components/summary/info_provider.go Resolved
@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch 2 times, most recently from 9d7d3d2 to f7483a7 Compare September 7, 2026 09:03
@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch from 60113e3 to 03e6620 Compare September 7, 2026 14:14
@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch from 03e6620 to 06c0b84 Compare September 7, 2026 14:20
@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch from 06c0b84 to 7d9724f Compare September 7, 2026 14:36
@VLukiantsev
VLukiantsev marked this pull request as ready for review September 7, 2026 14:39
@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch from 7d9724f to cf4ee7a Compare September 7, 2026 16:50
@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch from cf4ee7a to befefb7 Compare September 7, 2026 16:57
@andrzejfudro andrzejfudro left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment thread pkg/components/summary/README.md Resolved
@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch from befefb7 to 4c3defc Compare September 9, 2026 07:18
@VLukiantsev
VLukiantsev removed this pull request from stack #794 September 9, 2026 07:36
@VLukiantsev
VLukiantsev changed the base branch from feat/components-health-status-flow-b548436559 to feat/components-spec-parameters-b548436559 September 9, 2026 07:37
@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch from 4c3defc to f3f39db Compare September 9, 2026 07:37
@VLukiantsev
VLukiantsev added this pull request to stack #828 September 9, 2026 07:37
@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch from f3f39db to 42e5705 Compare September 9, 2026 07:44
@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch from 42e5705 to f911755 Compare September 9, 2026 07:50
@VLukiantsev VLukiantsev added the priority::2-high top of mind. should not wait. label Sep 9, 2026
Comment thread pkg/components/summary/info_provider.go Resolved
andrzejfudro
andrzejfudro previously approved these changes Sep 9, 2026
@andrzejfudro andrzejfudro left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch from fc061b5 to 67e91c0 Compare September 9, 2026 15:02
… 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
@VLukiantsev
VLukiantsev force-pushed the feat/components-config-inspection-flow-b548436559 branch from 67e91c0 to a10649a Compare September 9, 2026 15:08
@andrzejfudro andrzejfudro left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Thanks!

@VLukiantsev
VLukiantsev added this pull request to the merge queue Sep 9, 2026
93ED
Merged via the queue into main with commit d017741 Sep 9, 2026
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority::2-high top of mind. should not wait.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0