8000 fix(helm): let dashboard-service read the bigquery Component by Szlaski · Pull Request #1468 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content
1 8000

fix(helm): let dashboard-service read the bigquery Component - #1468

Draft
Szlaski wants to merge 1 commit into
mainfrom
szlaski/dashboard-bigquery-rbac
Draft

Szlaski wants to merge 1 commit into
mainfrom
szlaski/dashboard-bigquery-rbac

Conversation

@Szlaski
@Szlaski Szlaski commented Oct 28, 2026
Copy link
Copy Markdown
Collaborator

Problem

With componentsDeployment.enabled=true and no metrics store configured, dashboard-service never turns Ready, so helm upgrade --install --wait times out.

At startup the dashboard's data engine (initDataEngineWithGetter in cmd/dashboard_service/main.go) looks up the clickhouse Component and then the bigquery Component. The dashboard-service-components-reader Role only grants get on clickhouse, so the bigquery lookup fails with Forbidden. isComponentExpected counts any error other than NotFound as a configured store, so the dashboard picks the BigQuery engine, can never build it, and /readyz returns 503 forever:

BigQuery connection not available at startup, the data engine is retried on demand: failed to resolve data engine:
failed to get component xmc/bigquery: components.xmc.dev "bigquery" is forbidden: User
"system:serviceaccount:xmc:dashboard-service-account" cannot get resource "components" in API group "xmc.dev"
in the namespace "xmc"

Existing environments miss this. The KinD e2e setup prunes dashboard-service, and releases with a metrics store configured never reach the BigQuery lookup because the ClickHouse check succeeds first. I hit it while running the full e2e suite on an AKS island-mode deployment with both components and dashboard-service enabled.

Fix

Add bigquery to the Role's resourceNames. The lookup now returns NotFound, the dashboard logs ClickHouse is not configured, starting without a chart data engine, and the pod turns Ready.

isComponentExpected still treats Forbidden as configured. Failing closed on API errors is a reasonable default, and this change removes the Forbidden path for the chart's own deployment.

Testing

  • helm lint deploy/helm
  • python3 -m unittest discover --start-directory test/helm --pattern '*_test.py': 77 tests pass. This updates the three resourceNames assertions in dashboard_service_clickhouse_config_test.py and adds test_components_rbac_grants_bigquery_component_get.
  • Live on AKS (island mode, PostgreSQL backend): after patching the Role and restarting the dashboard, /readyz went from 503 to ready and helm --wait completed.

TAG=agy
CONV=b6f14b72-3ac1-4d84-ae7e-f90e012997d5

With componentsDeployment.enabled=true and no metrics store configured,
dashboard-service never turns ready and `helm --wait` times out. At
startup the data engine looks up the `clickhouse` Component and then the
`bigquery` Component, but the dashboard-service-components-reader Role
only grants get on `clickhouse`. isComponentExpected counts the
Forbidden error as a configured store, so the dashboard picks BigQuery,
cannot build it, and /readyz returns 503 forever.

Grant get on `bigquery` too. The lookup now returns NotFound and the
dashboard starts without a chart data engine.

TAG=agy
CONV=b6f14b72-3ac1-4d84-ae7e-f90e012997d5
@github-actions
github-actions Bot requested a review from AntonTyb October 28, 2026 14:07
@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 the 'bigquery' resource to the dashboard service's ServiceAccount RBAC rules to allow the data engine to probe the BigQuery component at startup, preventing readiness issues. The associated Helm tests have been updated to assert this change. The reviewer noted that the newly added test 'test_components_rbac_grants_bigquery_component_get' is redundant with an existing test since both use identical input parameters and assertions, and recommended removing the redundant test while merging its descriptive docstring into the existing one.

Comment on lines +277 to +292
def test_components_rbac_grants_bigquery_component_get(self) -> None:
"""The Role also covers the bigquery Component the data engine probes at startup.

The dashboard counts a forbidden Component lookup as a configured store, so without this
grant a release with neither ClickHouse nor BigQuery picks BigQuery and never turns ready.
"""
manifest = render_template(
DASHBOARD_SERVICEACCOUNT,
{
"dashboardServiceDeployment.enabled": "true",
"componentsDeployment.enabled": "true",
"metrics.enabled": "false",
},
)
self.assertIn('resourceNames: ["clickhouse", "bigquery"]', manifest)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The new test test_components_rbac_grants_bigquery_component_get is redundant with test_components_rbac_rendered_when_components_enabled_even_without_metrics (defined at lines 262-275). Both tests render the template with the exact same input parameters and assert the same resourceNames list containing "clickhouse" and "bigquery". To maintain a clean and DRY test suite, consider removing this redundant test. The detailed explanation of why the bigquery grant is necessary can be incorporated into the docstring of the existing test.

This branch has not been deployed

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

1 participant

0