Repository navigation
Fixes #38348: normalize pipeline query key so hover-prefetch warms detail page slot - #38385
Merged
Rohit0301 merged 2 commits intoNov 23, 2026
Conversation
… runs Replace the fetchQuery-based 'does not refetch' assertion with a mounted useQuery test using the app's real QueryClient settings (staleTime: 0). The new test asserts the prefetched cached data renders synchronously while a background refetch is in flight, matching the shipping page's stale-while-revalidate behavior the fix is meant to preserve.
Rohit0301
approved these changes
Nov 23, 2026
Rohit0301
deleted the
detail/bug-fix/fixes-38348-normalize-pipeline-query-key-so-hover-b2b70e
branch
November 23, 2026 05:36
1 task done
Rohit0301
added a commit
that referenced
this pull request
Nov 23, 2026
…tail page slot (#38385) (#38429) * fix(ui): normalize pipeline query key so hover-prefetch warms detail page * test(pipelineQuery): assert warm-cache paint while background refetch runs Replace the fetchQuery-based 'does not refetch' assertion with a mounted useQuery test using the app's real QueryClient settings (staleTime: 0). The new test asserts the prefetched cached data renders synchronously while a background refetch is in flight, matching the shipping page's stale-while-revalidate behavior the fix is meant to preserve. --------- (cherry picked from commit 9cfa30c) Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com>
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.
Detail bug report: View on Detail
Describe your changes:
Fixes #38348
I worked on the dead pipeline hover-prefetch in Explore because the prefetch and the pipeline detail page were building React Query cache keys with different whitespace in the
fieldselement, so the slot the prefetch populated was never the slot the page read — every hover fired aGET /pipelines/name/{fqn}?fields=...whose response was never consumed, and the detail page always painted from a cold cache instead of the warmed one.Type of change:
High-level design:
N/A — small change.
The fix is one normalization step at the cache-key boundary in
rest/queries/pipelineQuery.ts.pipelineQueryKey(fqn, fields)now appliesnormalizeFields(fields) = fields.replace(/\s+/g, '')to the third key element, so twofieldsstrings that differ only in whitespace (the prefetch's bare-commafollowers,tags,...vs the page's stray-spacefollowers, tags, owners,tasks, ...) collapse to the same React Query slot.pipelineQueryFnstill passes the original (un-normalized)fieldstogetPipelineByFqn, so request payloads are unchanged — the backend already strips whitespace (EntityUtil.Fields), so only the client cache key needed fixing.PREFETCH_PIPELINE_FIELDSis now exported so a unit test can enforce the previously comment-only "keep in sync withPipelineDetailsUtils.defaultFields" contract.Alternatives considered: importing
defaultFieldsdirectly intopipelineQuery.tsto share one source of truth — rejected because the file documents a circular-import concern (seedashboardQuery.ts), and normalizing at the key boundary is robust against any future caller-side formatting drift, not just the current one.Tests:
Use cases covered
ViewUsagepermission), so the detail page paints from the warm cache on click.GET /pipelines/name/{fqn}?fields=...per hover.ViewUsagepermission intentionally does not consume the prefetch slot (the prefetch requests the maximal field set; the page narrows) — this matches the documented best-effort Table prefetch behavior and is not regressed by the fix.PipelineDetailsUtils.defaultFieldsis now enforced by a test, so future edits to either side that drop a field will fail CI.['pipeline', fqn, ...]key-shape prefix used bySuggestionsProvidercache invalidation is preserved.Unit tests
openmetadata-ui/src/main/resources/ui/src/rest/queries/pipelineQuery.test.ts(new) — 15 tests coveringnormalizeFields,pipelineQueryKeynormalization + shape, a real-QueryClientprefetch↔page slot-synchronization integration (mocking onlygetPipelineByFqnat the API boundary), and a keep-in-sync guard comparing the prefetch field list againstPipelineDetailsUtils.defaultFields.pipelineQuery.ts:normalizeFields,pipelineQueryKey,pipelineQueryFn(indirectly via the QueryClient integration),prefetchPipelineByFqn, andprefetchPipeline.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
PipelineHoverPrefetch.spec.ts) was written and run during verification against a live local stack (see Manual testing) to confirm the prefetch fires and the detail page renders the entity header from the warm slot. It was not versioned because it requires a bespoke auth-bypass config (the standard suite'sauth.setupproject seeds eight test users and is too heavyweight to fold into this single-file fix without a broader fixture story); the Jest integration tests inpipelineQuery.test.tsuse a realQueryClientand stand as the regression guard that fails if the fix is reverted.Manual testing performed
./docker/run_local_docker.sh -m ui -d mysql -s false -i true -r true(withMAVEN_OPTS='-Xmx768m -XX:+UseSerialGC'to fit the 3.6 GB host). Verifiedcurl http://localhost:8585/api/v1/system/version→ HTTP 200 and the UI → HTTP 200.dist/assets/pipelineQuery-seg02ImL.jscontainsS=r=>r.replace(/\s+/g,"")andn=(r,i)=>["pipeline",r,S(i)]— i.e.normalizeFieldsapplied insidepipelineQueryKey.sample_airflow.customer_profiles_pipelinewith both the prefetch-sidefieldsstring (bare commas) and the page-sidefieldsstring (stray spaces fromPipelineDetailsUtils.defaultFields+,usageSummary). Both return HTTP 200, 1644 bytes, identical SHA-256 — confirming the backend tolerates whitespace and the cache key was the only gap.QueryClientcheck: a throwaway Jest integration test (now removed) calledprefetchPipeline(queryClient, FQN), then readqueryClient.getQueryData(pipelineQueryKey(FQN, defaultFields + ',usageSummary'))and got the prefetched fixture back;getPipelineByFqnwas called exactly once; the page key.toEqualedpipelineQueryKey(FQN, PREFETCH_PIPELINE_FIELDS). This is the same shape as the versionedpipelineQuery.test.tsintegration tests but driven against the live API contract.npx playwright install chromium+npx playwright install-deps chromiumto provision the browser and OS libs): signed in as admin, navigated to Explore → Pipelines tab, hovered a pipeline card, asserted the prefetch fired aGET .../pipelines/name/{fqn}?fields=followers,tags,owners,tasks,pipelineStatus,domains,dataProducts,votes,extension,usageSummary, then clicked the card and assertedentity-header-display-namerendered — the warm-cache instant-paint signal. Test passed. (Spec not versioned; see Playwright section above.)pipelineQueryKey(nonormalizeFields): the prefetch key's third element wasfollowers,tags,...while the page key's wasfollowers, tags, owners,tasks, ...—.toEqualbetween them returns false, so the versionedpipelineQueryKeytest and the keep-in-sync guard both fail onmain. A full negative-case validation against a rebuilt un-fixed Docker image was attempted but deferred — the server container serves from the JAR baked into its image (built with the fix), and serving an un-fixed bundle would require a full Mavenpackage+docker compose build openmetadata_serverrebuild that exceeded the time budget; the Jest guard covers the negative case directly.Routine gates all pass on the changed files: ESLint (
--no-error-on-unmatched-pattern), Prettier (--check), andyarn test(32/32 — the newpipelineQuery.test.tsplus the existingentityDetailQueryKeys.test.tsshape guard).yarn tsc:checkreports only a pre-existing error inutils/queryBuilderWidgets/OMSelectWidget.tsx(unrelated; not touched by this PR; confirmed pre-existing by stashing the fix and re-running tsc).UI screen recording:
Not applicable — this is a standalone performance bug fix with no user-visible UI surface change (no new UI element, layout, styling, or interaction). The fix restores an already-shipped hover-prefetch optimization; the visible effect is perceived-latency only. Per
CONTRIBUTING.mdand the template, standalone fixes may use "Not applicable — ".Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.docs/decisions/(see itsREADME.md). This description is gone fromgit logafter the squash-merge.The new
normalizeFields-at-the-key-boundary choice is a self-contained local convention forpipelineQuery.ts(mirrors the documented siblingdashboardQuery.tstwin case noted in the issue); it is not a durable cross-component contract that another repo must agree with, so no ADR is needed. The sibling Dashboard prefetch has the same whitespace mismatch and is out of scope per the bug report; a follow-up issue is recommended for it.Automatic Fixes PRs can be configured here.


Confidence Score: 5/5
The PR appears safe to merge, with the previous test gap addressed and no new actionable issues found.Summary
Normalizes whitespace in pipeline query keys so hover-prefetched data can be read by the detail page.
No new actionable issues were found. Previous finding #1 is fully addressed. Tests were not run during this review.
Reviews (2) · Last reviewed commit: "test(pipelineQuery): assert warm-cache p..." · Reviewed by Greptile