CNS-137: un-gate the query history view in self-managed console builds - #38407
Open
jubrad wants to merge 2 commits into
Open
Conversation
The query history route redirected home and the nav item was hidden in self-managed builds. The feature code already handles self-managed, so drop both guards. With the nav item unconditional, the canViewQueryHistory plumbing in getNavItems is dead, so remove it. Adds tests covering the self-managed route and nav entry.
The Query History nav entry is now an unconditional literal in a static list, so a test asserting it is present validates nothing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear: https://linear.app/materializeinc/issue/CNS-137/console-un-gate-the-query-history-view-in-self-managed-builds
Problem
The console's query history view was hard-gated to Cloud: self-managed users hitting
/query-historywere silently redirected home, and the Monitoring > Query History nav item was hidden.Solution
Remove both gates. The feature code already supports self-managed (
QueryHistoryRouteshas a working self-managed branch that simply leaves the default user filter unset). With the nav item unconditional, thecanViewQueryHistoryplumbing throughgetNavItemswas dead, so it is gone too.Testing
ci/test/console/test.sh/ci/test/console/lint.shequivalents locally (yarn lint,yarn typecheck, vitest for the touched dirs). One new test, verified to fail without the change:AuthenticatedRoutes.test.tsxasserts/regions/:slug/query-historyrenders the page in a self-managed deployment instead of redirecting home. The nav entry is now an unconditional literal in a static list, so it gets no test.RBAC finding (requested by the issue)
A self-managed role without
mz_monitorgets the existingUnauthorizedState, not a blank page or error boundary. The privilege probe hardcodes builtin OIDs (16748mz_recent_activity_log, 16750mz_statement_lifecycle_history), both of which still matchsrc/pgrepr-consts/src/oid.rs, andisAuthorizedSelectorrequiresSELECTonmz_statement_lifecycle_history, which needsmz_monitor. That path is already covered by an existingQueryHistoryListtest and is deployment-mode agnostic.For the reviewer
UnauthorizedStatedoc link points at the Cloud access-control docs (/docs/security/cloud/access-control/manage-roles/). Pre-existing, but self-managed users can now reach it. Left alone to avoid colliding with CNS-138, which ownsQueryHistoryList.tsx.