Repository navigation
Fixes #32677: preserve user data in table-type custom property editor when a column is named 'id' - #32741
Conversation
… when a column is named 'id'
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
✅ Playwright Results — workflow succeededValidated commit ✅ 4500 passed · ❌ 0 failed · 🟡 10 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 37m 19s ⏱️ Max setup 4m 57s · max shard execution 20m 41s · max shard-job elapsed before upload 23m 54s · reporting 26s 🌐 217.62 requests/attempt · 2.31 app boots/UI scenario · 42.63% common-shard skew Optimization targets still in progress:
🟡 10 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
| Count | Rule |
|---|---|
| 1 | react-hooks/exhaustive-deps |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Settings/CustomProperty/AddCustomProperty/AddCustomProperty.tsx:133:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changedThe frontend row-id key rename (id -> __row_id__ in EditTableTypePropertyModal) already fixes the data loss on its own, and __row_id__ is never persisted. The backend reserved-name check added the wrong guarantee at the wrong layer: it rejected `id` -- a legitimate, previously-valid column name -- at the API, and hard-coded a frontend grid sentinel into backend validation. - Revert TypeRepository.validateTableTypeConfig reserved-name rejection and its RESERVED_TABLE_COLUMN_NAMES constant. - Remove the three TypeResourceIT tests (and now-unused imports/fixtures) that only exercised that backend validation. - Scope the AddCustomProperty form guard to the frontend's own sentinel `__row_id__` (drop `id`), so the form no longer bans a valid column name.
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated 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 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 |
|
* Fixes #32672: show error placeholder on Topic page for sustained fetch failures (#32736) * Fixes #32672: show error placeholder on Topic page for sustained fetch failures * chore(playwright): auto-refresh impact-map.generated.json [skip ci] --------- Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com> Co-authored-by: Karan Hotchandani <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Rohit Jain <[email protected]> * Fixes #32632: reset Impact Analysis pagination to page 1 on search/quick-filter change (#32699) * fix(ui): reset Impact Analysis pagination to page 1 on search/quick-filter change * test(ui): add Playwright pagination-reset tests for Impact Analysis (#32632) Add two E2E tests to Pagination.spec.ts that guard the fix introduced in change): - "should reset Impact Analysis table pagination to page 1 on search change" - "should reset Impact Analysis table pagination to page 1 on quick filter change" Both tests create 16 downstream TableClass entities (exceeding PAGE_SIZE_BASE=15) so two pages are reachable via ?pageSize=15 in the URL. Each test navigates to page 2, then triggers the filter/search, and asserts the page-indicator resets to "1 of X". Also adds skipUrlParamCheck option to testCompletePaginationWithSearch utility for callers where search state lives in component state rather than the URL. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * lint fix * chore(playwright): auto-refresh impact-map.generated.json [skip ci] --------- Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com> Co-authored-by: Rohit0301 <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]> Co-authored-by: Rohit Jain <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Chirag Madlani <[email protected]> * fix(ui): reset TierCard selectedTier on close to prevent stale radio state (#33115) * fix(ui): reset TierCard selectedTier on close to prevent stale radio state Two bugs caused the tier radio button to show stale state: - Bug A: cancelling a tier change left the cancelled tier selected on reopen - Bug B: after a successful save, the old tier was shown on reopen because handleOpenChange closed over a stale currentTier before React propagated the updated prop Fix: extract handleOpenChange to reset selectedTier to currentTier on every close, and add a useEffect([currentTier]) guard that re-syncs when the prop updates while the popover is closed (covers the save-stale race). Adds unit tests (TierWidget.test.tsx) and a Playwright E2E spec (TierWidget.spec.ts) covering both scenarios. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * chore(playwright): auto-refresh impact-map.generated.json [skip ci] * minor fix * chore(ui): fix formatting in TierWidget spec and test files Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(ui): track TierCard open state internally to guard currentTier re-sync The useEffect that re-syncs selectedTier on currentTier change was guarding with !popoverProps?.open, but uncontrolled usages (no popoverProps) have open === undefined (always falsy), so the reset fired mid-edit, silently discarding the user's in-progress selection. Fix: add isOpen state updated in handleOpenChange so the guard works for both controlled and uncontrolled usages. Also adds isOpen to the useEffect dependency array to satisfy react-hooks/exhaustive-deps. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * chore(ui): move TableClass init into beforeAll and clarify onOpenChange override Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Fixes #32677: preserve user data in table-type custom property editor when a column is named 'id' (#32741) * Fixes #32677: preserve user data in table-type custom property editor when a column is named 'id' * Remove backend reserved-column validation; keep FE __row_id__ guard only The frontend row-id key rename (id -> __row_id__ in EditTableTypePropertyModal) already fixes the data loss on its own, and __row_id__ is never persisted. The backend reserved-name check added the wrong guarantee at the wrong layer: it rejected `id` -- a legitimate, previously-valid column name -- at the API, and hard-coded a frontend grid sentinel into backend validation. - Revert TypeRepository.validateTableTypeConfig reserved-name rejection and its RESERVED_TABLE_COLUMN_NAMES constant. - Remove the three TypeResourceIT tests (and now-unused imports/fixtures) that only exercised that backend validation. - Scope the AddCustomProperty form guard to the frontend's own sentinel `__row_id__` (drop `id`), so the form no longer bans a valid column name. * chore(playwright): auto-refresh impact-map.generated.json [skip ci] * chore(playwright): auto-refresh impact-map.generated.json [skip ci] * i18n: translate reserved-column-name into all non-English locales yarn i18n stamped the English string verbatim into every locale for message.reserved-column-name; replace those placeholders with real translations (19 non-en locales), preserving the {{name}} interpolation. --------- Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com> Co-authored-by: sonika-shah <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Karan Hotchandani <[email protected]> * chore(playwright): auto-refresh impact-map.generated.json * fix(backport): use @playwright/test in TierWidget.spec.ts (base.ts absent in 2.0) support/fixtures/base.ts was introduced in main after the 2.0 branch cut. Swap the import to @playwright/test so Playwright can resolve the module during test discovery on this branch. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com> Co-authored-by: Karan Hotchandani <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <[email protected]> Co-authored-by: Chirag Madlani <[email protected]> Co-authored-by: sonika-shah <[email protected]>



Detail bug report: View on Detail
Describe your changes:
Closes #32677
I worked on preserving user data in the table-type custom property editor when a user defines a column literally named
id, because the editor was silently overwriting and then stripping the user'sidcolumn value on every save (data loss).Type of change:
High-level design:
N/A — small change.
Root cause.
EditTableTypePropertyModalreused the bare literalidas its internal row-identifier key: theuseStateinitializer didrows.map((row, index) => ({ ...row, id: index + '' }))(clobbering any userrow.idwith the row index) andhandleUpdatedidomit(row, 'id')on save (stripping theidcolumn from every row). Since table-type custom property columns are user-defined and"id"is a legal column name end-to-end (UI form, backendvalidateTableTypeConfig, generatedTableConfigschema all accept it), this was a reachable, silent data-loss collision.Fix (two layers):
__row_id__instead of bareid. TheuseStateinitializer seeds{ ...row, [ROW_ID_KEY]: index + '' }, theuseGridEditControllerhook is invoked withrowIdKey: ROW_ID_KEY, andhandleUpdatestripsomit(row, ROW_ID_KEY). User column data — including a column literally namedid— now passes through load and save verbatim.AddCustomProperty.tsxcolumnsvalidator) and the backend validator (TypeRepository.validateTableTypeConfig) now rejectidand__row_id__as column names at definition time, with areserved-column-namemessage (new i18n key synced to all 20 locales). The backend check covers direct API calls that bypass the UI.The default
rowIdKey = 'id'inuseGridEditControlleris unchanged, soBulkEntityImportPage(which relies on it) andAddDomainFormExtensionFields(which usesrowIdKey: null) are unaffected.Tests:
Use cases covered
idpreserves the user'sidvalue through load and save (no data loss).id,__row_id__) are rejected at definition time by both the UI form and the backend API.useGridEditControllerconsumers (BulkEntityImportPage,AddDomainFormExtensionFields) are unaffected.Unit tests
openmetadata-ui/.../TableTypeProperty/EditTableTypePropertyModal.test.tsx— addedshould preserve a user-defined column named "id" on init and save (no data loss)(renders withcolumns: ['id', 'name'],rows: [{ id: 'abc-123', name: 'foo' }], assertsdataSource[0].id === 'abc-123'andonSavereceives theidvalue verbatim) andshould not leak the internal __row_id__ key into saved rows.Backend integration tests
openmetadata-integration-tests/for the changed API validation.openmetadata-integration-tests/.../TypeResourceIT.java—test_addTableTypeCustomPropertyWithValidColumns(happy path:["name","value"]accepted and persisted),test_addTableTypeCustomPropertyWithReservedColumnName_fails(["id","name"]rejected),test_addTableTypeCustomPropertyWithReservedRowIdKey_fails(["__row_id__","name"]rejected).TypeResourceITsuite against a running Postgres + OpenSearch stack: 37 tests run, 0 failures, 0 errors (1 pre-existing unrelated skip). The 3 new tests trigger HTTP 400 from the new backend validation check with the reserved-column message.Ingestion integration tests
Playwright (UI) tests
CustomProperties.spec.tsend-to-end.Manual testing performed
EditTableTypePropertyModal(8/8 pass),AddCustomProperty.test(3/3),AddDomainFormExtensionFields(58/58 incl. thecolumns: ['id']test data),CustomPropertyTable(40/40),BulkEntityImportPage(36/36). Routine gates also pass: ESLint 0 errors, Prettier clean,tsc --noEmitshows no errors in changed files,mvn spotless:checkclean (service + integration tests),yarn check-i18nclean across 20 locales.mvn compile -pl openmetadata-servicesucceeds; brought up Postgres + OpenSearch viadocker/development/docker-compose-postgres.yml, ran DB migrations (OpenMetadataOperations migrate --force), started the OpenMetadata server withJWT_KEY_ID=test-keypointing at the test-resource RSA keys, minted an admin JWT, then exercised the public Type API directly:PUT /api/v1/metadata/types/<table>withcustomPropertyConfig.config.columnsincluding"id"→ HTTP 400 with"Column name(s) 'id' are reserved for internal use and cannot be used as table custom property columns."; same for"__row_id__";/["name","value"]→ HTTP 200 and the property is subsequently returned byGET ...?fields=customPropertieswithconfig={"columns":["name","value"]}.playwright/e2e/Pages/CustomProperties.spec.ts. Installed Playwright Chromium + system libs (libatk-1.0), started the Vite UI dev server on :3000 proxying to the backend, and bootstrapped the admin user record via API. Blocked at the auth-setup step:POST /api/v1/auth/loginfor[email protected]/adminreturns HTTP 401 because the standard IT bootstrap pipeline (testcontainers /mvn verify -Ppostgres-opensearch) is what provisions the admin user with the password hash the auth endpoint expects; a manually created dev-server user does not satisfy it. The unit and integration tests above cover the same contracts the Playwright suite would exercise.UI screen recording / screenshots:
Not applicable. The UI change is a non-visual rename of an internal row-id key plus a form validator; no user-visible layout/styling/interactions changed.
Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
For UI changes: I attached a screen recording and/or screenshots above.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference.
Automatic Fixes PRs can be configured here.