Skip to content

Fixes 33548: use the tour's mock permissions instead of fetching real ones - #33550

Open
harshach wants to merge 1 commit into
mainfrom
harshach/tour-skip-permission-fetch
Open

harshach wants to merge 1 commit into
mainfrom
harshach/tour-skip-permission-fetch

Conversation

@harshach

@harshach harshach commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #33548. Salvaged from the closed PR #33248 (tracking: #33528).

The guided tour renders a mock table that does not exist on the server. TableDetailsPageV1 already
knows that for the entity fetch:

Boolean(tableFqn && canViewTableInQuery && !isTourOpen && !isTourPage),   // line 242

but both useEntityPermissions calls ran unconditionally — so during the tour the page asked the API
for permissions on a fully-qualified name with no entity behind it, and then drove the tour's tabs
from whatever came back.

Meanwhile mockTablePermission, written for exactly this purpose in mockTourData.constants.ts, was
dead code — nothing imported it — and it lacked ViewDataProfile.

The visible symptom: step 13 of the tour, the profiler step, renders an empty panel. The tour's
own spec advanced through step 13 without asserting anything was there.

This disables both permission calls for the tour through the hook's existing { enabled } option and
takes the tour's grants from mockTablePermission (with ViewDataProfile: true added). No request is
issued for the mock FQN, and the permission cache no longer gains an entry for a non-existent entity.

Type of change:

  • Bug fix

High-level design:

useEntityPermissions already accepts { deleted, enabled } on main, so this needs no hook change —
enabled: !isTourDataset at both call sites. The mock grants are selected in a useMemo so the tour
value is stable and the fetched value flows through unchanged outside the tour. isTourDataset
replaces the repeated isTourOpen || isTourPage expression.

Tests:

Use cases covered

  • Opening the guided tour and reaching the profiler step shows profiler content.
  • Outside the tour, table permissions are fetched exactly as before.

Unit tests

TableDetailsPageV1.test.tsx asserts the hook is called with { enabled: true } outside the tour.

Test Suites: 1 passed, 1 total
Tests:       21 passed, 21 total

Backend integration tests

Not applicable — UI only.

Ingestion integration tests

Not applicable.

Playwright (UI) tests

playwright/e2e/Flow/Tour.spec.ts now asserts #profilerDetails is visible at step 13 — the spec
previously advanced through that step without checking anything, which is why the empty panel went
unnoticed.

Manual testing performed

  1. yarn test src/pages/TableDetailsPageV1/TableDetailsPageV1.test.tsx — 21 passed.
  2. yarn lint:base on all four changed files — 0 errors (16 pre-existing
    react-hooks/exhaustive-deps warnings in this file, none at the changed lines).
  3. npx prettier --check on all four — "All matched files use Prettier code style!".

UI screen recording / screenshots:

Not attached — the change is a permission-source swap with no new UI. The behaviour it restores is
asserted by the Tour.spec.ts step-13 check above. Happy to record the tour if a reviewer wants it.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #33548.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable.
  • For UI changes: see the note above.
  • I have added tests and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code

RetriggerConfidence Score: 4/5

The PR should not merge until all tour permission consumers use grants consistent with the new mock-permission source.

Findings

  1. P1 Tour permission flags stay false
Summary

This PR prevents real table-permission requests for the guided-tour dataset, supplies mock profiler permission, and strengthens the profiler tour assertion.

  • Introduces a shared isTourDataset condition and disables both permission queries during the tour.
  • Selects mockTablePermission for child components and adds ViewDataProfile.
  • Adds a Playwright assertion that profiler content is visible.
  • Leaves derived permission flags sourced from the disabled hooks, causing inconsistent permissions for other tour tabs.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Table details page] --> B{Tour dataset?}
  B -- No --> C[Fetch entity permissions]
  C --> D[Raw permissions and derived flags]
  B -- Yes --> E[Disable permission queries]
  E --> F[Raw permissions replaced with tour mock]
  E --> G[Derived flags remain all false]
  F --> H[Profiler uses mock ViewDataProfile]
  G --> I[Queries shows permission error]
  G --> J[Lineage receives no edit access]
