Skip to content

fix(ui): table version page shows historical columns instead of live API columns#29174

Open
aniketkatkar97 wants to merge 1 commit into
open-metadata:mainfrom
aniketkatkar97:fix-28690
Open

fix(ui): table version page shows historical columns instead of live API columns#29174
aniketkatkar97 wants to merge 1 commit into
open-metadata:mainfrom
aniketkatkar97:fix-28690

Conversation

@aniketkatkar97

@aniketkatkar97 aniketkatkar97 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #28690

The table version page was fetching live/current columns via getTableColumnsByFQN and overlaying changeDescription diffs on top. This made the version view misleading in two ways:

  • Unchanged columns showed their current live value instead of the historical value at the selected version (e.g., viewing v0.1 showed customer_email as "Customer contact email" from v0.3, not the original "Primary email...")
  • Changed columns showed diff markup (old + new text together) using the live column as the base, not the stored historical value

Root Cause

TableVersion.component.tsx called getTableColumnsByFQN(tableFqn) on every version page load, returning the table's current columns regardless of which version was selected.

Fix

Use currentVersionData.columns — the historical column snapshot already present in the version entity API response — as the base for getColumnsDataWithVersionChanges. Remove:

  • Live API column fetching (getTableColumnsByFQN, searchTableColumnsByFQN)
  • Server-side pagination state and callbacks (usePaging, fetchPaginatedColumns, handleColumnsPageChange, paginationProps)
  • Server-side search callback — VersionTable already has built-in client-side search via searchInColumns

Files Changed

File Change
TableVersion.component.tsx Use currentVersionData.columns as column base; remove live API fetch
TableVersion.test.tsx Add tests verifying historical columns are passed to VersionTable
EntityVersionPages.spec.ts Add Playwright test: v0.1 column description shows historical value, not live value

Test plan

  • Unit tests: yarn test --testPathPatterns=TableVersion.test
  • Playwright: EntityVersionPages.spec.ts — new step should show historical column descriptions in version view verifies v0.1 shows the pre-patch column description and NOT the post-patch live value
  • Manual: create table with 2 columns, update one column description, view previous version — verify unchanged column shows its original historical description

🤖 Generated with Claude Code

Greptile Summary

This PR fixes a bug where the table version page displayed live/current column data instead of the historical snapshot by replacing the getTableColumnsByFQN API call with currentVersionData.columns already present in the version entity response.

  • TableVersion.component.tsx: Removes ~90 lines of server-side pagination/search state and the live API fetch; columns useMemo now derives directly from currentVersionData.columns, which is the correct historical snapshot for every selected version.
  • TableVersion.test.tsx: Adds two focused unit tests that verify VersionTable receives props from currentVersionData rather than from a mocked API response.
  • EntityVersionPages.spec.ts: Adds an E2E regression step that patches a column description, navigates to v0.1, and asserts the pre-patch description is shown; the freshTable cleanup deletes only the table entity and leaves the service/database/schema hierarchy behind.
  • sv-se.json: Adds SSO-related translation keys in English rather than Swedish, which appear unrelated to the table version fix.

Confidence Score: 4/5

The core fix is safe and well-scoped; the only concerns are minor test cleanup and unrelated English strings in the Swedish locale file.

The component change is correct — currentVersionData.columns is the right source for a version history page. The removed server-side pagination/search code was actively wrong for a historical view. Unit tests cover the new behavior. The two issues are both non-blocking: orphaned test resources from incomplete Playwright cleanup, and SSO translation keys in English inside sv-se.json that appear to belong to a different change.

sv-se.json warrants a second look to confirm the English-language SSO entries are intentional; EntityVersionPages.spec.ts cleanup block should be reviewed for the service/schema teardown gap.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/components/Database/TableVersion/TableVersion.component.tsx Core bug fix: replaces live API column fetch with currentVersionData.columns for correct historical column rendering; removes ~90 lines of pagination/search boilerplate
openmetadata-ui/src/main/resources/ui/src/components/Database/TableVersion/TableVersion.test.tsx Two new unit tests verify VersionTable receives columns from currentVersionData and reflects updates when version changes
openmetadata-ui/src/main/resources/ui/playwright/e2e/VersionPages/EntityVersionPages.spec.ts New E2E step creates a fresh table, patches a column description, navigates to v0.1, and asserts the original description is shown; cleanup only deletes the table entity without the service/database/schema hierarchy
openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json Adds SSO test-login and sso-configuration-test-* translation keys in English rather than Swedish; appears unrelated to the table version fix

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant TableVersionPage
    participant VersionAPI as Version API (/versions/0.1)

    User->>TableVersionPage: Select version v0.1
    TableVersionPage->>VersionAPI: "GET /tables/{id}/versions/0.1"
    VersionAPI-->>TableVersionPage: "{ columns: [...historical...], changeDescription: {...} }"

    Note over TableVersionPage: BEFORE (buggy)<br/>pruneEmptyChildren(liveApiColumns)<br/>+ changeDescription overlay

    Note over TableVersionPage: AFTER (fixed)<br/>pruneEmptyChildren(currentVersionData.columns)<br/>+ changeDescription overlay

    TableVersionPage->>TableVersionPage: getColumnsDataWithVersionChanges(changeDescription, historicalCols)
    TableVersionPage-->>User: Render VersionTable with correct historical columns
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant User
    participant TableVersionPage
    participant VersionAPI as Version API (/versions/0.1)

    User->>TableVersionPage: Select version v0.1
    TableVersionPage->>VersionAPI: "GET /tables/{id}/versions/0.1"
    VersionAPI-->>TableVersionPage: "{ columns: [...historical...], changeDescription: {...} }"

    Note over TableVersionPage: BEFORE (buggy)<br/>pruneEmptyChildren(liveApiColumns)<br/>+ changeDescription overlay

    Note over TableVersionPage: AFTER (fixed)<br/>pruneEmptyChildren(currentVersionData.columns)<br/>+ changeDescription overlay

    TableVersionPage->>TableVersionPage: getColumnsDataWithVersionChanges(changeDescription, historicalCols)
    TableVersionPage-->>User: Render VersionTable with correct historical columns
Loading

Reviews (1): Last reviewed commit: "fix(ui): table version page uses histori..." | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

…PI columns

Closes open-metadata#28690

The TableVersion component was fetching live/current columns via
getTableColumnsByFQN on every version page load, then overlaying
changeDescription diffs on top. This caused unchanged columns to show
their latest live values instead of the historical values for the
selected version.

Fix: use currentVersionData.columns (the historical snapshot already
present in the version entity response) as the base for column diff
computation. Remove the live API fetch, server-side pagination, and
server-side search callback — VersionTable already handles client-side
search via searchInColumns internally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aniketkatkar97 aniketkatkar97 requested a review from a team as a code owner June 18, 2026 09:53
Copilot AI review requested due to automatic review settings June 18, 2026 09:53
@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Jun 18, 2026
"test-entity": "Testa {{entity}}",
"test-level-lowercase": "testnivå",
"test-library": "Testbibliotek",
"test-login": "Test Login",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Quality: Unrelated SSO locale strings added to sv-se.json

The change to openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json adds keys that are unrelated to this PR's scope (table version columns): test-login, sso-configuration-test-failed-*, sso-new-config-save-warning, and sso-test-login-*. These appear to be incidentally included (likely from an i18n key-sync or rebase) and the values are left in English rather than translated to Swedish, which is inconsistent with the rest of this localization file. Consider removing these unrelated entries from this PR (or providing proper Swedish translations if they must stay) so the changeset stays focused on the version-page fix.

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Updates TableVersion component to use historical column snapshots instead of live API data, resolving the issue of incorrect column descriptions in version history. Please remove the unrelated SSO locale string changes added to sv-se.json.

💡 Quality: Unrelated SSO locale strings added to sv-se.json

📄 openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json:2291 📄 openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json:3466-3477

The change to openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json adds keys that are unrelated to this PR's scope (table version columns): test-login, sso-configuration-test-failed-*, sso-new-config-save-warning, and sso-test-login-*. These appear to be incidentally included (likely from an i18n key-sync or rebase) and the values are left in English rather than translated to Swedish, which is inconsistent with the rest of this localization file. Consider removing these unrelated entries from this PR (or providing proper Swedish translations if they must stay) so the changeset stays focused on the version-page fix.

🤖 Prompt for agents
Code Review: Updates TableVersion component to use historical column snapshots instead of live API data, resolving the issue of incorrect column descriptions in version history. Please remove the unrelated SSO locale string changes added to sv-se.json.

1. 💡 Quality: Unrelated SSO locale strings added to sv-se.json
   Files: openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json:2291, openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json:3466-3477

   The change to `openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json` adds keys that are unrelated to this PR's scope (table version columns): `test-login`, `sso-configuration-test-failed-*`, `sso-new-config-save-warning`, and `sso-test-login-*`. These appear to be incidentally included (likely from an i18n key-sync or rebase) and the values are left in English rather than translated to Swedish, which is inconsistent with the rest of this localization file. Consider removing these unrelated entries from this PR (or providing proper Swedish translations if they must stay) so the changeset stays focused on the version-page fix.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Comment on lines +340 to +343
`[data-row-key$="${col0Name}"] [data-testid="viewer-container"]`
)
).toContainText(col0OriginalDesc);

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.

P2 Incomplete test resource cleanup

freshTable.create(apiContext) provisions a full service → database → schema → table hierarchy, but the cleanup only deletes the table entity itself. The service, database, and schema are never removed, causing orphaned resources to accumulate in the test environment across repeated CI runs. Consider using freshTable.delete(apiContext) (if that method handles the full chain) or manually deleting in reverse order, similar to the outer tableClass teardown pattern used elsewhere in the spec.

"test-entity": "Testa {{entity}}",
"test-level-lowercase": "testnivå",
"test-library": "Testbibliotek",
"test-login": "Test Login",

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.

P2 Untranslated SSO strings in Swedish locale file

The newly added SSO keys (sso-configuration-test-failed-description, sso-configuration-test-success, sso-test-login-*, test-login, etc.) are all in English inside sv-se.json. Every other SSO key nearby is in Swedish (e.g. "sso-provider-not-supported": "SSO-leverantören {{provider}} stöds inte."). These also appear unrelated to the table version fix described in this PR — they likely belong to a different branch or change set.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

Pull request overview

This PR fixes the Table version view to render a true historical schema snapshot by using currentVersionData.columns (from the version entity response) instead of fetching and overlaying the table’s live/current columns.

Changes:

  • Update TableVersion to base schema rendering on currentVersionData.columns and remove live column fetching + paging/search plumbing.
  • Add unit test coverage to ensure VersionTable receives historical column data, and add a Playwright regression test validating v0.1 shows historical column descriptions (fix #28690).
  • Add new locale keys in sv-se.json for SSO “test login”/validation messaging.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
openmetadata-ui/src/main/resources/ui/src/components/Database/TableVersion/TableVersion.component.tsx Switch schema base data to currentVersionData.columns; remove live columns API pagination/search wiring.
openmetadata-ui/src/main/resources/ui/src/components/Database/TableVersion/TableVersion.test.tsx Add tests asserting historical columns are passed into VersionTable.
openmetadata-ui/src/main/resources/ui/playwright/e2e/VersionPages/EntityVersionPages.spec.ts Add Playwright step asserting historical column descriptions are shown for v0.1 (not live values).
openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json Add Swedish-locale keys for SSO config validation/test-login messaging.

Comment on lines +161 to +167
const historicalColumnNames = (mockTableData.columns ?? []).map(
(col) => col.name
);

historicalColumnNames.forEach((name) => {
expect(receivedColumns.some((col) => col.name === name)).toBe(true);
});
"test-entity": "Testa {{entity}}",
"test-level-lowercase": "testnivå",
"test-library": "Testbibliotek",
"test-login": "Test Login",
Comment on lines +3466 to +3469
"sso-configuration-test-failed-description": "Validation failed. Please review your configuration and try again.",
"sso-configuration-test-failed-with-count": "Validation failed with {{count}} error(s). Review the highlighted fields below and try again.",
"sso-configuration-test-success": "Your SSO configuration is valid and reachable. You can save it when you're ready.",
"sso-new-config-save-warning": "Saving a new SSO configuration will sign you out and redirect you to the login page. Test your configuration first to avoid being locked out.",
Comment on lines +3471 to +3477
"sso-test-login-description": "Sign in with your identity provider using these unsaved settings. This runs in a separate window and never changes your current session.",
"sso-test-login-error": "The sign-in could not be validated due to a server error. Please try again.",
"sso-test-login-failed": "Sign-in completed, but this configuration would reject the login.",
"sso-test-login-no-token": "No token was returned from the identity provider.",
"sso-test-login-popup-failed": "The test sign-in was cancelled or could not be completed. Please try again.",
"sso-test-login-success": "You signed in successfully as {{email}}. These settings are safe to save.",
"sso-test-login-waiting": "Complete the sign-in in the popup window to continue.",
@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.26% (66544/106868) 44.02% (37229/84567) 45.37% (11179/24639)

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 3 failure(s), 11 flaky

✅ 4297 passed · ❌ 3 failed · 🟡 11 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
🔴 Shard 1 298 2 2 4
🟡 Shard 2 811 0 1 9
🟡 Shard 3 811 0 2 8
🟡 Shard 4 855 0 2 12
🟡 Shard 5 732 0 1 47
🔴 Shard 6 790 1 3 8

Genuine Failures (failed on all attempts)

Features/Pagination.spec.ts › should test pagination on Table version page columns (shard 1)
�[31mTest timeout of 60000ms exceeded.�[39m
Features/Pagination.spec.ts › should test search on Table version page columns (shard 1)
�[31mTest timeout of 60000ms exceeded.�[39m
VersionPages/EntityVersionPages.spec.ts › Table (shard 6)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoContainText�[2m(�[22m�[32mexpected�[39m�[2m)�[22m failed

Locator: locator('[data-row-key$="user_idd018e3b3"] [data-testid="viewer-container"]')
Expected substring: �[32m"Unique identifier for the user of your Shopify POS or your Shopify admin."�[39m
Error: strict mode violation: locator('[data-row-key$="user_idd018e3b3"] [data-testid="viewer-container"]') resolved to 3 elements:
    1) <div dir="ltr" data-testid="viewer-container" class="rich-text-editor-container">…</div> aka getByTestId('viewer-container').nth(1)
    2) <div dir="ltr" data-testid="viewer-container" class="rich-text-editor-container">…</div> aka getByTestId('viewer-container').nth(2)
    3) <div dir="ltr" data-testid="viewer-container" class="rich-text-editor-container">…</div> aka getByTestId('viewer-container').nth(3)

Call log:
�[2m  - Expect "toContainText" with timeout 15000ms�[22m
�[2m  - waiting for locator('[data-row-key$="user_idd018e3b3"] [data-testid="vi
🟡 11 flaky test(s) (passed on retry)
  • Features/Pagination.spec.ts › should test API Collection normal pagination (shard 1, 1 retry)
  • Flow/Metric.spec.ts › verify metric expression update (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Database service (shard 2, 1 retry)
  • Features/IncidentManager.spec.ts › Resolving incident & re-run pipeline (shard 3, 1 retry)
  • Flow/ExploreAggregationCountsMatching.spec.ts › should verify left panel counts and tab search results for normal search (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Duration (shard 4, 1 retry)
  • Pages/DataContractInheritance.spec.ts › Delete Asset Contract - Falls back to showing inherited contract from Data Product (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage service type filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Admin user can edit teams from the user profile (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

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

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Table version page shows live column values and inline diffs instead of true historical column state

2 participants