Drill-XXXX: Refactor User Interface - #3037
Draft
cgivre wants to merge 235 commits into
Draft
Conversation
cgivre
force-pushed
the
feature/sqllab-react-ui
branch
from
March 9, 2026 13:45
080ba0b to
36af30f
Compare
cgivre
force-pushed
the
feature/sqllab-react-ui
branch
2 times, most recently
from
March 25, 2026 13:50
33fb68e to
34bfc23
Compare
cgivre
force-pushed
the
feature/sqllab-react-ui
branch
from
June 16, 2026 14:20
1b68007 to
bc4e985
Compare
cgivre
force-pushed
the
feature/sqllab-react-ui
branch
from
June 24, 2026 03:47
facc35c to
ff3d719
Compare
handleSave no longer falls through to createSavedQuery when the "Save as" mode is view/materialized_view, which previously saved a plain, mislabeled query and discarded the schema/replace inputs. Also reset mode back to 'query' in the save mutation's onSuccess handler so the permanently-mounted dialog doesn't reopen in a stale view mode after a successful save.
…ew-mode guard The test selected the View radio but never filled the required schema and name fields, so form.validateFields() rejected before handleSave ever reached the isViewMode guard. That let createSavedQuery go uncalled regardless of whether the guard existed, so the test passed against broken code too. Now the test fills the view Name input and picks a mocked schema from the Select, ensuring the assertion depends on the guard actually short-circuiting the save.
Add createViewFromQuery to run the CREATE VIEW/MATERIALIZED VIEW DDL and link the result to the active project, reporting a partial failure rather than throwing if only the project-link step fails. Wire it into SaveQueryDialog's handleSave, replacing the placeholder guard that no-opped view mode. Give ProjectDetailPage real labels for view and materialized_view datasets instead of falling through to "Table".
…ring and labels The project dataset allow-list only allow-listed type 'table', so a view or materialized view created inside a project was silently stripped from the schema tree instead of appearing alongside regular tables. The data sources page also mislabeled both new types as plain 'Table'. Widen both ternary/ condition chains to treat 'view' and 'materialized_view' the same as their sibling handling elsewhere (e.g. ProjectDetailPage).
Extract the datasetAllowList useMemo body in SchemaExplorer into a pure buildDatasetAllowList() function so the fix that treats 'view' and 'materialized_view' datasets like 'table' datasets (otherwise a newly created view silently drops out of the project-scoped schema tree) can be unit tested without rendering the component.
The Bug 1 test drove an antd Select through userEvent, whose click fires a
full pointer sequence (pointerover/down/focus/up/click) each wrapped in
act() with microtask flushes. On a Modal+Select that re-renders per event
this compounded to ~4s in isolation and crossed the 5s per-test timeout
under the full suite's parallel CPU load — it passed only when run alone,
so a single local run reported green while CI failed.
Drive both tests with synchronous fireEvent instead, which exercises the
same handlers without the pointer-sequence overhead: Bug 1 drops to
~2.5-3.5s. Both tests stay non-vacuous, mutation-verified — breaking the
isViewMode branch fails Bug 1, removing setMode('query') from onSuccess
fails Bug 2. A 10s per-test timeout adds headroom for slower CI hardware,
not to mask a hang.
Also fix the getComputedStyle test shim, which passed the pseudo-element
argument straight through and so suppressed nothing; jsdom logged a "Not
implemented" error on every antd popup alignment, flooding CI output.
Drill enforces via TestforBaseTestInheritance that every test class with a @test method extends org.apache.drill.test.BaseTest, which installs the Protobuf and Guava patchers all Drill tests depend on. TestViewTargets was a plain class, so the meta-test failed. BaseTest is a lightweight base (a static block only, no cluster), matching how the sibling TestMetadataResources reaches it via ClusterTest.
Bump scannedAt and persist it on the unchanged-snapshot path in scan() so a stable schema's freshness clock actually resets instead of forcing a rescan on every read past STALE_INTERVAL_MS. Memoize the ProjectSchemaCache instance returned by get() so concurrent requests share one monitor for the synchronized methods, instead of each getting its own lock. Lowercase plugin names before the excluded-plugin set check to match the sibling convention in MetadataResources. Drop the redundant get-before-delete in removeProject since Store.delete already no-ops on a missing key. Add a regression test pinning the staleness-reset fix.
ZookeeperPersistentStore.delete() throws DrillRuntimeException (wrapping KeeperException.NoNodeException) when the key does not exist, unlike InMemoryStore/LocalPersistentStore which no-op silently. Restore the existence check before deleting so removeProject is safe across all PersistentStore backends, including ZK-coordinated clusters.
Prospector now renders each project dataset's cached tables and columns (via ProjectSchemaCache.peek, never scan) into the system prompt, and the tool-use instructions are softened to prefer that cached schema over a live list_schemas/get_schema_info round-trip, falling back to live discovery only when a needed table or column is not listed.
buildSchemaCacheBlock rendered cached tables/columns uncapped, unlike the sibling buildProjectBlock which truncates at PROJECT_BLOCK_MAX_CHARS. A project referencing several large schemas (up to 500 tables each) could bloat the system prompt, which is re-sent on every tool round. Add SCHEMA_CACHE_BLOCK_MAX_CHARS (4000, a larger budget since the schema listing is the high-value payload) and truncate through the same helper. Also replace inline java.util.Set/HashSet with proper imports.
Finding #1: MetadataResources.resolveUser returned the raw principal name (nullable/empty) while ProspectorResources.resolveUser normalizes null context, null principal, and empty names to "anonymous". Delete the divergent MetadataResources.resolveUser and call the package-private ProspectorResources.resolveUser at the cachedSchemaFor gate so the metadata cache uses the same user resolution as Prospector. Drop the now unused Principal import. Finding #2: Add automated canRead-deny regression tests on the cache serve paths. Seed a project owned by another user directly into the projects store (the harness authenticates as anonymous, so there is no HTTP path to create an unreadable project) and seed its cache with a fake table the live scan can never return. Assert GET /schema-cache returns 403 and that GET /metadata/.../tables does not leak the cache-only table. Both were confirmed non-vacuous by temporarily bypassing the gates and observing the tests fail.
Two independent bugs in the dashboard creation flow: Dashboards created from a project's dashboards page were never linked to the project. The create mutation called createDashboard and stopped, while the project page filters on project.dashboardIds, so a freshly saved dashboard never appeared there. Link it on create, mirroring what ExportImportModal already does. Opening a dashboard from the global dashboards list rendered "Dashboard not found". The global route declared its parameter as :id while DashboardViewPage reads dashboardId, so the id was undefined, the query stayed disabled, and the not-found branch rendered. Rename the route parameter to :dashboardId to match the component and the project route. Also fix the same orphaning in Prospector's create_dashboard tool, which had diverged from the create_visualization tool right above it, and add tests covering the project link.
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.
DRILL-XXXX: Refactor User Interface
Description
This PR refactors Drill's UI and refactors the Query view, adds visualizations and dashboards and in general makes Drill much more user friendly.
Documentation
(Please describe user-visible changes similar to what should appear in the Drill documentation.)
Testing
(Please describe how this PR has been tested.)