Repository navigation
feat(explorer): mark failed history runs and split UNION scopes in column usage - #1542
Open
shu-chen-dot-ca wants to merge 1 commit into
Open
shu-chen-dot-ca wants to merge 1 commit into
shu-chen-dot-ca wants to merge 1 commit into
Conversation
| @@ -462,6 +468,11 @@ export function isUsageComplete(result: ColumnUsageResult): boolean { | |||
| type Translate = (key: string, options?: Record<string, unknown>) => string; | |||
|
|
|||
| /** The qualified name shown for the target, e.g. `public.orders.customer_id`. */ | |||
Contributor
There was a problem hiding this comment.
SUGGESTION: Misplaced doc comment
isFailedRun was inserted between the JSDoc for formatUsageTarget and the function itself, so this comment now sits above isFailedRun and formatUsageTarget has none. Move isFailedRun (and its comment) above this line.
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Merge after optional fix Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (21 files)
Fix these issues in Kilo Cloud Reviewed by claude-sonnet-5.5 · Input: 260 · Output: 2.1K · Cached: 338K Review guidance: REVIEW.md from base branch |
This branch has not been deployed
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.
Follow-up to #1479, with the points @debba listed there as follow-ups (7, 3 and the component tests from 6, repeated in the approving review).
What changed
utils/columnUsageCollector.ts,ColumnUsageModal): history evidence now keeps the entry'sstatusanderror. A failed run gets a "Failed run" tag in the panel, with its error message under the title. The copied summary only adds the tag, not the error text, since errors often quote values (duplicate key value (email)=(...)), the same reason the summary never has raw SQL. The confidence is unchanged: the SQL still says what it says about the column.utils/columnUsage.ts):computeScopesnow starts a sibling query level after a set operator, with the same parent, so each side resolves unqualified columns against its own tables.SELECT customer_id FROM public.orders UNION SELECT customer_id FROM public.archivenow gives one parsed match instead of twoseveral-tables. Only the level's own frame splits (the statement or a(SELECT/(WITHparenthesis), so a set operator inside function arguments or other parentheses does not. Correlated references from either side still climb to the enclosing query.FROM ((SELECT ...) UNION (SELECT ...)) dwas read as a parenthesised join group, sodwas never bound andd.customer_idcame out asunresolved-qualifier. A parenthesis whose first inner query is followed by a set operator is now a derived table, like((SELECT ...)) d.columnUsage.failedRunin all 13 locales.Tests
tests/components/modals/ColumnUsageModal.test.tsx(new): initial focus on Close, Stop between lookups (remaining sources cancelled, their lookups never called), an unexpected collector failure settling every source as failed and recovering on Search again, Open going to the referenced table in the key's schema, Open in editor without running the query, and the failed-run tag with its error on only the failed entry.SidebarColumnItem.test.tsx: the column menu opens with Show Usage whencanManageis false (without Modify/Delete), opens the panel for that column, table, schema and database, and has no menu on a view column.columnUsage.test.ts: UNION, UNION ALL, INTERSECT, EXCEPT and Oracle MINUS, both orders of the sides, a join inside one side (stillseveral-tables), a UNION inside a subquery and inside a derived table with and without parentheses per side, a correlated reference from the second side, and a parenthesised join group still read as one.columnUsageCollector.test.ts:statusanderroron history evidence, and the summary tagging failed runs without the error text.RotateCwwas missing from thelucide-reactmock intests/setup.ts, which the modal test needed.The new tests for the failed tag and UNION scopes fail on main (4 of them); the others cover behaviour that already worked.
Checks:
pnpm run typecheck && pnpm run lint && pnpm run lint:theme && pnpm run format:check && pnpm run web:boundaries && pnpm run web:packaging && pnpm run web:docs && pnpm run web:manual-parity && pnpm run test:contrast && pnpm run build && pnpm exec vitest --config packages/web-ui/vitest.config.ts run --maxWorkers=2pass: 578 files, 9458 tests.Manual check with Tabularis Web (this branch's
diston a nightly binary) against SQLite, with a history holding a failed query and a UNION overordersandarchive; screenshots oforders.customer_idbelow.GitNexus: upstream
impactofcomputeScopesreports HIGH because it reaches three clusters, but they arebuildModel,analyseStatementandfindColumnReferencesin the same file, used only by the column usage collector.collectColumnUsage,formatColumnUsageSummaryandColumnUsageModalare LOW.Screenshots
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.