Skip to content

test(playwright): scope the SearchRBAC no-result assertion to its entity category - #30800

Merged
ShaileshParmar11 merged 1 commit into
1.13from
fix/searchrbac-scope-no-result-113
Aug 1, 2026
Merged

ShaileshParmar11 merged 1 commit into
1.13from
fix/searchrbac-scope-no-result-113

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Table Column > User without permission fails deterministically on both 1.13 AUT runs, in two different ways that share one cause:

MySQL       expect(locator).not.toBeAttached() failed
            locator('[data-testid="entity-header-display-name"]')
              .filter({ hasText: 'user_ida06c5f92' })   — was attached

PostgreSQL  expect(locator).toBeVisible() failed
            getByTestId('no-search-results').getByText('No result found.')

Root cause

searchForEntityShouldWorkShowNoResult searches globally, then asserts absence against whatever entity category Explore happens to be showing. A match from an unrelated category leaves a result attached and keeps the "no results" placeholder from rendering — so the two failures above are the same defect observed from either side.

Its sibling searchForEntityShouldWork already selects the category before asserting presence:

await page.getByRole('menuitem').filter({ hasText: entityName }).click();

The negative-case helper never got the same treatment.

Fix

Apply the same scoping to searchForEntityShouldWorkShowNoResult and pass the category from both call sites (entity.name and 'Columns', matching what the positive helper is already given). The absence assertion is then made against the category under test rather than the whole index.

This is not a port of #30768

Worth stating plainly, since that was the obvious assumption: #30768's change is already on 1.13. searchForEntityShouldWork here already takes entityName and clicks the category, and both call sites already pass it. #30768 only touched the positive-case helper; the negative one was missed on every branch. So there is nothing to backport — this is the missing half.

Type of change:

  • Bug fix

Tests:

  • tsc clean — which also confirms both call sites were updated, since the new parameter is required.
  • Prettier clean.
  • Not run against a live stack. SearchRBAC needs the two permission-scoped users and RBAC search settings, which I don't have an environment for. This is reasoned from the two failure signatures plus the existing positive-case helper it mirrors.

One thing a reviewer with an environment should sanity-check: that the entity-category menu item renders even when the scoped category has zero results for this user. The positive helper only ever clicks it when results exist. If Explore hides empty categories, this needs the click guarded instead — I'd rather that be verified than assumed.

Also on this branch

The same unscoped-search shape exists on main and 2.0, where Table Column > User with permission flakes. Worth the same fix there once this is confirmed.

Note: ui-checkstyle and Validate PR Metadata will be red. ui-checkstyle fails for every UI PR on 1.13 (see #30781 and #30726, both merged through it) — it is not caused by this change, and neither check is required.

🤖 Generated with Claude Code

Greptile Summary

The PR updates the negative SearchRBAC helper to select the requested entity category before checking that a permission-restricted entity and the category’s results are absent.

  • Adds a required entity-category argument to searchForEntityShouldWorkShowNoResult.
  • Updates the general entity and table-column test cases to pass their expected categories.
  • Mirrors the category-selection behavior already used by the positive-search helper.

Confidence Score: 5/5

The PR appears safe to merge based on the accepted review findings, with no unacknowledged actionable defect remaining.

The helper signature and both repository call sites are consistent, and the only concrete failure mechanism identified is already expressly documented by the author as requiring environment validation.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/utils/searchRBAC.ts Adds category selection to the negative-search helper; the known empty-category rendering concern is already explicitly called out in the PR description.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/SearchRBAC.spec.ts Updates both helper call sites with the appropriate entity-category labels.

Reviews (1): Last reviewed commit: "test(playwright): scope the SearchRBAC n..." | Re-trigger Greptile

…ity category

"Table Column > User without permission" fails deterministically on both
1.13 AUT runs, in two different ways that share one cause:

  MySQL      expect(locator).not.toBeAttached() failed
             locator('[data-testid="entity-header-display-name"]')
               .filter({ hasText: 'user_ida06c5f92' }) -- was attached
  PostgreSQL expect(locator).toBeVisible() failed
             getByTestId('no-search-results').getByText('No result found.')

searchForEntityShouldWorkShowNoResult searches globally and then asserts
absence against whatever entity category Explore happens to be showing.
A match from an unrelated category leaves a result attached and the
"no results" placeholder unrendered -- the two failures above are the
same defect seen from either side.

Its sibling searchForEntityShouldWork already selects the category
before asserting presence (#30768). Apply the same scoping here and pass
the category from both call sites, so the negative assertion is made
against the category under test rather than the whole index.

Note this is not a port of #30768: that change is already on 1.13, and
it only touched the positive-case helper. The negative one was missed.

Co-Authored-By: Claude Opus 5 <[email protected]>
@ShaileshParmar11
ShaileshParmar11 requested a review from a team as a code owner August 1, 2026 12:00
@github-actions

github-actions Bot commented Aug 1, 2026

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 Aug 1, 2026
@gitar-bot

gitar-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Scopes the SearchRBAC no-result assertion to its specific entity category to fix deterministic test failures caused by global search indexing. No issues found.

Options

Display: compact → Showing less information.

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

Compact
gitar display:verbose         

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

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

❌ UI Checkstyle Failed

❌ Antd + Less Deprecation Guard

A new antd import or new .less file was added. Use UntitledUI + Tailwind for new work.

Affected files

at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
at Function._load (node:internal/modules/cjs/loader:1211:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
at node:internal/main/run_main_module:36:49 {


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

make ui-checkstyle-changed

@ShaileshParmar11
ShaileshParmar11 merged commit 804f25c into 1.13 Aug 1, 2026
53 of 56 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the fix/searchrbac-scope-no-result-113 branch August 1, 2026 12:24
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant