Skip to content

Fixes #39808: Tag, Classification, Data Contract, Policy and Custom Property specs as browser tests and Java ITs (Governance wave 2c) - #39891

Open
anuj-kumary wants to merge 34 commits into
mainfrom
anuj-kumary/governance-wave2c
Open

anuj-kumary wants to merge 34 commits into
mainfrom
anuj-kumary/governance-wave2c

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Dec 6, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #39808

Governance wave 2c (open-metadata/openmetadata-collate#9191): the Tag, Classification, Data Contract, Policy and Custom Property Playwright specs, to the bar of #39857. 105 Playwright tests are now tagged migratedTo across 24 specs, each with a browser-test replacement and, where the test also proved something about the server, a Java IT. Nothing is deleted: both run side by side for the one-week validation; removal is tracked in #39892, which lists every test with its replacement.

Tags / Classification (59)
Spec Tagged
Pages/Tag.spec.ts 17
Pages/TagPageRightPanel.spec.ts 11
Pages/Tags.spec.ts 6
Features/CertificationDropdown.spec.ts 4
Features/ClassificationImportExport.spec.ts 4
Pages/ClassificationConditionalRendering.spec.ts 4
Features/SystemCertificationTags.spec.ts 3
Features/TierDropdown.spec.ts 3
Features/ClassificationTagUsage.spec.ts 2
Pages/EditClassification.spec.ts 2
Features/MutuallyExclusiveColumnTags.spec.ts 1
Features/TierWidget.spec.ts 1
VersionPages/ClassificationVersionPage.spec.ts 1
Data Contracts (35)
Spec Tagged
Pages/DataContracts.spec.ts 21
Pages/DataContractInheritance.spec.ts 8
Pages/DataContractSchemaContract.spec.ts 4
Pages/DataContractSLARoundTrip.spec.ts 1
Pages/DataContractSLAValidation.spec.ts 1
Policies (3)
Spec Tagged
Pages/Policies.spec.ts 3
Custom Properties (8)
Spec Tagged
Features/TeamUserCustomProperties.spec.ts 3
Features/CustomPropertiesPersonaWidget.spec.ts 2
Features/ArticleCustomProperties.spec.ts 1
Features/SchemaTableCustomPropertyColumns.spec.ts 1
Pages/CustomPropertiesApiContract.spec.ts 1

Kept in Playwright, each with a // Stays in Playwright: comment:

  • Features/TagsSuggestion.spec.ts (7): two signed-in users drive real tag tasks through the task workflow engine, whose resolution writes the tags.
  • Pages/Tag.spec.ts "Add and Remove Assets…" (4): the added assets must come back from the real search index on the Assets tab and its entity-type filter.
  • Pages/Tags.spec.ts "Classification Page" (1): a cross-page journey through a real request-tags task.
  • Pages/DataContracts.spec.ts (1, Table): its contract's quality tests run through a real test suite pipeline.

Type of change:

  • Improvement

High-level design:

  • New and extended browser-test fakes: tags/tagPage.ts (tag and classification pages, with replaceEditorText for the block editor), data-contracts/contractLifecycle.contract.tsx, entityMatrix.ts (pickTags), and withToasts() in session.tsx, which mounts the toast host the real app renders outside the router (used by renderWithToasts too).
  • One product fix, found by this PR's new persona test: 11 entity pages (File, Directory, Spreadsheet, Worksheet, Table, Topic, Dashboard, Pipeline, Metric, Search Index, Stored Procedure) built their tabs in a useMemo that read customizedPage?.tabs without depending on it. A persona page layout that loaded after the entity left the default tabs on screen, so a persona that hides a tab still showed it. File showed this every time (it failed CI); the others only worked because other dependencies happened to change afterwards. Each page gets customizedPage?.tabs in its dependency list, one line each.
  • Type errors fixed in this wave's browser tests (Persona type imports, filterDocs typing, contract enum values, the Article entity type). The remaining tsc:check errors are in files unchanged from main.

Tests:

Which test layer and why

  • Browser tests: one page's behaviour with the network mocked by stateful fakes, asserting what the user sees and what the page sent.
  • Java ITs: the server half where no existing IT already covered it; tagged migratedTo.split(...) when both halves matter.

New Java IT methods (20)

  • TagResourceIT: aggregate_tagUsage_countsTheTaggedAssetAndNotTheUnusedTag, list_disabledFalse_leavesOutADisabledTagUntilItIsEnabled, patch_classificationOwner_isInheritedByItsExistingTags, patch_tagOwner_listsTheTagAmongTheOwnersAssets, post_colonSeparatedName_isCreatedReadAndEdited_doubleColonIsRefused, post_tagWithDomain_keepsTheDomain, search_pickerFilterLeavesOutDisabledTagsAndDisabledClassifications, search_tagIndex_findsATagByItsClassificationDisplayName
  • ClassificationResourceIT#list_withTermCount_countsTheSeededSystemTags
  • ColumnResourceIT#test_updateTableColumn_mutuallyExclusiveTags_rejectedAndKeepsTheFirst
  • TableResourceIT#patch_addOneTagRemoveAnother_keepsAppliedByOnTheKeptTag
  • DataContractInheritanceIT (new class, 7 tests): an asset inherits its data product's contract, keeps its own parts, falls back when its contract is deleted, drops it when it leaves the product; only an approved schema contract is inherited; validation stores the result on the asset
  • PolicyResourceIT: test_removingThePolicysLastRuleIsRejected, test_validateConditionAcceptsAValidConditionAndRejectsAnInvalidOne

Test results

On the branch at 9da4c070619, which includes main at 156ea637e7a, before the persona fix above.

Browser tests: 91/91, three clean runs

Every browser-test file this PR adds or changes (20 files), run three times back to back:

Run Files Tests
1 ✅ 20/20 ✅ 91/91
2 ✅ 20/20 ✅ 91/91
3 ✅ 20/20 ✅ 91/91

Java ITs: 20/20 on both engines (parallel lane)

IT methods MySQL + Elasticsearch PostgreSQL + OpenSearch
DataContractInheritanceIT (7), PolicyResourceIT (2) ✅ 9/9 ✅ 9/9
TagResourceIT (4), ClassificationResourceIT, ColumnResourceIT, TableResourceIT ✅ 7/7 ✅ 7/7
TagResourceIT (4 more) ✅ 4/4 ✅ 4/4

Failure found by CI and fixed

  • DataContractLifecycle.File › a persona layout that leaves out the Contract tab… (always failed): the product bug above. The test runs for all 18 contract entity types through the shared contractLifecycle.contract.tsx; only File failed, and the File test file is unchanged by this PR, so the changed-files runs below missed it. After the fix: unit tests of the 11 pages pass (13 suites, 218 tests), and data-contracts/ + customize-page/ (35 files, 243 tests) passed three clean runs. One extra run timed out on 12 tests while the machine's load average was 63; it was rerun once the load dropped.

Flakes and failures found and fixed before opening

  • MutuallyExclusiveColumnTags (always failed): the test mounted the page without the toast host, so the server's refusal never showed. It now mounts with withToasts() and asserts the server's exact message. Not a product bug.
  • TagPage "edited description" (intermittent): userEvent.fill on the block editor sometimes appended to the old text. replaceEditorText clears with the editor's own select-all, waits for empty, fills, and checks the exact text.
  • ClassificationPage first test (intermittent): waited for the first tag-list request with the default 1s during a cold load; now scaled(60_000).
  • TagResourceIT#patch_tagOwner_listsTheTagAmongTheOwnersAssets (always failed): owners is a nested field, so a plain owners.id term never matches. The IT now sends the nested query the UI's getTermQuery sends for the owner's My Data tab.

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>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

🤖 Generated with Claude Code

The tabs useMemo read customizedPage?.tabs without depending on it, so a
layout that loaded after the entity left the default tabs on screen. File
pages showed it every time; ten more pages hid it behind other deps.
@gitar-bot

gitar-bot Bot commented Dec 6, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Adding customizedPage?.tabs to entity-page tab recomputation changes when layouts update, which could alter visible tabs across several entity pages.

Migrates 105 Playwright tests across 24 Tag, Classification, Data Contract, Policy and Custom Property specs to browser tests and Java ITs, tagging the originals as migratedTo without deleting them. 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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tag, Classification, Data Contract, Custom Property and Policy specs as browser tests and Java ITs (Governance wave 2c)

1 participant