Skip to content

Fixes #29667: preserve autoClassificationConfig on classification PUT (1.13 backport)#29735

Open
IceS2 wants to merge 1 commit into
1.13from
fix/preserve-autoclassification-config-on-put-1.13
Open

Fixes #29667: preserve autoClassificationConfig on classification PUT (1.13 backport)#29735
IceS2 wants to merge 1 commit into
1.13from
fix/preserve-autoclassification-config-on-put-1.13

Conversation

@IceS2

@IceS2 IceS2 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Backport of #29668 to 1.13.

What

Preserve a classification's autoClassificationConfig when a PUT /v1/classifications omits it.

Why

Metadata connectors re-create source classifications with a full-replace PUT carrying only name + description. ClassificationUpdater.entitySpecificUpdate recorded the absent autoClassificationConfig as a deletion, wiping it on every metadata ingestion and silently disabling the AutoClassification Agent for PII, PersonalData, etc. The updater already force-preserves mutuallyExclusive; autoClassificationConfig lacked the equivalent guard.

Change

On Operation.PUT, restore autoClassificationConfig from the original entity when the incoming value is null — mirroring the existing style/lifeCycle handling. Explicit PATCH clearing still deletes it.

Fixes #29667

Greptile Summary

This backport fixes a regression where metadata ingestion's bare PUT /v1/classifications (carrying only name + description) silently wiped any existing autoClassificationConfig, disabling auto-classification for system classifications like PII/PersonalData on every ingestion cycle.

  • Repository fix: ClassificationUpdater.entitySpecificUpdate now calls preserveAutoClassificationConfigOnPut() before the field diff, restoring autoClassificationConfig from the stored entity when the incoming PUT value is null — matching the existing pattern for mutuallyExclusive, style, and lifeCycle. Explicit PATCH-based deletion is unaffected.
  • Integration test: A new test (test_putPreservesAutoClassificationConfig_ingestionScenario) directly simulates the ingestion-sink path and asserts both that the bare PUT preserves the config and that an explicit PATCH still removes it.

Confidence Score: 5/5

Safe to merge — the change is a minimal, targeted guard that prevents an existing regression without altering any other update path.

The two-line logic in preserveAutoClassificationConfigOnPut is easy to reason about: it acts only when operation is PUT and the incoming value is null, leaving all PATCH paths and non-null PUT payloads completely untouched. The integration test directly simulates the ingestion-sink PUT and also verifies that PATCH-based deletion continues to work, so both sides of the behavior are covered.

No files require special attention; both changed files are small and self-contained.

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ClassificationRepository.java Adds a 6-line preserveAutoClassificationConfigOnPut() guard in ClassificationUpdater.entitySpecificUpdate that restores autoClassificationConfig from the original entity when the operation is PUT and the updated value is null — exactly mirroring the existing mutuallyExclusive pattern.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/ClassificationResourceIT.java New integration test covers the ingestion-sink scenario end-to-end: creates a classification with autoClassificationConfig, simulates a bare PUT, asserts the config is preserved, then verifies an explicit PATCH can still clear it.

Reviews (1): Last reviewed commit: "Fixes #29667: preserve autoClassificatio..." | Re-trigger Greptile

…#29668)

Metadata ingestion re-creates source classifications with a bare PUT
(name + description only). The ClassificationUpdater treated the absent
autoClassificationConfig as a deletion, wiping it on every ingestion and
silently disabling the AutoClassification Agent for PII/PersonalData.

Preserve the existing autoClassificationConfig when a PUT omits it, mirroring
the existing style/lifeCycle handling. Explicit PATCH clearing still deletes it.

(cherry picked from commit 0237550)
@IceS2 IceS2 added the safe to test Add this label to run secure Github workflows on PRs label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Restores autoClassificationConfig during classification PUT operations to prevent unintended deletion by metadata connectors. No issues found.

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

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (12 flaky)

✅ 3671 passed · ❌ 0 failed · 🟡 12 flaky · ⏭️ 26 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 2 733 0 2 7
🟡 Shard 3 780 0 1 2
🟡 Shard 4 755 0 2 9
🟡 Shard 5 692 0 1 0
🟡 Shard 6 711 0 6 8
🟡 12 flaky test(s) (passed on retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/DataQuality/ColumnLevelTests.spec.ts › Column Values To Be Between (shard 2, 1 retry)
  • Features/Permissions/GlossaryPermissions.spec.ts › Team-based permissions work correctly (shard 3, 1 retry)
  • Pages/DataContracts.spec.ts › Contract Status badge should be visible on condition if Contract Tab is present/hidden by Persona (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Rename domain with deeply nested subdomains (3+ levels) verifies FQN propagation (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Inactive Announcement create & delete (shard 5, 1 retry)
  • Pages/Glossary.spec.ts › Drag and Drop Glossary Term (shard 6, 1 retry)
  • Pages/Glossary.spec.ts › Column dropdown drag-and-drop functionality for Glossary Terms table (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/ODCSImportExport.spec.ts › Multi-object ODCS contract - object selector shows all schema objects (shard 6, 1 retry)
  • Pages/TestSuite.spec.ts › Logical TestSuite (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (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

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.

1 participant