Skip to content

fix(playwright): make mcp administration spec pass on a clean instance - #38071

Merged
Vishnuujain merged 3 commits into
mainfrom
mcp-admin-spec-fix
Nov 18, 2026
Merged

Vishnuujain merged 3 commits into
mainfrom
mcp-admin-spec-fix

Conversation

@Vishnuujain

@Vishnuujain Vishnuujain commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes the McpAdministration.spec.ts failure in the nightly AUT run: https://github.com/open-metadata/openmetadata-nightly/actions/runs/44200749877

  • The spec failed on its first call on a clean instance: GET /api/v1/system/mcp/config returns 404 until an MCP config is saved, and the spec asserted it was OK. It now accepts 404 and starts from an empty config, like the settings form does.
  • The spec was added in Fixes 37683: Harden MCP registration and add admin client revocation #37684 with Playwright skipped on that PR, so the later steps had never run. Fixed the ones that could not pass: the page URL (/settings/apps/McpApplication), toggling the core switches (keyboard instead of uncheck()/check()), and the clients table role (grid).
  • After "Revoke tokens" the clients list reloads to its first page, so the spec now waits for the list to settle and pages to the client row again.

Type of change:

  • Bug fix

Tests:

Playwright (UI) tests

  • Updated: playwright/e2e/Features/McpAdministration.spec.ts
  • Ran it locally (PostgreSQL) with the stored MCP config removed: failed at the first GET before the change, passed after.
  • Final version: 2 of 3 repeats passed. The third stopped at /mcp/register with the 10 per hour registration rate limit, from my repeated local runs.
  • The local runs forced classic mode with two temporary lines because my local instance defaults to AI mode. Those lines are not in the commit.
  • yarn lint:playwright: 0 errors.
  • Not run: MySQL, the rest of the Playwright suite.

Checklist:

  • I have read the CONTRIBUTING document.
  • Self-review: I reviewed the diff against REVIEW.md at 36d7f39d45d. No 🔴. The one 🟡 (the paging loop could read the list mid-refetch) is fixed in 43f979a.

RetriggerView in GreptileConfidence Score: 5/5

The changes appear safe to merge.

Summary

Updates the MCP administration test to run on a clean instance and use the current settings page and controls.

  • The MCP admin test starts clean and changes settings through the current page.
  • The client test finds its row again after revoking tokens.

No new actionable issues found in the changes since the previous review.

Reviews (3) · Last reviewed commit: "switch state checks" · Reviewed by Greptile

@Vishnuujain
Vishnuujain requested a review from a team as a code owner November 18, 2026 05:16
@Vishnuujain Vishnuujain added the skip-pr-checks Bypass PR metadata validation check label Nov 18, 2026
});
await expect(serverSwitch).toBeChecked();
await serverSwitch.uncheck();
await serverSwitch.press('Space');

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.

Pressing Space works, but unlike check()/uncheck() it doesn't confirm the switch actually flipped. If the key press ever misses, the failure shows up later as a Save timeout or the 403 check further down, which is a pain to trace back. Could we add a quick state check after each press? Something like:

await serverSwitch.press('Space');
await expect(serverSwitch).not.toBeChecked();

Same idea for the two presses near the end (Enable MCP Server and Allow Dynamic Client Registration).

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, added a state check after each of the three presses.

@gitar-bot

gitar-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟢 Low risk 1 closed / 1 findings

The Playwright-only changes adjust test setup, locators, and pagination; they leave application runtime behavior unchanged.

Makes the MCP administration Playwright spec pass on a clean instance by accepting the 404 from an unconfigured GET /api/v1/system/mcp/config, updating the page URL, core switch toggling, and clients table role, and waiting for the list to settle after token revocation. Resolved the finding where cleanup stored a config instead of restoring none. No open issues found.

✅ 1 closed
✅ Edge Case: Cleanup on a clean instance stores a config instead of restoring none

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/McpAdministration.spec.ts:34-36 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/McpAdministration.spec.ts:163-167
If the first GET returns 404, original is {}, and the finally block then runs PUT /api/v1/system/mcp/config with {}. The server stores that as a real setting filled with schema defaults (SystemResource.updateMCPConfiguration → systemRepository.createOrUpdate). Before the test, no setting was stored and SecurityConfigurationManager used the deployment/YAML MCP config through getSettingOrDefault(MCP_CONFIGURATION, deploymentMcpConfiguration(), ...). After the test, the stored defaults override that YAML config on every later run and in every later spec, so the cleanup does not put the instance back the way it found it. No DELETE or reset endpoint exists for this setting (/settings/reset/{name} only supports searchSettings). Either add a way to remove the stored setting and call it when the initial GET was a 404, or note in the comment that this case leaves a stored default config behind.

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

@Vishnuujain
Vishnuujain enabled auto-merge (squash) November 18, 2026 06:39
@Vishnuujain
Vishnuujain merged commit 80f687e into main Nov 18, 2026
54 checks passed
@Vishnuujain
Vishnuujain deleted the mcp-admin-spec-fix branch November 18, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants