Carry the bucket scope through the workgroup/execution query redirects - #5234
Carry the bucket scope through the workgroup/execution query redirects#5234QuiltSimon wants to merge 8 commits into
Conversation
AthenaRootRedirect promotes the legacy bucket segment to the console's
`?bucket=` scope and spreads the rest of the search through. Its two
siblings in the same file did neither, so a legacy workgroup or execution
link landed on the global console with no bucket selected and any
`?table=` Tabulator deep link dropped.
The workgroup/execution url builders take their path segments
positionally, so the params ride as `search` on the redirect descriptor.
Two specs asserted the old behavior ("dropping the bucket") as intended;
they now assert the scope is carried, plus two new cases covering param
preservation.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #5234 +/- ##
===========================================
- Coverage 55.20% 34.94% -20.27%
===========================================
Files 872 741 -131
Lines 36766 23808 -12958
Branches 6429 6431 +2
===========================================
- Hits 20298 8319 -11979
+ Misses 14724 13745 -979
Partials 1744 1744
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| // bucket scope and any other params ride along as `search` on the redirect | ||
| // descriptor rather than through the url builder. | ||
| function withBucketScope(pathname, bucket, search) { | ||
| return { pathname, search: mkSearch({ bucket, ...parseSearch(search, true) }) } |
There was a problem hiding this comment.
When a legacy workgroup or execution URL contains a conflicting ?bucket=, spreading the parsed search after the path-derived bucket makes the query value win, causing Tabulator tables and generated query defaults to use a different bucket than the legacy route names.
| return { pathname, search: mkSearch({ bucket, ...parseSearch(search, true) }) } | |
| return { pathname, search: mkSearch({ ...parseSearch(search, true), bucket }) } |
Knowledge Base Used: Catalog client features
The header said these components were extracted unchanged and redirect 'exactly as before'. This branch changes two of their targets, so both clauses were false and would send someone debugging a bucket-scope regression looking elsewhere. Keep the constraint, cut the history. Co-Authored-By: Claude <noreply@anthropic.com>
Review of the first pass found three defects in it.
The path bucket lost to a stale `?bucket=` in the query string, because
the parsed search was spread after it — so a hand-edited or stale param
silently rescoped the console away from the bucket the link named.
Forwarding `?table=` onto an execution route fired TabulatorTables'
autofill, overwriting the editor contents that came from the execution's
own SQL with a SELECT unrelated to the results on screen. The execution
builder does not accept `table` at all now.
And the workgroup/execution redirects hand-built their search while the
bare-console one went through a builder that keeps only `{bucket, table}`,
so the three disagreed about which params survive. The two positional
builders now take the same opts object, sharing one AthenaConsoleOpts
type, and the hand-rolled helper is gone.
Co-Authored-By: Claude <noreply@anthropic.com>
Omit<AthenaConsoleOpts, 'table'> means a caller passing table gets a compile error instead of a silent drop, so the invariant the comment describes is enforced. Also drop a stale sentence describing a params argument neither builder has. Co-Authored-By: Claude <noreply@anthropic.com>
…-search # Conflicts: # catalog/CHANGELOG.md
…-search # Conflicts: # catalog/CHANGELOG.md
Found reviewing the 26.8.0 candidate.
containers/App/queryRedirects.jsxholds three sibling redirects from the legacy bucket-scoped query routes to the workspace-global console.AthenaRootRedirectis careful — it promotes the bucket segment to the console's?bucket=scope param and spreads the rest of the search through, with a comment saying why.AthenaWorkgroupRedirectandAthenaExecutionRedirectdid neither.So a bookmark or shared link to
/b/my-bucket/queries/athena/primarylanded on/queries/athena/primarywith no bucket selected, and any other param — a?table=Tabulator deep link, which the sibling's comment explicitly exists to keep alive — was dropped.The fix
The workgroup and execution url builders take their path segments positionally (
queriesAthenaWorkgroup(workgroup)), so there is no argument to thread params through. Both now build a{pathname, search}redirect descriptor via a small local helper, matching what the root redirect achieves through its builder.Tests
Two existing specs asserted the old behavior as intentional ("redirects an athena workgroup, dropping the bucket"); those assertions are updated, since that is exactly the behavior being corrected. Two new specs cover param preservation on both routes.
Verified as real regression tests rather than tautologies: reverting
queryRedirects.jsxto master and re-running fails exactly the 4 new/changed cases while the 3 pre-existing ones still pass.TZ=UTC npx vitest run app/containers/App/queryRedirects.spec.tsx— 7 passednpx tsc --noEmit -p .— cleanNotes
Ships with its
catalog/CHANGELOG.mdentry.🤖 Generated with Claude Code
Greptile Summary
This PR updates legacy bucket-scoped Athena workgroup and execution redirects to retain bucket and query-string state when entering the workspace-global console.
tablepreservation.Confidence Score: 4/5
The conflicting-bucket precedence should be fixed before merging because crafted or stale legacy links can open the Athena console in the wrong bucket context.
The new merge order lets incoming search state replace the bucket captured from the legacy route, and the resulting value directly controls the global Athena console’s table and query scope.
Files Needing Attention: catalog/app/containers/App/queryRedirects.jsx
Important Files Changed
bucketquery parameter to override the path-derived scope.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR A["Legacy /b/:bucket/queries/athena/:workgroup[/execution]?params"] --> B["BucketQueriesRedirect"] B --> C["withBucketScope"] C --> D["Global /queries/athena/:workgroup[/execution]?bucket=:bucket¶ms"] D --> E["Athena console"] E --> F["Bucket-scoped Tabulator tables and query defaults"]Reviews (1): Last reviewed commit: "Point the changelog entry at the actual ..." | Re-trigger Greptile
Context used: