Repository navigation
Fixes #34774: bot PUT keeps user-curated tags, owners and retentionPeriod - #34775
Conversation
…it sends A bot bulk PUT with overrideMetadata=true that carried any tag replaced the whole tag list, deleting Tier, automator-propagated and user-applied tags no source ever emits; the automator re-added them and the next run removed them again. Override now replaces stored tags only within the classifications and glossaries present in the request, at table and column level.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🔴 High risk · Bot PUTs now change persisted owner, retention-period, and classification-tag handling. Fixes tag replacement, owner overwriting, and retentionPeriod erasure during bot PUT operations. Tags from classifications not sent by the bot are now preserved; user-assigned owners survive bot re-syncs without override; and retentionPeriod retains user values when omitted from the request. Comprehensive integration tests verify the fix on tables, columns, and schemas. OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
🚦 Removed from the merge queue —
|
Describe your changes:
Fixes #34774
Since #32496, a bot bulk PUT with
overrideMetadata=truethat carries at least one tag replaces the entity's (or column's) whole tag list. Tags no source can emit —Tier.*, automator-applied/propagated tags, user-applied tags, glossary terms — are deleted on every override run. On customer instances this shows up as a daily cycle: the automator re-adds Tier, the next ingestion run removes it (3,264 removals across 468 tables on one instance; 41 columns on another), with two versions and two change events per asset per day, and user-applied tags lost permanently.EntityRepository.updateTagsnow, on the override PUT path, keeps every stored tag whose classification (or glossary) does not appear in the request (keepTagsOutsideRequestedClassifications). Within a classification the request does carry, override still replaces — so the #28505 / #32496 case (a mutually exclusive tag changed upstream) works as before. Tables and columns shareupdateTags, so both are fixed.Also in this PR — two more bot-PUT fields that lose user data (found by auditing every field a bot PUT touches, then reproduced on release-2-0):
ownerConfigowners (including itsdefault) on every database/schema/table, and pipeline connectors send owners by default (includeOwnersdefaults to true) — while theincludeOwnersdocs promise an existing owner "will not be overwritten". The guard inupdateOwnersonly fired when the bot's policy deniedEditOwners, and no shipped bot policy does (the ingestion bot'sEditAllsubsumes it), so it never fired. A bot PUT now only fills owners on an entity that has none; a PATCH (e.g. dbtdbtUpdateOwners) or a bulk run withoverrideMetadata=truestill reassigns them. This reverses the policy-keyed behaviour from perf: one-transaction flush + async indexing write path, read-path fixes #28675, sotest_singleEntityPut_bot_updatesOwnersWhenPolicyAllowsis flipped totest_singleEntityPut_bot_preservesUserOwners.retentionPeriod. No connector sends it, so every bot PUT that changed the sourceHash — and every override run — blanked it on Table, DatabaseSchema, Database and Container. NewEntityUpdater.updateUserOnlyFieldkeeps the stored value when a bot PUT omits such a field. The PUT/bulkoriginalcarries the entity's own value, not the schema-inherited one, so inheritance is not frozen onto the table.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
retentionPeriodsurvives a bot re-sync with and without override (table), and with override (schema).Unit tests
Backend integration tests
openmetadata-integration-tests/.../BulkOverrideMetadataIT.java:test_overrideKeepsTableTagsFromClassificationsNotSent,test_overrideKeepsColumnTagsFromClassificationsNotSentBulkOverrideMetadataIT:test_botKeepsUserOwners_withoutOverride,test_botReplacesUserOwners_withOverride,test_botFillsOwners_whenEntityHasNone,test_botKeepsTableRetentionPeriod_withoutOverride,test_botKeepsTableRetentionPeriod_withOverride,test_botKeepsSchemaRetentionPeriod_withOverrideBaseEntityIT.test_singleEntityPut_bot_preservesUserOwners(flipped from..._updatesOwnersWhenPolicyAllows)retentionPeriodnull); the override-replaces and fill-when-empty owner tests pass either way, as intended.BulkOverrideMetadataIT26/26; the fourBaseEntityITowner tests pass on Table, Pipeline, Dashboard, Topic, DatabaseSchema and Container.Ingestion integration tests
Playwright (UI) tests
Manual testing performed
Reproduced the bug on
release-2-0.getcollate.io(2.0.202610060000) with a throwaway service:PII.Sensitiveon the table and columnc1.Tier.Tier1to the table andPersonalData.Personaltoc1.sourceHash:overrideMetadata=true, sendsPII.Sensitive→ table/c1left with onlyPII.Sensitive(Tier + column tag wiped)overrideMetadata=true, sends no tags → all keptoverrideMetadata=false, sendsPII.Sensitive→ all keptOwners and
retentionPeriodon the same instance: admin set owner A /retentionPeriod=P30D, then ingestion-bot re-synced (owner B / no retention). Unchanged sourceHash without override: kept (skipped). Unchanged sourceHash with override, or a changed sourceHash without it: owner replaced by B andretentionPeriodblanked on table, schema and database.UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code