Skip to content

Fixes #33324: let a force-sync refresh connector-supplied custom properties - #35622

Merged
harshsoni2024 merged 3 commits into
mainfrom
fix/connector-extension-refresh-33324
Oct 17, 2026
Merged

harshsoni2024 merged 3 commits into
mainfrom
fix/connector-extension-refresh-33324

Conversation

@harshsoni2024

@harshsoni2024 harshsoni2024 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #33324

Connector-supplied custom properties landed on an entity's first write and never changed
again. A corrected source value did not propagate, and a property added at the source never
appeared. Deleting and re-ingesting the entity was the only workaround.

EntityRepository.updateExtension reverts every bot PUT to the stored extension. Ingestion
authenticates as ingestion-bot and writes over the bulk PUT path, so that guard caught every
ingestion run:

if (updatedByBot() && operation == Operation.PUT) {
  updated.setExtension(origExtension);   // always, with no way out
  return;
}

The guard is right — it stops a scheduled re-sync from overwriting custom properties a user
curated in the UI. What it lacked was the opt-in that every comparable field already honours.
overrideMetadata is set on the updater and read by updateDescription, updateDisplayName,
updateTags and updateCertification, but 0 of the class's 25 overrideMetadata references
were inside updateExtension
. It now takes the same shape as its four siblings.

Default behaviour does not change: overrideMetadata defaults to false, so nothing moves until
an operator turns on Override Metadata for that pipeline.

Type of change:

  • Bug fix

High-level design:

Small diff, but it sits in the generic EntityUpdater and makes one non-obvious choice, so it is
worth stating rather than leaving as N/A.

A force-sync merges; it does not replace. The diff below the guard treats a stored key the
request omits as a deletion. Ingestion only ever sends the properties its own source produces —
Glue sends Glue parameters, dbt sends its own — so simply honouring overrideMetadata and letting
the existing diff run would delete every custom property a user had added in the UI the first time
any connector force-synced a single property of its own. That is precisely the loss the bot guard
exists to prevent, so the incoming extension is merged over the stored one: keys the request
carries win, keys it omits are kept.

Why not match tags, which do replace under the same flag? TagLabel carries LabelType and
the tag path filters on it, so a manual label survives. A custom property value carries no
provenance at all — the server cannot tell a connector-owned key from a hand-curated one. The two
are only superficially alike.

Rejected: per-key extension provenance, the other option #33324 raises. It would also let a
force-sync delete properties the source dropped, but it needs a schema and migration for ownership
and changes every writer of an extension. Out of scope for a bug fix.

Cost, stated plainly: a property deleted at the source lingers until someone removes it by
hand. That is the trade for not deleting curated data, and it is what provenance would later fix.

Recorded as docs/decisions/2026-10-16-a-force-sync-merges-connector-supplied-custom-properties.md
and cited from the Javadoc, because a later contributor could reasonably "simplify" the merge into
a replace, and this description is gone from git log after the squash-merge.

Blast radius: updateExtension is on the generic EntityUpdater, so this reaches every entity
type and every writer of an extension — Athena and Glue via the table hook, dbt on Metric, SAS on
Table.

Tests:

Use cases covered

  • An operator enables Override Metadata on a Glue/Athena pipeline; a changed source property
    now reaches the already-ingested table instead of being reverted.
  • A property added at the source after first ingestion now appears on re-run.
  • A custom property a user set in the UI survives a force-sync that does not mention it.
  • A pipeline without Override Metadata still cannot touch a stored extension (unchanged).
  • A connector not collecting custom properties sends no extension and does not blank the stored
    ones — covered for both null and {}.

Unit tests

  • I added unit tests for the new/changed logic.

Added: openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/EntityRepositoryExtensionTest.java
(8 cases, driving updateExtension through a real EntityUpdater).

Three fail without the production change — the issue's exact symptoms:

Test Without the fix
botPutWithOverrideMetadataAppliesIncomingExtension expected: <refreshed> but was: <stale>
botPutWithOverrideMetadataAddsNewlyIntroducedProperty expected: <30> but was: <null>
botPutWithOverrideMetadataKeepsPropertyTheConnectorDoesNotSend expected: <refreshed> but was: <stale>

The other five pin behaviour that must not move, and pass against the unfixed code — so they
are real regression guards, not artefacts of the change:
botPutWithoutOverrideMetadataKeepsStoredExtension,
botPutOmittingExtensionWithOverrideMetadataKeepsStoredExtension,
botPutWithEmptyExtensionAndOverrideMetadataKeepsStoredExtension,
botPutWithOverrideMetadataPassesANonObjectExtensionThrough,
humanPutAppliesIncomingExtensionWithoutOverrideMetadata.

Commands run:

mvn -pl openmetadata-service test -Dtest=EntityRepositoryExtensionTest
  -> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0

mvn -pl openmetadata-service test -Dtest='org.openmetadata.service.jdbi3.*Test'
  -> Tests run: 1213, Failures: 0, Errors: 0, Skipped: 0

mvn -pl openmetadata-service test          # full module, as PR CI runs it
  -> still running at the time of writing; the jdbi3 package above is where the change lives

mvn -pl openmetadata-service spotless:check -> PASS
python3 .github/scripts/plan_local_java_tests.py --check-branch --base upstream/main
  -> "this branch leaves the map complete" (untestedClasses: [], unmappedFiles: [])

Coverage (jacoco:prepare-agent test jacoco:report), on the changed code:

Method Lines Branches
keepsStoredExtension (new) 1/1 4/4
mergedOverStoredExtension (new) 7/7 3/4

The uncovered branch is the half of !stored.isObject() \|\| !incoming.isObject() where the stored
extension is a non-object, which the schema does not allow to occur.

EntityRepository.java as a whole is 28.9% line-covered by unit tests, well under the 90%
target. That is pre-existing and structural, not a gap this PR introduces: this class is exercised
almost entirely by the integration suite rather than by unit tests. The lines this PR adds are
fully covered.

Backend integration tests

  • Not applicable — no new or changed API endpoint; the change is inside the shared updater.

Integration tests were NOT run locally. EntityRepository.java triggers area core's full
suite in .github/java-tests/impact-map.json, so the planner selects 423 IT classes across 7
lanes
(mysql-elasticsearch parallel/isolated/rdf, cache-tests parallel/isolated,
postgres-opensearch parallel/isolated/search-it) plus 5 nightly-only suites. That needs Docker and
hours of wall time.

Given the blast radius this should be run before merge:

make java_affected_run ARGS="--update-pr"

BulkOverrideMetadataIT and ColumnCustomPropertiesIT are the two most directly relevant classes
in that set.

Ingestion integration tests

Playwright (UI) tests

  • Not applicable — no UI changes.

Not applicable — no files under openmetadata-ui/.

Manual testing performed

None against a live stack for this fix — it is verified by the unit tests above, three of which
reproduce the reported symptoms and fail without the change.

The bug was confirmed live while building #33333: re-running a Glue pipeline against an
already-ingested service showed no updated custom properties, which is what prompted #33324.

Steps for a reviewer who wants to confirm the fix end to end:

  1. ./docker/run_local_docker.sh -m ui -d mysql
  2. Create a Glue (or Athena) database service; enable Include Custom Properties on the metadata
    pipeline and run it against a fresh service. Confirm the table's Custom Properties.
  3. Change a Glue table parameter at the source, and add a new one.
  4. Re-run with Override Metadata off → stored values unchanged (the guard still holds).
  5. Add a custom property by hand on that table in the UI.
  6. Re-run with Override Metadata on → the changed parameter updates, the new one appears, and
    the hand-added property is still there.

Step 6 is the whole PR; step 4 is the regression check.

UI screen recording:

Not applicable — backend-only bug fix in openmetadata-service, no UI surface.

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: not applicable — no schema change, so no migration.
  • For a UI feature or feature task: not applicable — backend-only change.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Decision check: added
    docs/decisions/2026-10-16-a-force-sync-merges-connector-supplied-custom-properties.md, cited
    from the mergedOverStoredExtension Javadoc.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

The saved-result test required by the repository’s testing rule is still needed before merging.

Findings

  1. P2 Tests leave shared properties behind ▶

Summary

Bot PUTs with overrideMetadata can refresh custom properties without dropping stored keys that the connector omits.

  • Force-syncs refresh connector properties while keeping omitted custom properties.

Reviews (2) · Last reviewed commit: "fix(test): updateExtension behaviour" · Reviewed by Greptile

harshsoni2024 and others added 2 commits October 16, 2026 14:46
…erties

Connector-supplied `extension` values landed only on an entity's first write.
EntityRepository.updateExtension reverts any bot PUT to the stored extension,
and ingestion authenticates as ingestion-bot over the bulk PUT path, so a
changed custom property never propagated and a newly added one never appeared.
Deleting and re-ingesting the entity was the only workaround.

The guard itself is right - it stops a scheduled re-sync from clobbering custom
properties a user curated in the UI. What it lacked was the opt-out every
comparable field already has. overrideMetadata is set on the updater and read
in updateDescription, updateDisplayName, updateTags and updateCertification,
but updateExtension never consulted it: 0 of the 25 references in the class
were in that method. It now follows the same shape as its four siblings - the
bot guard applies unless overrideMetadata is set and the incoming extension is
non-empty.

Emptiness is tested through the nullOrEmpty(JsonNode) overload rather than
nullOrEmpty(Object), which stringifies an empty map to "{}" and would call it
non-empty. A connector that is not collecting custom properties sends no
extension, and that absence must not blank the stored ones.

A force-sync merges rather than replaces. The diff below the guard treats a
stored key the request omits as a deletion, so a plain replace would drop
custom properties a user set in the UI the moment any connector force-synced
one property of its own - reintroducing the exact loss the guard prevents.
Tags can afford replace semantics because TagLabel carries LabelType and the
update path filters on it; a custom property carries no provenance at all, and
ingestion only ever sends the properties its own source produces. So the keys
the connector sends win and the rest are left alone.

The cost of that choice: a property removed at the source lingers until someone
deletes it. Removing it automatically needs per-key provenance to tell a
connector-owned property from a curated one, which is the larger design #33324
raises as the alternative and is not attempted here.

Scope: updateExtension is on the generic EntityUpdater, so this reaches every
entity type and every writer of an extension - Athena and Glue via the table
hook, dbt on Metric, SAS on Table. Default behaviour is unchanged, because
overrideMetadata defaults to false; nothing moves unless an operator has
explicitly turned on Override Metadata for that pipeline.

Tests: EntityRepositoryExtensionTest, 7 cases driving updateExtension through
the updater. Three fail without the change - a bot PUT under overrideMetadata
leaving a value stale, dropping a newly added property, and losing a curated
property the connector does not send. The other four pin the behaviour that
must not move: a bot PUT without overrideMetadata keeps the stored extension,
a null or empty incoming extension never blanks it, and a human PUT still
applies.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A force-sync merges the incoming extension over the stored one rather than
replacing it. Tags do replace under the same flag and can afford to, because
TagLabel carries LabelType; a custom property has no provenance at all, so the
merge reads like an inconsistency someone could tidy away. The squash-merge
drops the PR description, so the rule goes in the tree and is cited from the
Javadoc.

Also tests mergedOverStoredExtension's non-object path, taking it to 7/7 lines.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 09:56
@harshsoni2024
harshsoni2024 requested a review from a team as a code owner October 16, 2026 09:56

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 16, 2026
Copilot AI balanced review requested due to automatic review settings October 16, 2026 11:08

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · Enabling overrideMetadata lets connector values replace matching stored custom properties across entity types, which could overwrite user-curated values.

Lets a force-sync refresh connector-supplied custom properties when Override Metadata is enabled, by merging the incoming extension over the stored one so keys the connector sends update and keys it omits are kept. 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

@harshsoni2024
harshsoni2024 added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit 38b3094 Oct 17, 2026
84 checks passed
@harshsoni2024
harshsoni2024 deleted the fix/connector-extension-refresh-33324 branch October 17, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion 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.

Connector-supplied custom properties never update after the first ingestion

3 participants