Skip to content

fix(ui): account for system default persona fallback in Users persona removal e2e#29451

Merged
harsh-vador merged 1 commit into
mainfrom
fix-users-persona
Jun 25, 2026
Merged

fix(ui): account for system default persona fallback in Users persona removal e2e#29451
harsh-vador merged 1 commit into
mainfrom
fix-users-persona

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

What

Fix flaky-looking failure in Users.spec.ts › "Should handle default persona change and removal correctly". The final step asserted that after a user removes their default persona, the profile dropdown shows no default persona tag and no
checked radio.

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

Unit tests

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

Manual testing performed

UI screen recording / screenshots:

Not applicable.

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 #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Greptile Summary

This PR updates the "Should display default persona tag correctly" E2E test in Users.spec.ts to fix a flaky assertion caused by the system's default persona fallback behaviour after persona removal. The old code checked that the first persona label carries the default-persona-tag; the new code instead filters for persona2 by display name and asserts the absence of the tag and an unchecked radio on that label.

  • Assertion direction flipped: positive checks (tag visible on persona1) are replaced with negative checks (tag/radio absent on persona2), which is safer against the system auto-selecting a fallback persona but removes coverage of the positive display path.
  • Variable naming: removedDefaultPersonaLabel is semantically misleading in this test because persona2 was never set as the default in the beforeAll — the name fits the removal test (Should handle default persona change and removal correctly) better than this one.

Confidence Score: 4/5

Safe to merge as a flakiness fix; the changed assertions will not cause false positives, but the test no longer verifies the positive display path for the default persona tag.

The only changed file is a Playwright spec. The new assertions are logically correct for persona2 (which is never the default in this describe block's setup), but the test drops the positive check that persona1 actually shows the default-persona-tag. If the feature regresses and stops rendering the tag entirely, this test would still pass. The misleading variable name (removedDefaultPersonaLabel) adds confusion. Neither issue is a runtime defect — only test coverage is weakened.

openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Users.spec.ts — the positive assertion for the default persona tag display should be restored alongside the new negative assertions.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Users.spec.ts Replaces positive assertions (default persona tag visible on first persona) with negative assertions (persona2 does not have the tag / radio), addressing flakiness but weakening coverage; variable name removedDefaultPersonaLabel is misleading in this test's context.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant beforeAll
    participant Test1 as Should display persona dropdown with pagination
    participant Test2 as Should display default persona tag correctly (changed)
    participant Test3 as Should handle default persona change and removal

    beforeAll->>adminUser: PATCH /personas [persona1, persona2]
    beforeAll->>adminUser: "PATCH /defaultPersona = persona1"

    Test1->>adminPage: Open dropdown, verify pagination

    Test2->>adminPage: Open dropdown, expand all
    Note over Test2: OLD: assert persona1 (first) has default-persona-tag
    Note over Test2: NEW: assert persona2 has NO default-persona-tag (negative only)
    Note over Test2: NEW: assert persona2 radio is NOT checked (negative only)

    Test3->>adminPage: Step 1 - verify persona1 is default and checked
    Test3->>profilePage: Step 2 - change default persona to persona2
    Test3->>adminPage: Step 3 - verify persona2 is now default and checked
    Test3->>profilePage: Step 4 - remove default persona entirely
    Test3->>adminPage: Step 5 - verify no tag and no checked radio anywhere
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant beforeAll
    participant Test1 as Should display persona dropdown with pagination
    participant Test2 as Should display default persona tag correctly (changed)
    participant Test3 as Should handle default persona change and removal

    beforeAll->>adminUser: PATCH /personas [persona1, persona2]
    beforeAll->>adminUser: "PATCH /defaultPersona = persona1"

    Test1->>adminPage: Open dropdown, verify pagination

    Test2->>adminPage: Open dropdown, expand all
    Note over Test2: OLD: assert persona1 (first) has default-persona-tag
    Note over Test2: NEW: assert persona2 has NO default-persona-tag (negative only)
    Note over Test2: NEW: assert persona2 radio is NOT checked (negative only)

    Test3->>adminPage: Step 1 - verify persona1 is default and checked
    Test3->>profilePage: Step 2 - change default persona to persona2
    Test3->>adminPage: Step 3 - verify persona2 is now default and checked
    Test3->>profilePage: Step 4 - remove default persona entirely
    Test3->>adminPage: Step 5 - verify no tag and no checked radio anywhere
Loading

Reviews (1): Last reviewed commit: "fix(ui): account for system default pers..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@harsh-vador harsh-vador self-assigned this Jun 25, 2026
@harsh-vador harsh-vador requested a review from a team as a code owner June 25, 2026 05:47
@harsh-vador harsh-vador added safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch labels Jun 25, 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:

  • 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.

@harsh-vador harsh-vador changed the title fix(ui): account for system default persona fallback in Users persona… fix(ui): account for system default persona fallback in Users persona removal e2e Jun 25, 2026
@gitar-bot

gitar-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Updates the Users persona removal E2E test to account for the system default persona fallback. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Comment on lines +739 to +749
const removedDefaultPersonaLabel = adminPage
.locator('[data-testid="persona-label"]')
.filter({ hasText: persona2.responseData.displayName });

// Verify default persona is first in the list
const personaLabels = adminPage.locator('[data-testid="persona-label"]');
const firstPersona = personaLabels.first();
await expect(
removedDefaultPersonaLabel.locator('[data-testid="default-persona-tag"]')
).not.toBeVisible();

await expect(
firstPersona.locator('[data-testid="default-persona-tag"]')
).toBeVisible();
removedDefaultPersonaLabel.locator('input[type="radio"]')
).not.toBeChecked();

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.

P2 Misleading variable name and missing positive assertion

The variable removedDefaultPersonaLabel implies persona2's default status was removed, but in this test's scope the beforeAll sets persona1 as the default — persona2 was never the default to begin with. More importantly, the test is titled "Should display default persona tag correctly" yet the new code only verifies the negative case (persona2 does not have the tag / is not checked). The positive assertion — that persona1 actually shows the default-persona-tag — has been dropped entirely. If the feature were to stop rendering the default tag altogether, this test would still pass, making it a silent regression hole.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — all 32 tests passed

✅ 32 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 32 0 0 0

📦 Download artifacts

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

@harsh-vador harsh-vador merged commit 9342b5b into main Jun 25, 2026
50 of 79 checks passed
@harsh-vador harsh-vador deleted the fix-users-persona branch June 25, 2026 07:35
@github-actions

Copy link
Copy Markdown
Contributor

Changes have been cherry-picked to the 1.12.13 branch.

github-actions Bot pushed a commit that referenced this pull request Jun 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Changes have been cherry-picked to the 1.13 branch.

github-actions Bot pushed a commit that referenced this pull request Jun 25, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants