Skip to content

Give the ContextCenterPermission spec's article an owner - #38888

Merged
ShaileshParmar11 merged 1 commit into
mainfrom
ShaileshParmar11/cc-permission-article-owner
Nov 26, 2026
Merged

ShaileshParmar11 merged 1 commit into
mainfrom
ShaileshParmar11/cc-permission-article-owner

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes the ContextCenterPermission Playwright failures that #38818 (for #38800) exposes on main. Port of the ContextCenterPermission part of #38887 (the 2.0 fix).

  • Fixes #38800: Gate article header actions on the article's own permission #38818 gates the article header's owner, domain and delete actions on the open article's own permission instead of the resource-level one.
  • The spec's shared article had no owner. OrganizationPolicy-NoOwner-Rule allows EditOwners on any asset with no owner (noOwner()), so the article-level permission is EditOwners: allow for every user, and the server accepts that PATCH. edit-owner-btn is therefore correctly shown to the view-only, ViewAll-only and Data Consumer users, and the spec's "not visible" assertions fail. The UI is right; the spec is stale.
  • Fix: create the spec's article with the admin as owner, so the check is about EditOwners again.

The 2.0 PR also changed how the ViewAll-only and Data Consumer tests open the article. That part is not needed here: main already opens the spec's own article through openPermissionArticle. AuditLogs on main already selects getByTestId('description-content').

main's last nightly (Nov 24) ran before #38818 merged on Nov 26, so it has not failed there yet. The 2.1 backport of this fix is linked in a comment below.

Type of change:

  • Bug fix

High-level design:

N/A — test-only change, 1 file.

Tests:

Use cases covered

  • A view-only, ViewAll-only or Data Consumer user cannot change the owners of an article that has an owner.

Unit tests

Not applicable (Playwright spec only).

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

Local Playwright run: FAILED

  • Commit: c022cd301a8e (base origin/main)
  • Started: 2026-11-26T16:47:25.527Z · Playwright 1.65.1 · 5.6 min
  • Totals: 80 passed, 1 failed, 0 flaky, 0 skipped across 6 selected specs
Spec Reason Passed Failed Flaky Skipped
playwright/e2e/Features/ContextCenterPermission.spec.ts changed 35 0 0 0
playwright/e2e/Features/Dashboards.spec.ts smoke 3 1 0 0
playwright/e2e/Flow/Navbar.spec.ts smoke 22 0 0 0
playwright/e2e/Pages/DataMarketplace.spec.ts smoke 5 0 0 0
playwright/e2e/Pages/Lineage/LineageControls.spec.ts smoke 9 0 0 0
playwright/e2e/Pages/Policies.spec.ts smoke 3 0 0 0
playwright/e2e/auth.setup.ts setup 1 0 0 0
playwright/e2e/entity-data.setup.ts setup 1 0 0 0
playwright/e2e/entity-data.teardown.ts setup 1 0 0 0
Command
cd openmetadata-ui/src/main/resources/ui
npx playwright test playwright/e2e/Features/ContextCenterPermission.spec.ts playwright/e2e/Features/Dashboards.spec.ts playwright/e2e/Flow/Navbar.spec.ts playwright/e2e/Pages/DataMarketplace.spec.ts playwright/e2e/Pages/Lineage/LineageControls.spec.ts playwright/e2e/Pages/Policies.spec.ts --workers=3
  • ContextCenterPermission.spec.ts: 35/35 passed. That includes the view-only, ViewAll-only and Data Consumer edit-owner-btn checks, which failed on the 2.0 nightly once the header was gated on the article's own permission.

  • The one failure is the smoke spec Dashboards.spec.ts:189 (expand / collapse should not appear after updating nested fields for dashboardDataModels). It fails on a rerun too: the tag picker search for PersonalData.Personal returns "No Tags are available" on this local stack's search index. That is local data, not this spec-only change, which touches no Dashboards code.

  • File updated: playwright/e2e/Features/ContextCenterPermission.spec.ts

  • Local checks: prettier --check and eslint clean on the file; tsc --noEmit -p playwright/tsconfig.json reports no errors.

  • Ran locally against the main stack at 881d635 (MySQL), with the UI served from this branch by the Vite dev server, so the UI includes Fixes #38800: Gate article header actions on the article's own permission #38818. Results are in the block above.

Manual testing performed

  1. Read the 2.0 nightly traces behind [2.0] Fix ContextCenterPermission and AuditLogs specs broken by the article-permission and Audit Logs backports #38887: resource-level EditOwners: conditionalAllow, article-level EditOwners: allow, article owners: [].
  2. Checked that no other test in this spec depends on the shared article having no owner. No test changes the article's owners. The EditAll user and the Data Steward still see edit-owner-btn through EditAll / EditOwners. The owner-only rules (isOwner(), !isOwner() && !noOwner()) target contextMemory only, not the article.

UI screen recording:

Not applicable (test-only change).

Checklist:

  • I have read CONTRIBUTING.md (the pre-review gate) and the contributor docs.
  • My PR title is Fixes <issue-number>: <short explanation> — test fix, no issue (skip-pr-checks).
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: reviewed the diff against REVIEW.md at c022cd3. No 🔴 findings. Test map: the changed file is a spec (its own test). Two 🟡 answered: the admin owner is not asserted (the view-only edit-owner-btn step fails if the owner is dropped, which is the guard), and the Data Steward still sees edit-owner-btn via EditOwners in DataStewardPolicy.
  • Decision check: no durable decision; test data only.

🤖 Generated with Claude Code

#38818 (#38800) gates the article header's owner, domain and delete actions
on the open article's own permission. The spec's shared article had no owner,
and OrganizationPolicy-NoOwner-Rule lets any user set the owner of an unowned
asset, so edit-owner-btn is now correctly shown to view-only and Data Consumer
users. Create the article with the admin as owner so the check is about
EditOwners again.
@ShaileshParmar11
ShaileshParmar11 requested a review from a team as a code owner November 26, 2026 16:29
@ShaileshParmar11 ShaileshParmar11 added the skip-pr-checks Bypass PR metadata validation check label Nov 26, 2026
Copilot AI balanced review requested due to automatic review settings November 26, 2026 16:29

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@ShaileshParmar11

Copy link
Copy Markdown
Contributor Author

Backport to 2.1: #38889

@gitar-bot

gitar-bot Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟢 Low risk

The Playwright spec now creates its article with an admin owner, narrowly correcting permission-test setup without changing production behavior.

Gives the ContextCenterPermission spec's shared article an admin owner so the view-only, ViewAll-only and Data Consumer checks test EditOwners rather than the no-owner default. 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

@ShaileshParmar11
ShaileshParmar11 enabled auto-merge (squash) November 26, 2026 16:55
@ShaileshParmar11
ShaileshParmar11 merged commit 8f899fb into main Nov 26, 2026
42 of 43 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the ShaileshParmar11/cc-permission-article-owner branch November 26, 2026 16:57
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.

3 participants