Skip to content

fix(lineage): route platform lineage settings through the lineage store - #33197

Merged
chirag-madlani merged 3 commits into
mainfrom
fix-platform-lineage-depth-refetch
Sep 11, 2026
Merged

chirag-madlani merged 3 commits into
mainfrom
fix-platform-lineage-depth-refetch

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator
Screen.Recording.2026-09-11.at.3.07.39.PM.mov

Summary

On /lineage, opening the settings modal and changing Upstream / Downstream Depth silently produced no network call — the graph did not refetch.

Root cause: PlatformLineage.tsx kept lineageConfig in a local useState. But LineageProvider's fetch effect reads lineageConfig from the shared Zustand useLineageStore and re-runs fetchPlatformLineage when it changes. Writing to local state left the store untouched, so the effect never fired. The entity-lineage view worked because CustomControls.component.tsx correctly writes to the store.

Fix: PlatformLineage.tsx now reads lineageConfig and setLineageConfig from useLineageStore (same pattern as CustomControls). Save → store write → provider effect → getPlatformLineage?upstreamDepth=…&downstreamDepth=… fires.

Flow after fix

  1. Global → store on mount: LineageProvider already seeds store.lineageConfig from appPreferences.lineageConfig.
  2. Land on /lineage: PlatformLineage reads config from the store — modal shows the global depth.
  3. User edits & saves: writes to store → provider's onPlatformViewUpdate fires → refetch with new depths.
  4. Unmount: provider's cleanup calls reset so the modal-scoped override doesn't leak across page navigations.

Test plan

  • Unit — openmetadata-ui/src/main/resources/ui/src/pages/PlatformLineage/PlatformLineage.test.tsx
    • New Lineage Store Integration describe: modal receives the store's lineageConfig; onSave calls store's setLineageConfig; onCancel does not.
    • Full suite: 45 tests pass.
  • Playwright — merged the duplicate playwright/e2e/Flow/PlatformLineage.spec.ts into playwright/e2e/Pages/Lineage/PlatformLineage.spec.ts (single file, two describes: Entity Lineage tab + Platform Lineage page (/lineage)).
  • Playwright regression — new test Settings depth change refetches platform lineage opens the modal on /lineage, sets both depths to 2, clicks OK, and asserts getPlatformLineage?...upstreamDepth=2&downstreamDepth=2 fires.
  • yarn lint:playwright — 0 errors on the touched spec.
  • Manual UI validation — recorded a GIF against the dev server (:3000 proxying :8585): initial fetch upstreamDepth=2&downstreamDepth=2, changed to 4/4 in the modal, saved, and confirmed GET /api/v1/lineage/getPlatformLineage?view=service&upstreamDepth=4&downstreamDepth=4&… fired and the graph re-rendered with more nodes.

Files changed

  • openmetadata-ui/src/main/resources/ui/src/pages/PlatformLineage/PlatformLineage.tsx — swap local state → store
  • openmetadata-ui/src/main/resources/ui/src/pages/PlatformLineage/PlatformLineage.test.tsx — new Lineage Store Integration tests
  • openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/PlatformLineage.spec.ts — merged specs + depth-refetch regression
  • openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PlatformLineage.spec.ts — deleted (consolidated)

🤖 Generated with Claude Code

The /lineage settings modal used to write into a local useState in
PlatformLineage, but the LineageProvider fetch effect reads
lineageConfig from the shared Zustand useLineageStore — so changing
upstream/downstream depth silently produced no network call. Wire the
page to the store directly (matching CustomControls for entity
lineage) so the save handler triggers a refetch.

Also merges the duplicate Flow/PlatformLineage.spec.ts into
Pages/Lineage/PlatformLineage.spec.ts, adds a Playwright regression
test that asserts getPlatformLineage refires with the new depths on
save, and covers the store wiring in PlatformLineage.test.tsx.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 762 → 762
- 0 added, 0 removed, 16 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/constant/sidebar.ts
  openmetadata-ui/src/main/resources/ui/playwright/e2e/fixtures/pages.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/sidebar.ts
  openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/CustomControls.component.tsx
  openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageConfigModal.tsx
  openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageLayers/LineageLayers.tsx
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/apiEndpoint.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/container.ts
  … and 6 more

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@chirag-madlani chirag-madlani added the To release Will cherry-pick this PR into the release branch label Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 1.13 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

Copy link
Copy Markdown

🤖 Backport to 2.0 failed. The conflict could not be resolved, so this change is not on that branch. Resolver run.

@gh-bot-collate

Copy link
Copy Markdown

🤖 Backport to 1.13 failed. The conflict could not be resolved, so this change is not on that branch. Resolver run.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants