Skip to content

fix(apps): ignore unknown fields when reading app extension rows#30432

Open
Vishnuujain wants to merge 4 commits into
mainfrom
fix/app-extension-forward-compatible-reads
Open

fix(apps): ignore unknown fields when reading app extension rows#30432
Vishnuujain wants to merge 4 commits into
mainfrom
fix/app-extension-forward-compatible-reads

Conversation

@Vishnuujain

@Vishnuujain Vishnuujain commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #30431
Related to https://github.com/open-metadata/openmetadata-collate/pull/5207

App run/usage rows are saved as JSON and read back later. If a newer build adds a field to that JSON and you then run older code (a rollback, or an older branch on the same DB), the old code hits a field it doesn't know. The reader was strict, so it threw — and since these rows are read in bulk, one bad row broke the entire read. For metered apps that meant credits couldn't be totalled and chat/agent runs were blocked until the row was deleted by hand.

Fix: read these rows leniently so unknown fields are ignored.

Changes:

  • 5 bulk extension reads in AppRepository now ignore unknown fields (via a shared readExtension() helper).
  • The full App entity read stays strict — unchanged.
  • Added AppRepositoryExtensionCompatibilityTest (fails without the fix).

Type of change:

  • Bug fix

Tests:

  • Unit: AppRepositoryExtensionCompatibilityTest — old code reads a newer row fine; strict read still rejects it (proves the test isn't tautological). Both pass.
  • No API / UI / ingestion changes.

Greptile Summary

Fixes backward-compatible app-extension reads.

  • Routes five bulk and four latest-row readers through lenient deserialization.
  • Adds regression coverage for bulk and latest reads containing unknown fields.
  • Keeps full App entity deserialization strict.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failures remain.

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/AppRepository.java Centralizes lenient app-extension deserialization and applies it to the previously strict bulk and latest-row readers.
openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/AppRepositoryExtensionCompatibilityTest.java Adds direct repository-path regression coverage for unknown fields in both bulk and latest extension reads.

Reviews (3): Last reviewed commit: "Merge branch 'main' into fix/app-extensi..." | Re-trigger Greptile

Context used:

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added the safe to test Add this label to run secure Github workflows on PRs label Jul 24, 2026
@Vishnuujain Vishnuujain self-assigned this Jul 24, 2026
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit c423a6591c02a7526b06247899efacd59d2d7e80 in Playwright run 30103825576, attempt 1.

✅ 536 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 5 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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) 50m 42s

⏱️ Max setup 3m 10s · max shard execution 15m 54s · max shard-job elapsed before upload 19m 35s · reporting 5s

🌐 202.56 requests/attempt · 2.87 app boots/UI scenario · 9.54% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 202.56 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.87 per UI scenario (1605 boots / 559 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 143 0 0 3 0 0
🟡 Shard chromium-02 132 0 1 0 0 0
✅ Shard chromium-03 123 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 23 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
✅ Shard search-rbac-01 27 0 0 2 0 0
🟡 1 flaky test(s) (passed on retry)
  • Pages/Entity.spec.tsDomain Propagation (shard chromium-02, 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

@sonarqubecloud

Copy link
Copy Markdown

@Vishnuujain
Vishnuujain requested a review from a team as a code owner July 24, 2026 15:05
@gitar-bot

gitar-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Updates AppRepository bulk extension reads to ignore unknown fields via a shared helper, addressing the getLatestExtension* strict read finding and ensuring forward compatibility.

✅ 1 resolved
Bug: getLatestExtension* still use strict read, same root cause unfixed

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/AppRepository.java:501-515 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/AppRepository.java:314-317
The PR re-points the five bulk listAppExtension* loops through the lenient readExtension helper, but the sibling single-row readers — getLatestExtensionByName, getLatestExtensionByIdOptional, getLatestExtensionAfterStartTimeByName, getLatestExtensionAfterStartTimeById (and thus getLatestAppRuns*) — still call the strict JsonUtils.readValue. These read the latest extension row, which is the one most likely to have been written by a newer/rolled-back build, so the exact forward-compatibility crash the PR is fixing still occurs for these paths (e.g. credit-status / latest-run lookups will throw JsonParsingException on an unknown field). Route these readValue(result.get(0), clazz) calls through readExtension(...) too for a complete fix.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@Vishnuujain
Vishnuujain enabled auto-merge (squash) July 24, 2026 15:47
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App extension reads fail the whole scan on one row written by a newer build

1 participant