fix(alerting): declare ClickHouseSearchIndex bean as concrete type
Production crashlooped on startup: ExchangeMatchEvaluator autowires the concrete ClickHouseSearchIndex (for countExecutionsForAlerting, which lives only on the concrete class, not the SearchIndex interface), but StorageBeanConfig declared the bean with interface return type SearchIndex. Spring matches autowire candidates by declared bean type, not by runtime instance class, so the concrete-typed autowire failed with: Parameter 0 of constructor in ExchangeMatchEvaluator required a bean of type 'ClickHouseSearchIndex' that could not be found. ClickHouseLogStore's bean is already declared with the concrete return type (line 171), which is why LogPatternEvaluator autowires fine. All alerting ITs passed pre-merge because AbstractPostgresIT replaces the clickHouseSearchIndex bean with @MockBean(name=...) whose declared type IS the concrete ClickHouseSearchIndex. The mock masked the prod bug. Follow-up: remove @MockBean(name="clickHouseSearchIndex") from AbstractPostgresIT so the real bean graph is exercised by alerting ITs (and add a SpringContextSmokeIT that loads the context with no mocks). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -123,9 +123,14 @@ public class StorageBeanConfig {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SearchIndex clickHouseSearchIndex(
|
||||
public ClickHouseSearchIndex clickHouseSearchIndex(
|
||||
TenantProperties tenantProperties,
|
||||
@Qualifier("clickHouseJdbcTemplate") JdbcTemplate clickHouseJdbc) {
|
||||
// Return type is the concrete class so Spring exposes the bean under both
|
||||
// SearchIndex (for SearchIndexer) AND ClickHouseSearchIndex (for ExchangeMatchEvaluator,
|
||||
// which calls countExecutionsForAlerting — a method that exists only on the concrete type).
|
||||
// Declaring the return as the interface hides the concrete methods from autowire
|
||||
// matching and crashloops the app on startup.
|
||||
return new ClickHouseSearchIndex(tenantProperties.getId(), clickHouseJdbc);
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"root":["./src/config.ts","./src/main.tsx","./src/router.tsx","./src/swagger-ui-dist.d.ts","./src/vite-env.d.ts","./src/api/client.ts","./src/api/schema.d.ts","./src/api/types.ts","./src/api/queries/agents.ts","./src/api/queries/catalog.ts","./src/api/queries/diagrams.ts","./src/api/queries/executions.ts","./src/api/queries/admin/admin-api.ts","./src/api/queries/admin/audit.ts","./src/api/queries/admin/database.ts","./src/api/queries/admin/opensearch.ts","./src/api/queries/admin/rbac.ts","./src/api/queries/admin/thresholds.ts","./src/auth/loginpage.tsx","./src/auth/oidccallback.tsx","./src/auth/protectedroute.tsx","./src/auth/auth-store.ts","./src/auth/use-auth.ts","./src/components/layoutshell.tsx","./src/pages/admin/auditlogpage.tsx","./src/pages/admin/databaseadminpage.tsx","./src/pages/admin/oidcconfigpage.tsx","./src/pages/admin/opensearchadminpage.tsx","./src/pages/admin/rbacpage.tsx","./src/pages/agenthealth/agenthealth.tsx","./src/pages/agentinstance/agentinstance.tsx","./src/pages/dashboard/dashboard.tsx","./src/pages/exchangedetail/exchangedetail.tsx","./src/pages/routes/routesmetrics.tsx","./src/pages/swagger/swaggerpage.tsx"],"version":"5.9.3"}
|
||||
{"root":["./src/config.ts","./src/main.tsx","./src/router.tsx","./src/vite-env.d.ts","./src/api/client.ts","./src/api/environment-store.ts","./src/api/schema.d.ts","./src/api/types.ts","./src/api/queries/agent-metrics.ts","./src/api/queries/agents.ts","./src/api/queries/auth.ts","./src/api/queries/capabilities.ts","./src/api/queries/catalog.ts","./src/api/queries/commands.ts","./src/api/queries/correlation.ts","./src/api/queries/dashboard.ts","./src/api/queries/diagrams.ts","./src/api/queries/executions.ts","./src/api/queries/logs.ts","./src/api/queries/processor-metrics.ts","./src/api/queries/use-refresh-interval.ts","./src/api/queries/admin/admin-api.ts","./src/api/queries/admin/apps.ts","./src/api/queries/admin/audit.ts","./src/api/queries/admin/claim-mappings.ts","./src/api/queries/admin/clickhouse.ts","./src/api/queries/admin/database.ts","./src/api/queries/admin/environments.ts","./src/api/queries/admin/rbac.ts","./src/api/queries/admin/sensitive-keys.ts","./src/api/queries/admin/thresholds.ts","./src/auth/loginpage.tsx","./src/auth/oidccallback.tsx","./src/auth/protectedroute.tsx","./src/auth/requireadmin.tsx","./src/auth/auth-store.ts","./src/auth/use-auth.ts","./src/components/aboutmedialog.tsx","./src/components/contenttabs.tsx","./src/components/deploymentprogress.tsx","./src/components/enveditor.tsx","./src/components/environmentselector.tsx","./src/components/layoutshell.tsx","./src/components/pageloader.tsx","./src/components/startuplogpanel.tsx","./src/components/tabkpis.tsx","./src/components/tapconfigmodal.tsx","./src/components/env-convert.ts","./src/components/sidebar-utils.ts","./src/components/executiondiagram/detailpanel.tsx","./src/components/executiondiagram/executiondiagram.tsx","./src/components/executiondiagram/index.ts","./src/components/executiondiagram/types.ts","./src/components/executiondiagram/useexecutionoverlay.ts","./src/components/executiondiagram/useiterationstate.ts","./src/components/executiondiagram/tabs/bodytab.tsx","./src/components/executiondiagram/tabs/configtab.tsx","./src/components/executiondiagram/tabs/errortab.tsx","./src/components/executiondiagram/tabs/headerstab.tsx","./src/components/executiondiagram/tabs/infotab.tsx","./src/components/executiondiagram/tabs/logtab.tsx","./src/components/executiondiagram/tabs/propertiestab.tsx","./src/components/executiondiagram/tabs/timelinetab.tsx","./src/components/processdiagram/compoundnode.tsx","./src/components/processdiagram/configbadge.tsx","./src/components/processdiagram/diagramedge.tsx","./src/components/processdiagram/diagramnode.tsx","./src/components/processdiagram/errorsection.tsx","./src/components/processdiagram/minimap.tsx","./src/components/processdiagram/nodetoolbar.tsx","./src/components/processdiagram/processdiagram.tsx","./src/components/processdiagram/zoomcontrols.tsx","./src/components/processdiagram/index.ts","./src/components/processdiagram/node-colors.ts","./src/components/processdiagram/types.ts","./src/components/processdiagram/usediagramdata.ts","./src/components/processdiagram/usezoompan.ts","./src/hooks/usescope.ts","./src/pages/admin/adminlayout.tsx","./src/pages/admin/appconfigdetailpage.tsx","./src/pages/admin/auditlogpage.tsx","./src/pages/admin/claimmappingrulesmodal.tsx","./src/pages/admin/clickhouseadminpage.tsx","./src/pages/admin/databaseadminpage.tsx","./src/pages/admin/environmentspage.tsx","./src/pages/admin/groupstab.tsx","./src/pages/admin/oidcconfigpage.tsx","./src/pages/admin/rbacpage.tsx","./src/pages/admin/rolestab.tsx","./src/pages/admin/sensitivekeyspage.tsx","./src/pages/admin/userstab.tsx","./src/pages/agenthealth/agenthealth.tsx","./src/pages/agentinstance/agentinstance.tsx","./src/pages/appstab/appstab.tsx","./src/pages/dashboard/dashboard.tsx","./src/pages/dashboardtab/dashboardl1.tsx","./src/pages/dashboardtab/dashboardl2.tsx","./src/pages/dashboardtab/dashboardl3.tsx","./src/pages/dashboardtab/dashboardpage.tsx","./src/pages/dashboardtab/punchcardheatmap.tsx","./src/pages/dashboardtab/treemap.tsx","./src/pages/dashboardtab/dashboard-utils.ts","./src/pages/exchanges/exchangeheader.tsx","./src/pages/exchanges/exchangespage.tsx","./src/pages/exchanges/routecontrolbar.tsx","./src/pages/routes/routedetail.tsx","./src/pages/routes/routesmetrics.tsx","./src/pages/runtimetab/runtimepage.tsx","./src/pages/swagger/swaggerpage.tsx","./src/stores/tracing-store.ts","./src/utils/agent-utils.ts","./src/utils/attribute-color.ts","./src/utils/config-draft-utils.ts","./src/utils/diagram-mapping.ts","./src/utils/format-utils.ts"],"version":"5.9.3"}
|
||||
Reference in New Issue
Block a user