Repository navigation
feat(components): make components runtime always-on across Go services - #1631
VLukiantsev merged 7 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request deprecates and removes the enable_components configuration flag across multiple services, making the components feature always enabled by default. Feedback on the changes highlights several potential nil pointer dereferences in the newly introduced lazy-loading helper functions and providers, specifically in buildClickHouseResolverWithLazy, buildBigQueryResolverWithLazy, isComponentExpectedWithLazy, and listCustomComponentConfigs, where pointers are dereferenced without defensive nil checks.
…rve gateway migration flag Comment links: - #1631 (comment) - #1631 (comment) - #1631 (comment) - #1631 (comment) TAG=agy CONV=0d1e1e85-47f9-49da-a36c-92f916ef853f
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request deprecates and removes the 'enable_components' configuration flag across multiple services (including the actuator, dashboard, experiment state server, health service, and ingestion gateway), making the components feature always enabled by default. Code paths and tests have been simplified accordingly. Feedback is provided to improve the robustness of the message bus validation in the ingestion gateway by trimming whitespace before checking for empty values.
…panda default Comment link: #1631 (comment) TAG=agy CONV=0d1e1e85-47f9-49da-a36c-92f916ef853f
bea6aee to
108cbf7
Compare
Activate the Components control and data plane unconditionally across experiment_state_server (CMS gRPC server, ownership metrics collector, drift evaluation, and study component requirement validation), actuator (snapshot evaluation and env/secret injection), dashboard_service (ClickHouse and BigQuery Component CR discovery with static env fallback), health_service (custom component health and config reporting), and ingestion_gateway (Redpanda Component CR resolution when message_bus is redpanda). Retain -enable_components CLI flags as deprecated no-op bindings on the four binaries that previously registered them so rolling pod upgrades and legacy invocations do not fail flag parsing, and drop -enable_components from the stable-2026a ingestion-gateway component chart container arguments. TAG=agy CONV=0d1e1e85-47f9-49da-a36c-92f916ef853f
…late kubeconfig in tests TAG=agy CONV=0d1e1e85-47f9-49da-a36c-92f916ef853f
…rve gateway migration flag Comment links: - #1631 (comment) - #1631 (comment) - #1631 (comment) - #1631 (comment) TAG=agy CONV=0d1e1e85-47f9-49da-a36c-92f916ef853f
…panda default Comment link: #1631 (comment) TAG=agy CONV=0d1e1e85-47f9-49da-a36c-92f916ef853f
Remove redundant caller-side nil guards around lazyComponentGetter.get() in cmd/dashboard_service/main.go so static-fallback warnings log consistently and get()'s nil-receiver guard is exercised directly. Remove unused -enable_components CLI flag sinks from actuator, experiment_state_server, and health_service (which only read ConfigMap envFrom variables, never container CLI args), retaining the unread no-op CLI sink solely in ingestion_gateway where Helm container args pass -enable_components=true during rolling upgrades. Expand unit test coverage for Redpanda invalid-kubeconfig fallback in cmd/ingestion_gateway, nil-receiver/nil-store guards in DriftEvaluator, and shared isolateInvalidKubeconfig helpers in cmd/dashboard_service. Comment link: #1631 (comment) Comment link: #1631 (comment) Comment link: #1631 (comment) Comment link: #1631 (comment) Comment link: #1631 (comment) TAG=agy CONV=0d1e1e85-47f9-49da-a36c-92f916ef853f
…ck tests Render the dashboard-service-components-reader Role/RoleBinding and actuator xmc.dev/components ClusterRole rule unconditionally so clusters without the Component CRD or CR receive 404 NotFound rather than 403 Forbidden, and remove unread enable_components keys from service ConfigMaps and the stable-2026a ingestion-gateway chart values. Delete test-only non-lazy wrappers in cmd/dashboard_service, clarify the startup log when neither ClickHouse nor BigQuery is enabled (noting a pod restart is required if enabled later), deduplicate nil lazyComponentGetter assertions, add Forbidden fail-closed unit tests with and without static env, centralize crreadertest.IsolateInvalidKubeconfig, export (*Config).UsesRedpanda() with an observable getter factory in cmd/ingestion_gateway, drop the unread Flags.DeprecatedEnableComponents field, and tighten cmd/health_service nil-provider checks. Comment link: #1631 (comment) Comment link: #1631 (comment) Comment link: #1631 (comment) Comment link: #1631 (comment) Comment link: #1631 (comment) Comment link: #1631 (comment) Comment link: #1631 (comment) Comment link: #1631 (comment) Comment link: #1631 (comment) TAG=agy CONV=0d1e1e85-47f9-49da-a36c-92f916ef853f
2ad33c1 to
5ae64f9
Compare
There was a problem hiding this comment.
🤖 Incremental PR Approval
PR author is a code owner and changes since last approval (0 lines, excluding 2 test file lines) are within the 50-line grace delta.
Preserving prior approval by @janzak-dev on commit 2ad33c1.
There was a problem hiding this comment.
🤖 Incremental PR Approval
PR author is a code owner and changes since last approval (0 lines, excluding 2 test file lines) are within the 50-line grace delta.
Preserving prior approval by @janzak-dev on commit 2ad33c1.
…ickhouse accurately - Replace `&&` with `||` and call `apierrors.IsForbidden(err)` across all Forbidden checks in `TestBigQueryMetricsStoreSelectionAndBuilder` (`cmd/dashboard_service/main_test.go`) so wrapping regressions cannot pass silently. - Emit a specific startup log in `initDataEngineWithGetter` when `metrics_store=clickhouse` is disabled rather than claiming BigQuery was also checked, and add a unit subtest covering single-CR probe behavior. Comment link: #1631 (comment) Comment link: #1631 (comment) TAG=agy CONV=632bffa5-726f-467c-9524-87495fe2dfb2
There was a problem hiding this comment.
🤖 Incremental PR Approval
PR author is a code owner and changes since last approval (6 lines, excluding 29 test file lines) are within the 50-line grace delta.
Preserving prior approval by @janzak-dev on commit 2ad33c1.
Summary
Makes the Components runtime subsystem unconditionally active across all five component-aware Go services (
experiment_state_server,actuator,dashboard_service,health_service, andingestion_gateway), grants unconditionalComponentread RBAC todashboard-serviceandactuator, removes unreadenable_componentsConfigMap/chart value entries, and retains an ignored-enable_componentsCLI flag sink solely iningestion_gatewayfor rolling-upgrade compatibility.Motivation & Context
As part of graduating XMC Components from the
0.18.xintermediate transition window to mandatory core infrastructure for1.0.0, backend services should always registerComponentManagerService, evaluate experiment component drift and study requirements, inject workload component snapshots, resolve optionalComponentCRs (clickhouse,bigquery,redpanda) with static fallbacks, and report custom component health without requiring anenable_componentsfeature toggle.Key Changes
internal/experiment: Unconditionally initializeComponentManagerService(initCMS) incmd/experiment_state_server/main.go, remove-enable_componentsfromcmd/experiment_state_server/config/config.go, removeCheckComponentsFeature(STUDYexperiments without an activehpocomponent still fail pre-check withFailedPrecondition), and makeDriftEvaluatoralways active (with nil-receiver/nil-store guard).-enable_componentsfromcmd/actuator/config.go, removeRuntimeConfig.EnableComponentsgating incmd/actuator/k8s_client/component_injection.goso WorkUnits carryingxmc.dev/component-snapshotsare always evaluated, and render thexmc.dev/componentsread rule unconditionally indeploy/helm/templates/actuator/clusterrole.yaml.enable_componentsconfig bindings, renderdashboard-service-components-readerRole/RoleBindingunconditionally indeploy/helm/templates/dashboard-service/serviceaccount.yaml(so clusters without theComponentCRD or CR receive404 NotFoundrather than403 Forbidden), always runComponentCR discovery (clickhouse/bigquery) via a shared nil-safelazyComponentGetterwith static fallback and store-specific startup logging (metrics_store=clickhouse) incmd/dashboard_service/main.go, clean up stale error messages inpkg/{clickhouse,bigquery}/componentconfig/resolver.go, centralizecrreadertest.IsolateInvalidKubeconfig, enforceapierrors.IsForbidden(err)across all Forbidden checks incmd/dashboard_service/main_test.go, and always queryLazyComponentsProvider(with nil-provider guards) incmd/health_service/{health_checker,server}.gowhenlazyDBis initialized.Component/redpandawith a bounded5stimeout when(*Config).UsesRedpanda()is true (skipping kubeconfig initialization for non-redpandabuses), pass hardcoded-enable_components=trueindeploy/profiles/stable-2026a/components/ingestion-gateway/templates/deployment.yamlso pinned< 1.0.0gateway images remain component-aware during zero-downtime migration, retain-enable_componentsas an ignored flag viafs.Bool(...)incmd/ingestion_gateway/ingestiongateway/config.go, and remove unreadenable_components/enableComponentskeys fromdeploy/helm/templates/{actuator,ess,dashboard-service,health-service}/configmap.yamlanddeploy/profiles/stable-2026a/components/ingestion-gateway/values.yaml.Assumptions
-enable_componentssolely oningestion_gateway'sFlagSet(fs.Bool, ignored) during1.0.0is preferable to hard-removing that CLI flag — Go'sflag.Parse()exits2on unknown flags,deploy/profiles/stable-2026a/components/ingestion-gateway/templates/deployment.yamlpasses-enable_components=truewhilexmc-cmp-ingestion-gatewaypods roll independently ofxmc-bridge, anddeploy/helm/templates/ingestion-gateway/deployment.yaml(rendered whencomponentsDeployment.enabled=falseuntil Layer 3 removes the umbrella gateway template) passes-enable_components=false— on non-component umbrella installs in Redpanda mode, the umbrellaingestion-gatewayruns as ServiceAccountdefaultwithoutComponentRBAC, so on every pod start it makes one5s-boundedComponent/redpandaGETthat returns403 Forbidden, logs a warning, and falls back to static broker and topic flags.dashboard-service-components-readerRole/RoleBindingandactuator-rolexmc.dev/componentsClusterRolerules unconditionally (and removing unreadenable_componentskeys from serviceConfigMaptemplates andstable-2026a/components/ingestion-gateway/values.yaml) in this PR keeps it independently mergeable before Layer 3 — withoutComponentgetRBAC,dashboard-servicereceives403 Forbiddeninstead of404 NotFoundwhencomponentsDeployment.enabled=falseand fails/readyz(503) — ifdashboard-serviceis rolled out as an image-only update onto an older Helm release before applying the updated RBAC manifest,/readyzwill fail closed (503) on403 Forbiddenuntilhelm upgradeappliesdashboard-service-components-reader.docs/mandatory-components-1-0) — keeps Go service and Helm manifest diffs isolated per vertical review slice — if Layer 2 merges ahead of Layer 4, serviceREADME.mdfiles onmainwill briefly reference retiredenable_componentstoggles until Layer 4 lands.Verification & Testing
Automated Tests (at
2ec16d6b5)bazel build //cmd/dashboard_service:dashboard_servicebazel test //cmd/dashboard_service/... --test_output=errors(4/4tests pass)bazel coverage --combined_report=lcov //cmd/dashboard_service/... --test_output=errors(833 / 1005lines,82.9%)./.githooks/pre-commit(gofmt,golangci-lint,buildifier,51 out of 51affected Bazel unit/integration tests across//cmd/actuator/...,//cmd/dashboard_service/...,//cmd/experiment_state_server/...,//cmd/health_service/...,//cmd/ingestion_gateway/...,//cmd/log_monitor/...,//cmd/reconciler/...,//cmd/rod_data_provider/...,//cmd/xid_service/...,//internal/experiment/...,//internal/storage/...,//internal/workunit/...,//pkg/clickhouse/componentconfig/...,//pkg/bigquery/componentconfig/...,//pkg/components/..., and//test/e2e/...)51affected Bazel Go unit, Spanner/PostgreSQL integration, and component tests plus82.9%statement/line coverage in//cmd/dashboard_service/...pass cleanly at2ec16d6b5.Live Deployment & Manual Testing (Prior Stack Baseline)
2ec16d6b5.python3 tools/dev_env/dev_env.py gke-upgradepython3 ./deploy/ctk_v2/verify_xmc.py(19/19pods Ready,5/5ComponentCRs Ready, all sections✅ PASS)docs/align-metrics-and-helm-readmes@2f120512f):42817771822) —✅ SUCCESS42821678555) —✅ SUCCESSComponentManagerService&xmc-bridgeFence Handshake:kubectl logs -n xmc deployment/xmc-bridge-deployment --tail=15xmc-bridgeconnected togrpc-service:50051and logged"Cluster holds the CMS ownership fence"(epoch=1) against ESS without-enable_componentsflags.ingestion_gateway):kubectl logs -n xmc deployment/ingestion-gateway-deployment --tail=15xmc-cmp-ingestion-gatewaypods carrying legacy-enable_components=trueargs rolled cleanly onto the1.0.0image (0restarts), logged"Successfully resolved and validated Redpanda configuration from Component CR", and validated topicxmc-metrics./healthz(200) and unauthenticated/v1/health/configs(401) onsvc/health-service.health-service-deployment(1/1 Running) enforces authentication while serving component-enabled health endpoints.Related Issues / Bugs
N/A
TAG=agy
CONV=0d1e1e85-47f9-49da-a36c-92f916ef853f