-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(ui): Wave 0 foundations for AntD → ui-core-components migration #30560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chirag-madlani
wants to merge
18
commits into
main
Choose a base branch
from
antd-migration/wave-0-foundations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
45f9361
docs(ui): add antd migration docs home and mapping-guide template
chirag-madlani 3e19464
feat(tooling): add antd codemod scaffold with move-named-imports tran…
chirag-madlani e19913e
feat(tooling): add antd migration sweep-ledger generator
chirag-madlani 54de9a3
fix(tooling): correct selector-count label to total occurrences
chirag-madlani d159c57
test(ui): add visual-regression project with static-page baselines
chirag-madlani fdf0069
test(ui): add entity-details, RJSF form and modal visual baselines
chirag-madlani 290dd75
ci: add visual-regression workflow for openmetadata-ui PRs
chirag-madlani c27d6c4
chore(ui): add knip config and dead-code seed list for antd migration
chirag-madlani 31a6a8c
fix(tooling): skip vendored openmetadata-ui dir in antd ledger scan
chirag-madlani 19e3381
ci: exclude visual-regression specs from e2e shard planning
chirag-madlani ca32ef8
style(ui): organize imports in visual-regression specs
chirag-madlani c251c2c
fix(tooling): count named specifiers in combined default+named antd i…
chirag-madlani f61c8ec
fix(tooling): preserve leading comments when codemod merges into exis…
chirag-madlani e08e413
test(ui): adopt CI-rendered baselines for 8 visual-regression pages
chirag-madlani a4af627
test(ui): drop roles page from visual suite (non-deterministic seeded…
chirag-madlani 66189f3
fix(tooling): preserve type-only imports in move-named-imports codemod
chirag-madlani b2d2f54
ci: pin free-disk-space action to release SHA
chirag-madlani df5fb41
test(ui): widen landing-page diff tolerance to absorb async-widget va…
chirag-madlani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| # Copyright 2021 Collate | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # This workflow runs the Playwright visual-regression suite | ||
| # (openmetadata-ui/src/main/resources/ui/playwright/e2e/VisualRegression) against a MySQL-backed | ||
| # OpenMetadata server. The environment-bootstrap steps (checkout, Java/Node setup, server build + | ||
| # start, sample-data seeding) mirror .github/workflows/playwright-mysql-e2e.yml verbatim, minus the | ||
| # pull_request_target-only labeling/gating steps and the shard matrix, which don't apply to a single | ||
| # fast (~18 spec) suite triggered on regular `pull_request`. | ||
| # | ||
| # Rendering parity with the baselines: the VisualRegression snapshots were captured using the | ||
| # mcr.microsoft.com/playwright:v1.57.0-jammy image (pinned to the @playwright/test version in | ||
| # package.json). The e2e workflow installs Chromium on the bare ubuntu-latest runner and runs tests | ||
| # there directly - fine for functional assertions, but font hinting/anti-aliasing on the bare runner | ||
| # image differs enough from the official Playwright container to make pixel-diff assertions flaky or | ||
| # outright wrong. So only the test-execution step below runs inside that exact container (via | ||
| # `docker run --network host`, reaching the host-run server at localhost:8585); the | ||
| # bootstrap/build/seed steps still run directly on the runner exactly as in the e2e workflow. | ||
| name: playwright-visual-regression | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "openmetadata-ui/**" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: playwright-visual-${{ github.event.pull_request.number || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| playwright-visual-regression: | ||
| name: playwright-visual-regression | ||
| runs-on: ubuntu-latest | ||
| if: ${{ !github.event.pull_request.draft }} | ||
| steps: | ||
| - name: Free Disk Space (Ubuntu) | ||
| uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 | ||
| with: | ||
| tool-cache: false | ||
| android: true | ||
| dotnet: true | ||
| haskell: true | ||
| large-packages: false | ||
| swap-storage: true | ||
| docker-images: false | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Cache Maven Dependencies | ||
| id: cache-output | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: ~/.m2 | ||
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-maven- | ||
|
|
||
| - name: Setup Openmetadata Test Environment | ||
| uses: ./.github/actions/setup-openmetadata-test-environment | ||
| with: | ||
| python-version: "3.10" | ||
| args: "-d mysql" | ||
| ingestion_dependency: "all" | ||
| install-test-dependencies: "false" | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version-file: "openmetadata-ui/src/main/resources/ui/.nvmrc" | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: openmetadata-ui/src/main/resources/ui/ | ||
| run: yarn --ignore-scripts --frozen-lockfile | ||
|
|
||
| # Runs inside the same Playwright image the baselines were generated with (see header | ||
| # comment) instead of on the bare runner. `--network host` lets the container reach the | ||
| # OpenMetadata server that the bootstrap step above already started on localhost:8585. | ||
| # `--ipc host` follows Playwright's own Docker guidance to avoid Chromium running out of | ||
| # shared memory. node_modules were installed on the host above and are bind-mounted in, so | ||
| # only `npx` (bundled with the container's Node) is needed - no dependency on yarn/corepack | ||
| # being set up inside the image. | ||
| - name: Run visual regression suite | ||
| working-directory: openmetadata-ui/src/main/resources/ui | ||
| env: | ||
| PLAYWRIGHT_TEST_BASE_URL: http://localhost:8585 | ||
| run: | | ||
| docker run --rm \ | ||
| --network host \ | ||
| --ipc host \ | ||
| -e CI=true \ | ||
| -e PLAYWRIGHT_TEST_BASE_URL \ | ||
| -v "$PWD:/work" \ | ||
| -w /work \ | ||
| mcr.microsoft.com/playwright:v1.57.0-jammy \ | ||
| npx playwright test --project=visual-regression | ||
|
|
||
| - name: Upload visual diff artifacts | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: visual-regression-diffs | ||
| path: | | ||
| openmetadata-ui/src/main/resources/ui/playwright/output/test-results/** | ||
| openmetadata-ui/src/main/resources/ui/playwright/e2e/VisualRegression/__snapshots__/** | ||
| retention-days: 14 | ||
|
|
||
| - name: Clean Up | ||
| if: always() | ||
| continue-on-error: true | ||
| run: | | ||
| cd ./docker/development | ||
| docker compose down --remove-orphans | ||
| sudo rm -rf "${PWD}/docker-volume" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # AntD → @openmetadata/ui-core-components migration | ||
|
|
||
| Program design: see the Collate repo, `docs/superpowers/specs/2026-07-27-antd-untitled-migration-design.md`. | ||
|
|
||
| ## The sweep playbook (per antd component) | ||
|
|
||
| 1. **Gap check** — grep the *actually used* prop surface across openmetadata-ui, | ||
| collate-ui and collate-local-webserver/ui; compare against the | ||
| `ui-core-components` equivalent. Missing capability is added to | ||
| `openmetadata-ui-core-components` first, in its own PR, with unit tests. | ||
| 2. **Mapping guide** — copy `TEMPLATE.md` to `<component>.md` in this folder and | ||
| fill it in. The guide is the review contract for every PR of that sweep. | ||
| 3. **Codemod** (mechanical components only) — see `tooling/antd-codemods/`. | ||
| 4. **Chunked PRs** — ~20–40 files per PR, chunked by directory. Each PR also | ||
| deletes the dead code it orphans (grep/knip-proven only) and regenerates | ||
| visual baselines for intentionally changed pages. | ||
| 5. **Ledger update** — regenerate the ledger (see `tooling/antd-migration/`). | ||
|
|
||
| ## Rules encoded in every guide | ||
|
|
||
| - Semantic Tailwind tokens only (`tw:bg-primary`), never raw palette or hex. | ||
| - No `tw:ring-*` — borders use `border`/`outline` (see upstream `docs/colors.md` §2.3.1). | ||
| - No string literals — `t('label.…')`, checking existing keys in both locale files first. | ||
| - QueryBuilder files are owned by PR #29849 — do not touch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # <AntdComponent> → <CoreComponent> mapping guide | ||
|
|
||
| **Sweep status:** ledger row `<component>` | ||
| **Core component:** `@openmetadata/ui-core-components` → `<import path>` | ||
| **Codemod:** `tooling/antd-codemods/transforms/<name>.js` (or "manual — no codemod") | ||
|
|
||
| ## Import | ||
|
|
||
| | Before | After | | ||
| |---|---| | ||
| | `import { X } from 'antd';` | `import { Y } from '@openmetadata/ui-core-components';` | | ||
|
|
||
| ## Prop mapping | ||
|
|
||
| | antd prop (as used in repo) | core equivalent | notes | | ||
| |---|---|---| | ||
| | | | | | ||
|
|
||
| ## No direct equivalent — do this instead | ||
|
|
||
| | antd usage | replacement pattern | | ||
| |---|---| | ||
| | | | | ||
|
|
||
| ## Before / after examples | ||
|
|
||
| <!-- 2–3 real examples lifted from the codebase --> | ||
|
|
||
| ## CSS to delete with this sweep | ||
|
|
||
| <!-- .ant-* override selectors and component .less files this sweep orphans --> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/knip@5/schema.json", | ||
| "entry": ["src/index.tsx"], | ||
| "project": ["src/**/*.{ts,tsx}"], | ||
| "ignore": [ | ||
| "src/generated/**", | ||
| "src/locale/**", | ||
| "**/*.test.{ts,tsx}", | ||
| "**/mocks/**", | ||
| "**/__mocks__/**" | ||
| ], | ||
| "ignoreDependencies": [".*"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+102 KB
...gression/__snapshots__/entityDetails.spec.ts-snapshots/table-details-schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+190 KB
...alRegression/__snapshots__/interactiveStates.spec.ts-snapshots/delete-modal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+119 KB
..._snapshots__/interactiveStates.spec.ts-snapshots/rjsf-mysql-connection-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+157 KB
...e/VisualRegression/__snapshots__/staticPages.spec.ts-snapshots/applications.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+90.8 KB
...right/e2e/VisualRegression/__snapshots__/staticPages.spec.ts-snapshots/bots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+100 KB
...e/VisualRegression/__snapshots__/staticPages.spec.ts-snapshots/data-quality.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+129 KB
...ualRegression/__snapshots__/staticPages.spec.ts-snapshots/database-services.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+121 KB
...ht/e2e/VisualRegression/__snapshots__/staticPages.spec.ts-snapshots/explore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+99.2 KB
...t/e2e/VisualRegression/__snapshots__/staticPages.spec.ts-snapshots/glossary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+135 KB
...sualRegression/__snapshots__/staticPages.spec.ts-snapshots/incident-manager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+245 KB
.../__snapshots__/staticPages.spec.ts-snapshots/landing-page-sidebar-collapsed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+223 KB
...e/VisualRegression/__snapshots__/staticPages.spec.ts-snapshots/landing-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+110 KB
...t/e2e/VisualRegression/__snapshots__/staticPages.spec.ts-snapshots/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+92 KB
...ight/e2e/VisualRegression/__snapshots__/staticPages.spec.ts-snapshots/teams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+130 KB
...ight/e2e/VisualRegression/__snapshots__/staticPages.spec.ts-snapshots/users.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions
71
openmetadata-ui/src/main/resources/ui/playwright/e2e/VisualRegression/entityDetails.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| /* | ||
| * Copyright 2026 Collate. | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| import { expect, Page, test } from '@playwright/test'; | ||
| import { TableClass } from '../../support/entity/TableClass'; | ||
| import { getDefaultAdminAPIContext } from '../../utils/common'; | ||
| import { | ||
| gotoForScreenshot, | ||
| SCREENSHOT_OPTS, | ||
| } from '../../utils/visualRegression'; | ||
|
|
||
| /** | ||
| * Entity names are randomized by the support classes (TableClass generates a | ||
| * `pw-database-service-<uuid>` service, a `pw-table-<fullUuid>` table and | ||
| * `<uuid>`-suffixed column names), so mask every element that renders a | ||
| * name; the layout, tabs and schema table are the subject under test. | ||
| * | ||
| * - `entity-header-display-name` / `entity-header-name`: display name + name | ||
| * lines in EntityHeaderTitle (both contain random uuids). | ||
| * - `breadcrumb`: service > database > schema names. | ||
| * - `column-name`: each column-name link in SchemaTable (uuid-suffixed). | ||
| * - `.custom-property-right-panel-container`: right-panel | ||
| * CustomPropertyTable (no testid in the right-panel variant) — property | ||
| * names come from seeded custom properties with random `cp-<uuid>` names. | ||
| */ | ||
| const NAME_MASKS = [ | ||
| '[data-testid="entity-header-display-name"]', | ||
| '[data-testid="entity-header-name"]', | ||
| '[data-testid="breadcrumb"]', | ||
| '[data-testid="column-name"]', | ||
| '.custom-property-right-panel-container', | ||
| ]; | ||
|
|
||
| const table = new TableClass(); | ||
|
|
||
| test.beforeAll(async ({ browser }) => { | ||
| const { apiContext, afterAction } = await getDefaultAdminAPIContext(browser); | ||
| await table.create(apiContext); | ||
| await afterAction(); | ||
| }); | ||
|
|
||
| test.afterAll(async ({ browser }) => { | ||
| const { apiContext, afterAction } = await getDefaultAdminAPIContext(browser); | ||
| await table.delete(apiContext); | ||
| await afterAction(); | ||
| }); | ||
|
|
||
| const maskFor = (page: Page) => | ||
| NAME_MASKS.map((selector) => page.locator(selector)); | ||
|
|
||
| test('table entity details (schema tab) matches baseline', async ({ page }) => { | ||
| await gotoForScreenshot( | ||
| page, | ||
| `/table/${encodeURIComponent( | ||
| table.entityResponseData?.fullyQualifiedName ?? '' | ||
| )}` | ||
| ); | ||
| await expect(page).toHaveScreenshot('table-details-schema.png', { | ||
| ...SCREENSHOT_OPTS, | ||
| mask: maskFor(page), | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.