Skip to content

test(playwright): fix Context Center, Table and ProfileTeam specs broken by memory-status, page-size and leave-team changes - #37338

Merged
Rohit0301 merged 4 commits into
mainfrom
Rohit0301/contextcenter-failures-fix
Nov 9, 2026
Merged

Rohit0301 merged 4 commits into
mainfrom
Rohit0301/contextcenter-failures-fix

Conversation

@Rohit0301

Copy link
Copy Markdown
Contributor

Describe your changes:

No issue: this is test-only follow-up for 12 Playwright tests that started failing in the Collate postgresql~full run after three OMD merges on 2026-11-05/06. The product behaviour changes were intended. The specs were not updated for them.

Spec Root cause Fix
ContextCenterDashboard (2), ContextCenterMemories (3), ContextCenterPermission (5) #36989 starts new memories Approved on OSS but Unprocessed on distributions with reviewRequired (Collate). It also lists pending memories only to their owners and admins. On Collate the admin-created test memories were therefore Unprocessed and hidden from the reader roles. The Dashboard assertion entityStatus === 'Approved' also failed. createMemoryViaApi sends entityStatus: 'Approved' unless the caller overrides it, matching the OSS default. The Permission spec's raw ownerMemoryId POST sets it too. Admins keep approval rights on Collate, so both distributions behave the same. Specs that need a pending memory already pass 'Unprocessed'.
Table › Tags term should be consistent for search #35288 cut the columns page from 50 to 15 rows, sorted by name (limit=15&sortBy=name). dim_customer.shop_id moved to page 2, so its add-tag button never rendered. Use dim_customer.average_order_size. It is on page 1 and no other spec touches it. customer_id is avoided because the glossary test in the same file edits it, and the two would race.
ProfileTeam › Should join and leave a public team e519ba7 changed Leave to PATCH /api/v1/users/<me>, the same call as Join, instead of DELETE /teams/<id>/users/<id>. The spec waited for a DELETE that never fires. Wait for a successful PATCH /api/v1/users/. The Join wait also asserts response.ok().

Type of change:

  • Bug fix

High-level design:

N/A — small test-only change.

Tests:

Use cases covered

  • Context Center memory visibility and permission matrix with explicitly Approved test memories
  • Column tag add/remove stays consistent through column search on the first column page
  • Join and leave a public team from the AI Profile team detail

Unit tests

  • Not applicable (Playwright-only change).

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

Only the 12 previously failing tests were run, with --project=chromium --no-deps. The UI came from this branch (Vite dev server), proxied to a local Collate server.

Caveat: the local Collate server was built on Oct 27, before #36989. It therefore shows that the memory changes cause no regression, but it cannot reproduce the Collate Unprocessed default itself. The next Collate CI run will confirm that part.

11 passed in the first run:

11 previously failing tests passing

The Table test failed in that run only because the local server had no sample data (Entity not found: table sample_data.ecommerce_db.shopify.dim_customer). After seeding dim_customer from ingestion/examples/sample_data/datasets/tables.json (all 29 columns), it passed:

Table tag search test passing

eslint and prettier --check pass on the 4 changed files.

Manual testing performed

  1. Decoded the CI HTML report and its traces to find the error, request sequence and screenshot for each failure.
  2. Matched each failure to the commit that changed the behaviour (see table above).

UI screen recording:

Not applicable — test-only change.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.

🤖 Generated with Claude Code

…er memory-status, page-size and leave-team changes

- createMemoryViaApi and the Permission owner fixture pin entityStatus Approved:
  #36989 made Collate (reviewRequired) start memories Unprocessed and hid pending
  memories from non-owners, so readers never saw the fixtures.
- Table tag-search test uses dim_customer.average_order_size: with 15-row column
  pages sorted by name (#35288), shop_id moved to page 2.
- ProfileTeam leave waits for PATCH /users/<me>: leaving now updates the user's
  teams instead of DELETE /teams/<id>/users/<id>.
@Rohit0301
Rohit0301 requested a review from a team as a code owner November 7, 2026 06:18
@github-actions

github-actions Bot commented Nov 7, 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 the UI UI specific issues label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Nov 7, 2026
@Rohit0301
Rohit0301 enabled auto-merge (squash) November 7, 2026 06:23

@harsh-vador harsh-vador left a comment

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.

Thanks for picking these up. Left a few comments, mostly about stopping these from breaking again the same way. The createMemoryViaApi one is the main one for me, the rest are smaller.

// OSS defaults a new memory to Approved, Collate to Unprocessed (hidden from
// non-owners). Pin Approved so fixtures behave the same on both distributions.
const res = await apiContext.post(MEMORIES_API, {
data: { entityStatus: 'Approved', ...overrides },

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.

Defaulting to Approved makes sense for Collate, but it turns the two expect(memory.entityStatus).toBe('Approved') checks in ContextCenterDashboard.spec.ts (L178 and L467) into echo checks. As far as I can tell they were added to make sure OSS starts a new memory as Approved, and now we send Approved ourselves, so they'd still pass if that default broke. Could we keep one create in the dashboard spec that doesn't send a status? Or drop those asserts if the OSS default is covered somewhere else.

Smaller thing: with the spread, an explicit entityStatus: undefined in overrides wins over the default and then gets dropped from the JSON, so Collate falls back to Unprocessed. createMemory in ContextCenterMemoryLifecycle.spec.ts forwards an optional entityStatus like that. Every call there passes a value today, so nothing's broken, but entityStatus: overrides.entityStatus ?? 'Approved' would close that gap.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in df06844.

  • Dropped both expect(memory.entityStatus).toBe('Approved') checks in the dashboard spec. A create without a status cannot assert one value on both distributions (it is Unprocessed on Collate, which is how these broke). The OSS default is already guarded by ContextMemoryCreateGrantIT (and ContextMemoryRepositoryTest), per ADR 2026-11-05.
  • The helper now uses entityStatus: overrides.entityStatus ?? 'Approved', so an explicit undefined no longer drops the default.

question: 'Owned by admin for permission matrix tests',
answer: 'Owned by admin for permission matrix tests',
// Collate starts memories Unprocessed, which hides them from non-owners.
entityStatus: 'Approved',

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.

Any reason not to use createMemoryViaApi here? You'd get the Approved default for free, and it also asserts the 201. Right now, if this POST fails, ownerMemoryId silently becomes undefined and the permission tests fail much later with a "row not found" that's hard to trace back. Same goes for the other raw POSTs below (editAll, deleteAll, allPermission, etc.), though those don't need to be in this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in df06844: the owner fixture now uses createMemoryViaApi, so it gets the Approved default and the 201 assert. I left the other raw POSTs as they are, as you suggested. Those memories are owned by the user who reads them, so the pending state does not hide them.

// Check if add button exists and is visible
const rowSelector =
'[data-row-key="sample_data.ecommerce_db.shopify.dim_customer.shop_id"] [data-testid*="classification-tags"]';
'[data-row-key="sample_data.ecommerce_db.shopify.dim_customer.average_order_size"] [data-testid*="classification-tags"]';

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.

This works, but I think it's the same trap as before: average_order_size happens to be on the first page right now. If the page size or sort changes again, or a column gets added ahead of it, we're back here. The test already searches for the column further down (L611). Could we do that search first and then open the tag picker? Then pagination doesn't matter.

nit: the column name is now hardcoded in three places (here, L614 and L627). A const columnFqn at the top would have made this a one-line change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in df06844. The test now searches the column before it opens the tag picker, so page size and sort no longer matter. That let me go back to the original shop_id, with columnName / columnFqn declared once. One catch: the search is kept in the URL (columnSearch), so after reload() refilling the same value would fire no request. The test now waits for the search request the reload makes instead.

page,
page.locator(
`[data-row-key="sample_data.ecommerce_db.shopify.dim_customer.shop_id"] [data-testid="classification-tags-0"] [data-testid="edit-button"]`
`[data-row-key="sample_data.ecommerce_db.shopify.dim_customer.average_order_size"] [data-testid="classification-tags-0"] [data-testid="edit-button"]`

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.

Not new in this PR, but worth noting since we're picking a fresh column: if the test fails after the tag is added and before it's removed, the tag stays on the shared dim_customer column, and the classification from beforeAll never gets cleaned up. An afterAll / try...finally would keep failed runs from piling tags onto it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added in df06844: an afterAll hard-deletes the glossary and the classification with recursive=true, which also removes their labels from the shared dim_customer columns when a test fails mid-way. It covers the glossary test in the same describe too.

.url()
.includes(`/api/v1/teams/${team.responseData.id}/users/`) &&
response.request().method() === 'DELETE'
response.url().includes('/api/v1/users/') &&

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.

This matches any PATCH under /api/v1/users/, which is a lot looser than the old team-scoped DELETE wait. Anything else that patches a user around the click (a preference or persona save, a slow retry of the join PATCH) could resolve it first, and then we're asserting on the wrong request. Can we scope it to the admin's user id? The join wait above has the same issue, so one small predicate shared by both would cover it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in df06844. The admin id comes from /users/loggedInUser, and one waitForOwnTeamsPatch() predicate matches the exact path /api/v1/users/<adminId> with PATCH. Join and leave both use it.

);
await leaveButton.click();
await leaveResponse;
expect((await leaveResponse).status()).toBe(200);

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.

nit: waitForResponseWithStatus in utils/waitHelpers.ts does this wait + status check in one call, and gives a clearer error (PATCH /api/v1/users/...: expected HTTP 200, received 4xx) when it fails. Would be nice to use it for both the join and leave waits.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in df06844: both waits go through waitForResponseWithStatus(..., 200).

Rohit0301 and others added 2 commits November 8, 2026 10:27
…Team spec fixes

- createMemoryViaApi keeps the Approved default when entityStatus is passed as undefined
- Dashboard drops the Approved asserts that only echoed the helper (OSS default is
  guarded by ContextMemoryCreateGrantIT)
- Permission owner fixture goes through createMemoryViaApi so a failed POST fails fast
- Table tag test searches the column before tagging, so pagination and sort no longer
  matter; afterAll hard-deletes the glossary and classification
- ProfileTeam join/leave waits are scoped to the admin's own PATCH via
  waitForResponseWithStatus
@github-actions

github-actions Bot commented Nov 8, 2026

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: 1065 → 1065
- 0 added, 0 removed, 1 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/utils/waitHelpers.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 Nov 8, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Playwright fixtures force Approved memories and hard-delete glossary/classification data, which could mask pending-memory behavior or remove shared test labels.

Fixes 12 Playwright specs in Context Center, Table and ProfileTeam broken by recent memory-status, page-size and leave-team behavior changes, by updating test setup and wait conditions to match. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@Rohit0301
Rohit0301 disabled auto-merge November 9, 2026 05:30
@Rohit0301
Rohit0301 merged commit 2c7bf04 into main Nov 9, 2026
63 of 64 checks passed
@Rohit0301
Rohit0301 deleted the Rohit0301/contextcenter-failures-fix branch November 9, 2026 05:31
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.

3 participants