Catalog: keep the bucket scope on legacy Athena redirects (5217 stack 8/9) - #5266
Catalog: keep the bucket scope on legacy Athena redirects (5217 stack 8/9)#5266nl0 wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## stack/5217-7-athena-workgroup-seam #5266 +/- ##
======================================================================
+ Coverage 36.01% 36.02% +0.01%
======================================================================
Files 741 741
Lines 23836 23841 +5
Branches 6438 6438
======================================================================
+ Hits 8584 8589 +5
Misses 13520 13520
Partials 1732 1732
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:
|
bdd4153 to
288178f
Compare
288178f to
9dabf9e
Compare
9dabf9e to
5f9412a
Compare
5f9412a to
5913b59
Compare
5913b59 to
13641a9
Compare
13641a9 to
e7abd0d
Compare
e7abd0d to
d2c4c96
Compare
d2c4c96 to
9ce766b
Compare
9ce766b to
23ad361
Compare
Local code review — findings and dispositionsRan a local review of this layer only ( Accepted — fixed here
Declined
GreptileNo Greptile review or inline comments had appeared on this PR at the time of writing, across the full polling budget. Proceeded on the local review alone. |
…directs A legacy `/b/:bucket/queries/athena/...` URL redirected into the workspace console with the bucket segment dropped, so the bucket's `ui.athena` preferences no longer applied — the reader landed in the same console, unscoped. The bucket segment now becomes the console's `?bucket=` scope param on every athena shape, and the rest of the search is preserved alongside it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
addresses review finding f12
`mkSearch({ bucket, ...parseSearch(search, true) })` spread the incoming search
*after* the route's bucket, so a `?bucket=` riding along on the legacy URL
overrode the bucket the URL was actually about:
`/b/source/queries/athena/primary?bucket=other` redirected into the console
scoped to `other`, and loaded `other`'s `ui.athena` preferences. The root
redirect had the same spread order.
Both reversed. The bucket in the path is the route being redirected from and is
authoritative; a query param on a per-bucket route cannot outrank it.
The existing param-preservation test asserted the rendered order of the query
string, which this reverses. Order carries no meaning to any reader of these
params, so the expectation moves rather than the fix.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
addresses review findings f13, f44, f27 The redirect's own entry. Legacy per-bucket athena deep links land somewhere new after this change, and nothing in the omnibus entry said so — the premise the Athena preference fix rests on was itself an undisclosed change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ion redirects
Forwarding the whole incoming query string onto those two shapes carried a
`?table=` with it, and TabulatorTables renders outside the execution branch: its
one-shot autofill then overwrote the editor — and the catalog and database
selectors — with a SELECT unrelated to the results on screen. Neither route
declares a search param other than the scope, and no producer puts one there;
the athena root is the only shape that takes a `?table=` deep link, and it keeps
going through the builder that whitelists it.
Dropping the parse also takes these two routes back off a crash path they had no
reason to be on: the browser bundle resolves `querystring` to the npm shim, whose
decode is an unguarded `decodeURIComponent`, so a stray `%` in the query string
("?q=100%") threw URIError out of the redirect and unwound to the error boundary.
The tests run against Node's lenient builtin and cannot see it.
The spec comments claimed a `?bucket=` on the incoming URL used to outrank the
path on these shapes. It never did — before this branch they dropped the search
entirely and landed unscoped; only the athena root honoured the param.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`ui.athena` holds one preference, `defaultWorkgroup`, and `useWorkgroup` reads a workgroup named in the path ahead of it. Both shapes this change touches always name one, so the entry's stated payoff cannot follow from it — the athena root is where that preference applies, and it already carried the scope. Claim the scope itself instead, and tag the entry `[Fixed]` to match both authoring commits and the neighbouring entry of the same shape. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
afb72eb to
388ded0
Compare
Description
A legacy
/b/:bucket/queries/athena/...URL redirects into the workspace-levelconsole. It dropped the bucket segment on the way, so the bucket's
ui.athenapreferences stopped applying — the reader landed in the same console, unscoped.
The bucket segment now becomes the console's
?bucket=scope param on everyathena shape, with the rest of the search preserved alongside it.
This is a behaviour change to legacy deep links, and it deserves saying out
loud: a bookmarked
/b/:bucket/queries/athena/:workgroupnow lands somewheredifferent from before — same path, but with
?bucket=set. Nothing in theprevious description or changelog said so, which is why this unit carries its own
entry.
Safe on its own. The param is carried and, until PR 9, ignored. That makes
this the producer half of a producer/consumer pair, and it is deliberately first:
PR 9 alone would leave the preference dead for exactly the legacy-URL readers the
fix is for.
Review findings addressed
— the incoming query string was spread after the route's bucket, so a
?bucket=riding along on the legacy URL overrode the bucket the URL wasabout.
/b/source/queries/athena/primary?bucket=otherredirected into theconsole scoped to
otherand loadedother's preferences. Both sites had thesame spread order — the workgroup/execution helper and the root redirect — and
both are reversed. Three cases are pinned.
changelog. Splitting the change is what made this statable: it is this PR's
whole subject rather than one line in a six-subsystem diff.
Recorded:
hunk that changes it.
Verification
9 tests. The three added for f12 fail against the original spread order, as does
the param-preservation test whose expected string this PR updates — the query
string's param order reverses, which carries no meaning to any reader of these
params.
Position in the stack
PR 8 of 9, based on
stack/5217-7-athena-workgroup-seam.Part of the split of #5217 asked for in
f27.
Producer before consumer: this PR makes legacy URLs carry
?bucket=, and PR 9makes the console read it. The user-visible changelog claim about honoring
ui.athena.defaultWorkgrouplands with PR 9, because that is when it becomestrue.
TODO
🤖 Generated with Claude Code
Greptile Summary
This PR preserves the bucket scope when legacy per-bucket Athena links redirect into the workspace query console.
?bucket=parameter for root, workgroup, and execution links.Confidence Score: 5/5
The PR appears safe to merge, with the changed redirect behavior consistently applied and covered by focused tests.
The route-derived bucket is available on every affected legacy route, is applied after incoming parameters so it remains authoritative, and is serialized through the existing URL utility without an identified contract break.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Legacy[Legacy /b/:bucket/queries/athena link] --> Parse[Parse incoming search parameters] Parse --> Override[Apply route bucket as authoritative scope] Override --> Console[Workspace Athena console with ?bucket=:bucket] Console --> Preferences[Bucket ui.athena preferences]Reviews (1): Last reviewed commit: "docs(changelog): entry for the legacy re..." | Re-trigger Greptile