Skip to content

refactor(playwright): sign in through a fixture, not the form - #33219

Open
chirag-madlani wants to merge 2 commits into
flake/3-signed-in-page-fixturesfrom
flake/4-signin-migration
Open

refactor(playwright): sign in through a fixture, not the form#33219
chirag-madlani wants to merge 2 commits into
flake/3-signed-in-page-fixturesfrom
flake/4-signin-migration

Conversation

@chirag-madlani

Copy link
Copy Markdown
Collaborator

Stack 4 of 4. Targets #33218. This is the large, mechanical one — review #33218 first, since it contains the mechanism this PR applies.

The change

275 call sites across 83 files become signIn(), and openmetadata-playwright/prefer-role-page-fixture goes to error with no suppressions.

Both paths funnel through the same completeSignIn() (see #33218), so the rewrite changes how the session was established and nothing else. The type checker confirms it: a receiver that was not a UserClass would not compile, and the playwright tsc count is unchanged by the rewrite.

Exemptions are stated, not hidden

Nine specs keep login() because the sign-in flow is what they test — Pages/Login.spec.ts, Features/OnlineUsers.spec.ts, Flow/Tour.spec.ts and the Features/AppMode specs. Each call carries a justified disable naming its reason, rather than a blanket entry in a baseline file.

performUserLogin is deliberately not flagged: it signs in through the API and owns its page, context and teardown, so it is a sanctioned path.

The rule targets authenticating as a bespoke user, not creating one — new UserClass() for an owner, reviewer or assignee is ordinary test data and is untouched. That distinction is what keeps the rule at zero false positives.

eslint-suppressions.json is byte-identical to main. The rule was written to be enforceable only once the corpus was clean, which is what this change makes true.

The rule already works

While rebasing onto a main that had moved 62 commits, the rule caught a brand-new nonAsciiUser.login(page) that arrived in Login.spec.ts — failing lint on contact, which is precisely its job.

Verification (live server)

~320 tests across the migrated specs, the role fixtures and the eight storage states, with no failure attributable to the migration:

Run Result
TaskComments + Users + EntityPermissions 85 passed
9 densest migrated specs 81 passed (the 8 failures were an expired admin token, confirmed by re-minting → 17/17 clean)
RoleFixtureSessions + TokenStorage + TaskComments + TasksUIFlow on the rebased tip 35 passed

Coverage caveat, stated plainly: 113 of 272 migrated call sites (42%) across 12 of 83 files were exercised locally. The rest rests on the transform being mechanical and type-verified, and on login()/signIn() sharing completeSignIn(). CI is the real gate — and thanks to #33217, any failure will now name the step that hung.

🤖 Generated with Claude Code

Migrates every spec off `UserClass.login()` and promotes
`openmetadata-playwright/prefer-role-page-fixture` to `error` with no
suppressions.

275 call sites across 83 files become `signIn()`. Both paths funnel through the
same `completeSignIn()`, so the rewrite changes how the session was established
and nothing else — which the type checker confirms: a receiver that was not a
`UserClass` would not compile, and the playwright tsc count is unchanged.

Nine specs keep `login()` because the sign-in flow is what they test —
`Pages/Login.spec.ts`, `Features/OnlineUsers.spec.ts`, `Flow/Tour.spec.ts` and
the `Features/AppMode` specs. Each call carries a justified disable naming its
reason, rather than a blanket entry in a baseline file.

`performUserLogin` is no longer flagged: it signs in through the API and owns its
page, context and teardown, so it is a sanctioned path. The rule targets
*authenticating as* a bespoke user, not *creating* one — `new UserClass()` for an
owner, reviewer or assignee is ordinary test data and is untouched.

`eslint-suppressions.json` is byte-identical to main. The rule was written to be
enforceable only once the corpus was clean, which is what this change makes true.

Validated against a live server: ~320 tests across the migrated specs, the role
fixtures, and the eight storage states, with no failure attributable to the
migration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@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: 766 → 766
- 0 added, 0 removed, 5 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/support/fixtures/userPages.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/tokenStorage.ts
  openmetadata-ui/src/main/resources/ui/src/components/MyData/LeftSidebar/LeftSidebar.component.tsx
  openmetadata-ui/src/main/resources/ui/src/components/Settings/Users/UserProfileIcon/UserProfileIcon.component.tsx
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/table.ts

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

@gitar-bot

gitar-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Refactors 275 sign-in call sites across 83 files to use a fixture instead of the form, channeling all paths through completeSignIn(). The type checker confirms no behavioral change, and verification across ~320 tests shows no migration-related failures. Update the JSDoc for preferRolePageFixture to reflect that the rule now runs at error (not warn) and the corpus has been fully migrated.

💡 Quality: Rule JSDoc still says it runs at warn, but it is now error

📄 openmetadata-ui/src/main/resources/ui/eslint-rules/openmetadata-playwright.mjs:132-133 📄 openmetadata-ui/src/main/resources/ui/eslint.config.mjs:638

The JSDoc block added for preferRolePageFixture ends with "It runs at warn: there are ~290 existing call sites, and a rule whose baseline is most of the corpus teaches nothing. Fix them as you touch them." This contradicts the actual behavior introduced by this same PR: eslint.config.mjs sets the rule to error and the corpus has been fully migrated. The comment will mislead future readers about the rule's severity and rationale; update it to reflect the error promotion (or drop the warn justification).

🤖 Prompt for agents
Code Review: Refactors 275 sign-in call sites across 83 files to use a fixture instead of the form, channeling all paths through `completeSignIn()`. The type checker confirms no behavioral change, and verification across ~320 tests shows no migration-related failures. Update the JSDoc for `preferRolePageFixture` to reflect that the rule now runs at `error` (not `warn`) and the corpus has been fully migrated.

1. 💡 Quality: Rule JSDoc still says it runs at `warn`, but it is now `error`
   Files: openmetadata-ui/src/main/resources/ui/eslint-rules/openmetadata-playwright.mjs:132-133, openmetadata-ui/src/main/resources/ui/eslint.config.mjs:638

   The JSDoc block added for `preferRolePageFixture` ends with "It runs at `warn`: there are ~290 existing call sites, and a rule whose baseline is most of the corpus teaches nothing. Fix them as you touch them." This contradicts the actual behavior introduced by this same PR: `eslint.config.mjs` sets the rule to `error` and the corpus has been fully migrated. The comment will mislead future readers about the rule's severity and rationale; update it to reflect the `error` promotion (or drop the warn justification).

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

@chirag-madlani
chirag-madlani added this pull request to stack #33223 September 11, 2026 14:41
@github-actions

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — workflow failed

Validated commit c150335d6332a09645d486aaa4838ffb969402d2 in Playwright run 34608962677, attempt 1.

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

⚙️ No test failures. This run failed in CI infrastructure or reporting (see Pipeline and setup failures), not because of your changes — no test action needed from you.

Pipeline and setup failures (110)

  • HTML report merge finished with status failure.
  • Playwright coverage validation found 4535 missing, 0 unexpected, 0 duplicate-plan, and 0 duplicate-execution test ID(s).
  • Shard advanced-search-01 did not upload a usable Playwright results artifact.
  • Shard chromium-01 did not upload a usable Playwright results artifact.
  • Shard chromium-02 did not upload a usable Playwright results artifact.
  • Shard chromium-03 did not upload a usable Playwright results artifact.
  • Shard chromium-04 did not upload a usable Playwright results artifact.
  • Shard chromium-05 did not upload a usable Playwright results artifact.
  • Shard chromium-06 did not upload a usable Playwright results artifact.
  • Shard chromium-07 did not upload a usable Playwright results artifact.
  • Shard chromium-08 did not upload a usable Playwright results artifact.
  • Shard chromium-09 did not upload a usable Playwright results artifact.
  • Shard chromium-10 did not upload a usable Playwright results artifact.
  • Shard chromium-11 did not upload a usable Playwright results artifact.
  • Shard chromium-12 did not upload a usable Playwright results artifact.
  • Shard chromium-13 did not upload a usable Playwright results artifact.
  • Shard chromium-14 did not upload a usable Playwright results artifact.
  • Shard chromium-15 did not upload a usable Playwright results artifact.
  • Shard chromium-16 did not upload a usable Playwright results artifact.
  • Shard chromium-17 did not upload a usable Playwright results artifact.
  • Shard chromium-18 did not upload a usable Playwright results artifact.
  • Shard chromium-19 did not upload a usable Playwright results artifact.
  • Shard chromium-20 did not upload a usable Playwright results artifact.
  • Shard chromium-21 did not upload a usable Playwright results artifact.
  • Shard chromium-22 did not upload a usable Playwright results artifact.
  • Shard chromium-23 did not upload a usable Playwright results artifact.
  • Shard chromium-24 did not upload a usable Playwright results artifact.
  • Shard chromium-25 did not upload a usable Playwright results artifact.
  • Shard data-asset-rules-01 did not upload a usable Playwright results artifact.
  • Shard domain-isolation-01 did not upload a usable Playwright results artifact.
  • Shard global-state-01 did not upload a usable Playwright results artifact.
  • Shard import-export-01 did not upload a usable Playwright results artifact.
  • Shard import-export-02 did not upload a usable Playwright results artifact.
  • Shard ingestion-01 did not upload a usable Playwright results artifact.
  • Shard ingestion-02 did not upload a usable Playwright results artifact.
  • Shard reindex-01 did not upload a usable Playwright results artifact.
  • Shard search-01 did not upload a usable Playwright results artifact.
  • Shard search-rbac-01 did not upload a usable Playwright results artifact.
  • Shard advanced-search-01 failed during setupEnvironment setup.
  • Shard advanced-search-01 test execution finished with status skipped without a reported test failure.
  • Shard chromium-01 failed during setupEnvironment setup.
  • Shard chromium-01 test execution finished with status skipped without a reported test failure.
  • Shard chromium-02 failed during setupEnvironment setup.
  • Shard chromium-02 test execution finished with status skipped without a reported test failure.
  • Shard chromium-03 failed during setupEnvironment setup.
  • Shard chromium-03 test execution finished with status skipped without a reported test failure.
  • Shard chromium-04 failed during setupEnvironment setup.
  • Shard chromium-04 test execution finished with status skipped without a reported test failure.
  • Shard chromium-05 failed during setupEnvironment setup.
  • Shard chromium-05 test execution finished with status skipped without a reported test failure.
  • Shard chromium-06 failed during setupEnvironment setup.
  • Shard chromium-06 test execution finished with status skipped without a reported test failure.
  • Shard chromium-07 failed during setupEnvironment setup.
  • Shard chromium-07 test execution finished with status skipped without a reported test failure.
  • Shard chromium-08 failed during setupEnvironment setup.
  • Shard chromium-08 test execution finished with status skipped without a reported test failure.
  • Shard chromium-09 failed during setupEnvironment setup.
  • Shard chromium-09 test execution finished with status skipped without a reported test failure.
  • Shard chromium-10 failed during setupEnvironment setup.
  • Shard chromium-10 test execution finished with status skipped without a reported test failure.
  • Shard chromium-11 failed during setupEnvironment setup.
  • Shard chromium-11 test execution finished with status skipped without a reported test failure.
  • Shard chromium-12 failed during setupEnvironment setup.
  • Shard chromium-12 test execution finished with status skipped without a reported test failure.
  • Shard chromium-13 failed during setupEnvironment setup.
  • Shard chromium-13 test execution finished with status skipped without a reported test failure.
  • Shard chromium-14 failed during setupEnvironment setup.
  • Shard chromium-14 test execution finished with status skipped without a reported test failure.
  • Shard chromium-15 failed during setupEnvironment setup.
  • Shard chromium-15 test execution finished with status skipped without a reported test failure.
  • Shard chromium-16 failed during setupEnvironment setup.
  • Shard chromium-16 test execution finished with status skipped without a reported test failure.
  • Shard chromium-17 failed during setupEnvironment setup.
  • Shard chromium-17 test execution finished with status skipped without a reported test failure.
  • Shard chromium-18 failed during setupEnvironment setup.
  • Shard chromium-18 test execution finished with status skipped without a reported test failure.
  • Shard chromium-19 failed during setupEnvironment setup.
  • Shard chromium-19 test execution finished with status skipped without a reported test failure.
  • Shard chromium-20 failed during setupEnvironment setup.
  • Shard chromium-20 test execution finished with status skipped without a reported test failure.
  • Shard chromium-21 failed during setupEnvironment setup.
  • Shard chromium-21 test execution finished with status skipped without a reported test failure.
  • Shard chromium-22 failed during setupEnvironment setup.
  • Shard chromium-22 test execution finished with status skipped without a reported test failure.
  • Shard chromium-23 failed during setupEnvironment setup.
  • Shard chromium-23 test execution finished with status skipped without a reported test failure.
  • Shard chromium-24 failed during setupEnvironment setup.
  • Shard chromium-24 test execution finished with status skipped without a reported test failure.
  • Shard chromium-25 failed during setupEnvironment setup.
  • Shard chromium-25 test execution finished with status skipped without a reported test failure.
  • Shard data-asset-rules-01 failed during setupEnvironment setup.
  • Shard data-asset-rules-01 test execution finished with status skipped without a reported test failure.
  • Shard domain-isolation-01 failed during setupEnvironment setup.
  • Shard domain-isolation-01 test execution finished with status skipped without a reported test failure.
  • Shard global-state-01 failed during setupEnvironment setup.
  • Shard global-state-01 test execution finished with status skipped without a reported test failure.
  • Shard import-export-01 failed during setupEnvironment setup.
  • Shard import-export-01 test execution finished with status skipped without a reported test failure.
  • Shard import-export-02 failed during setupEnvironment setup.
  • Shard import-export-02 test execution finished with status skipped without a reported test failure.
  • ... and 10 more

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 46s

⏱️ Max setup 0s · max shard execution 0s · max shard-job elapsed before upload 4m 11s · reporting 1s

🌐 0.00 requests/attempt · 0.00 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Application boot ratio was 0 per UI scenario (0 boots / 0 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
⛔ Shard advanced-search-01
⛔ Shard chromium-01
⛔ Shard chromium-02
⛔ Shard chromium-03
⛔ Shard chromium-04
⛔ Shard chromium-05
⛔ Shard chromium-06
⛔ Shard chromium-07
⛔ Shard chromium-08
⛔ Shard chromium-09
⛔ Shard chromium-10
⛔ Shard chromium-11
⛔ Shard chromium-12
⛔ Shard chromium-13
⛔ Shard chromium-14
⛔ Shard chromium-15
⛔ Shard chromium-16
⛔ Shard chromium-17
⛔ Shard chromium-18
⛔ Shard chromium-19
⛔ Shard chromium-20
⛔ Shard chromium-21
⛔ Shard chromium-22
⛔ Shard chromium-23
⛔ Shard chromium-24
⛔ Shard chromium-25
⛔ Shard data-asset-rules-01
⛔ Shard domain-isolation-01
⛔ Shard global-state-01
⛔ Shard import-export-01
⛔ Shard import-export-02
⛔ Shard ingestion-01
⛔ Shard ingestion-02
⛔ Shard reindex-01
⛔ Shard search-01
⛔ Shard search-rbac-01

📦 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

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.

2 participants