Loading

Reviews (1) · Last reviewed commit: "Fixes 33548: use the tour's mock permiss..."

… ones

TableDetailsPageV1 already skips the entity fetch during the guided tour, but
both useEntityPermissions calls ran unconditionally - so the page asked the API
for permissions on a fully-qualified name with no entity behind it, then drove
the tour's tabs from whatever came back.

mockTablePermission, written for exactly this in mockTourData.constants.ts, was
dead code: nothing imported it. It also lacked ViewDataProfile, which is why
#profilerDetails never rendered and step 13 of the tour showed an empty panel.

Disable both permission calls for the tour through the hook's existing
{ enabled } option, and take the tour's grants from mockTablePermission with
ViewDataProfile added. No request is issued for the mock FQN and the permission
cache no longer gains an entry for a non-existent entity.

Tour.spec.ts now asserts #profilerDetails is visible at step 13 - it advanced
through that step without checking anything, which is why the empty panel went
unnoticed.

21 jest tests pass in TableDetailsPageV1.test.tsx.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

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.

@gitar-bot

gitar-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Fixes the guided tour's profiler step by disabling real permission fetches during the tour and using mock permissions instead. The useEntityPermissions hook now respects the tour state through its enabled option, eliminating spurious API calls for non-existent mock entities and allowing the tour's profiler panel to render correctly. Unit tests and Playwright assertions verify the fix.

Review coverage

Rules No rules evaluated

Functional validation Not enabled · Set up

Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

Comment on lines +197 to +199
} = useEntityPermissions(ResourceEntity.TABLE, tableFqn, {
enabled: !isTourDataset,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Tour permission flags stay false

During the tour, disabling useEntityPermissions makes every derived permission flag fall back to false, while only the aggregate tablePermissions object is replaced with mockTablePermission. As a result, the Queries tab shows a permission error because viewQueriesPermission remains false, and Lineage receives hasEditAccess={false} even though the tour mock grants EditAll. Derive these flags from the selected mock permissions or otherwise provide tour-specific derived values before disabling the queries.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 16 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 16 warning(s) across 1 changed file(s).

Count Rule
15 react-hooks/exhaustive-deps
1 openmetadata-imports/no-cross-page-imports
All findings
Location Rule Message
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:114:1 openmetadata-imports/no-cross-page-imports Page features must not import another page feature. Move shared code to components, hooks, interfaces, or pure utilities.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:171:6 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:220:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:445:6 react-hooks/exhaustive-deps React Hook useMemo has an unnecessary dependency: 'tableDetails.tags'. Either exclude it or remove the dependency array.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:469:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'setDqLineageData'. Either include it or remove the dependency array.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:515:9 react-hooks/exhaustive-deps The 'onTableUpdate' function makes the dependencies of useCallback Hook (at line 671) change on every render. To fix this, wrap the definition of 'onTableUpdate
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:515:9 react-hooks/exhaustive-deps The 'onTableUpdate' function makes the dependencies of useCallback Hook (at line 687) change on every render. To fix this, wrap the definition of 'onTableUpdate
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:542:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'onTableUpdate'. Either include it or remove the dependency array.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:556:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'onTableUpdate'. Either include it or remove the dependency array.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:616:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'customizedPage?.tabs' and 'feedCount'. Either include them or remove the dependency array.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:643:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 'tabs'. Either include it or remove the dependency array.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:643:6 react-hooks/exhaustive-deps React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:818:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:833:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array.
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:905:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'fetchActivityCount', 'fetchTaskCounts', and 'setTableDetails'. Either include them or remove the dependency arra
🟡 src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx:920:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'getTestCaseFailureCount' and 'tableDetails'. Either include them or remove the dependency array.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.91% (102520/140609) 57.86% (62356/107761) 58.93% (20399/34610)

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — workflow failed

Validated commit cbd058d1e8efa912b0d80d5250e3383c96fd1672 in Playwright run 35293430809, attempt 1.

✅ 4471 passed · ❌ 1 failed · 🟡 9 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky

Action needed: test(s) failed on every attempt against this PR’s validated commit — see Genuine Failures below. These are test failures, not CI budget or infrastructure issues.

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 34m 50s

⏱️ Max setup 4m 54s · max shard execution 19m 17s · max shard-job elapsed before upload 22m 53s · reporting 19s

🌐 220.21 requests/attempt · 2.23 app boots/UI scenario · 40.10% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 40.1% (convergence target: at most 15%).
  • Browser traffic was 220.21 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.23 per UI scenario (10628 boots / 4768 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 67 0 0 0 0 0
✅ Shard advanced-search-02 63 0 0 0 0 0
✅ Shard chromium-01 163 0 0 0 0 0
🔴 Shard chromium-02 154 1 0 0 0 0
✅ Shard chromium-03 166 0 0 0 0 0
🟡 Shard chromium-04 176 0 1 0 0 0
✅ Shard chromium-05 145 0 0 0 0 0
✅ Shard chromium-06 163 0 0 0 0 0
🟡 Shard chromium-07 142 0 1 0 0 0
✅ Shard chromium-08 169 0 0 0 0 0
✅ Shard chromium-09 172 0 0 0 0 0
✅ Shard chromium-10 199 0 0 0 0 0
✅ Shard chromium-11 162 0 0 1 0 0
🟡 Shard chromium-12 166 0 1 0 0 0
✅ Shard chromium-13 170 0 0 0 0 0
✅ Shard chromium-14 145 0 0 0 0 0
✅ Shard chromium-15 140 0 0 0 0 0
✅ Shard chromium-16 165 0 0 0 0 0
🟡 Shard chromium-17 180 0 2 0 0 0
✅ Shard chromium-18 168 0 0 0 0 0
✅ Shard chromium-19 159 0 0 0 0 0
🟡 Shard chromium-20 152 0 1 0 0 0
🟡 Shard chromium-21 168 0 1 0 0 0
✅ Shard chromium-22 150 0 0 0 0 0
🟡 Shard chromium-23 165 0 1 0 0 0
🟡 Shard chromium-24 170 0 1 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 66 0 0 0 0 0
✅ Shard import-export-02 84 0 0 0 0 0
✅ Shard ingestion-01 49 0 0 0 0 0
✅ Shard ingestion-02 49 0 0 0 0 0
✅ Shard reindex-01 28 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

Genuine Failures (failed on all attempts)

Flow/Tour.spec.tsTour should work from help section (shard chromium-02)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoHaveText�[2m(�[22m�[32mexpected�[39m�[2m)�[22m failed  Locator: locator('[data-tour-elem="badge"]') Expected: �[32m"13"�[39m Timeout: 30000ms Error: element(s) not found  Call log: �[2m  - Expect "toHaveText" with timeout 30000ms�[22m �[2m  - waiting for locator('[data-tour-elem="badge"]')�[22m 
🟡 9 flaky test(s) (passed on retry)
  • Pages/ExplorePageRightPanel.spec.tsShould verify deleted tag not visible in tag selection for databaseSchema (shard chromium-04, 1 retry)
  • Features/ContextCenterArticles.spec.tsmultiple articles hold independent drafts simultaneously (shard chromium-07, 1 retry)
  • Features/GlobalPageSize.spec.tsPage size should persist across different pages (shard chromium-12, 1 retry)
  • Pages/UserDetails.spec.tsAdmin user can edit teams from the user profile (shard chromium-17, 1 retry)
  • Pages/UserDetails.spec.tsCreate team with domain and verify visibility of inherited domain in user profile after team removal (shard chromium-17, 1 retry)
  • Features/UserProfileOnlineStatus.spec.tsShould not show online status for inactive users (shard chromium-20, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.tsShould remove user owner for knowledgeCenter (shard chromium-21, 1 retry)
  • Flow/NotificationAlerts.spec.tsSingle Filter Alert (shard chromium-23, 1 retry)
  • Features/ColumnBulkOperations.spec.tsshould not count aggregate parent row in drawer selected count (shard chromium-24, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

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

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guided tour fetches real permissions for its mock table, so the profiler step renders empty

2 participants