Skip to content

Fixes #28229: cascade Table certification PATCH to child search docs#28236

Merged
harshach merged 2 commits into
mainfrom
harshach/issue-28229-repro-fix
May 19, 2026
Merged

Fixes #28229: cascade Table certification PATCH to child search docs#28236
harshach merged 2 commits into
mainfrom
harshach/issue-28229-repro-fix

Conversation

@harshach
Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #28229

When a Table's certification is added, changed, or removed via PATCH, the existing cascadeCertificationToChildren path never fires because SearchRepository.requiresPropagation returns false on a cert-only ChangeDescriptionTableRepository.getSearchPropagationDescriptors() never listed certification. The DQ dashboard's Certification filter therefore kept returning the stale cert on test_case, test_case_result, test_case_resolution_status, test_suite, and column docs until a full reindex.

This PR adds an EXTERNAL_HANDLER PropagationType for fields whose cascade is driven by a dedicated SearchRepository handler rather than the generic descriptor-driven script (cert needs full-object replace on add/update and explicit removal on delete, which RAW_REPLACE can't express — it restores the old value on delete), registers certification with this type on TableRepository, and adds no-op cases in the three appendAdd/Update/DeleteScript switches.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Cert added on a Table → test_case search doc inherits the cert (already worked at index time).
  • Cert PATCHed Gold → Silver on a Table → child test_case search doc reflects Silver within the await window.
  • Cert removed on a Table → child test_case search doc loses the cert.

Unit tests

  • Added unit tests for the new/changed logic.
  • Files updated: openmetadata-service/src/test/java/org/openmetadata/service/search/SearchRepositoryBehaviorTest.java — three new tests (requiresPropagationReturnsTrueForTableCertification{Update,Added,Removed}) and updated mock descriptors to mirror production.

Backend integration tests

  • Added integration tests in openmetadata-integration-tests/ for the cascade behavior.
  • Files added: openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/TableCertificationPropagationIT.java. The IT fails on main (expected: <Certification.Silver> but was: <Certification.Gold>) and passes after this fix.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Ran mvn test -pl openmetadata-service -Dtest=SearchRepositoryBehaviorTest (108/108 pass) and mvn test -pl openmetadata-integration-tests -Dtest=TableCertificationPropagationIT (passes after fix; fails on main HEAD).

UI screen recording / screenshots:

Not applicable.

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.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

When a Table's certification is added, changed, or removed via PATCH the
existing cascadeCertificationToChildren path never fired because
SearchRepository.requiresPropagation returned false on a cert-only
ChangeDescription. TableRepository did not list certification in its
propagation descriptors, so the gate stayed closed and the DQ
dashboard's Certification filter kept returning the stale cert on
test_case / test_case_result / test_case_resolution_status / test_suite /
column docs until a full reindex.

Add an EXTERNAL_HANDLER PropagationType for fields whose cascade is
driven by a dedicated SearchRepository handler instead of the generic
descriptor-driven script (cert needs full-object replace on add/update
and explicit removal on delete, which RAW_REPLACE can't express because
it restores the old value on delete). Register certification with this
type on TableRepository so the gate opens and the existing
cascadeCertificationToChildren method runs. Add no-op cases in the
three appendAdd/Update/DeleteScript switches so the new enum value
doesn't accidentally trigger generic auto-propagation.

Adds three unit tests in SearchRepositoryBehaviorTest covering cert
add/update/remove on a Table opening the propagation gate, and a new
TableCertificationPropagationIT that creates a Table+TestCase, PATCHes
the Table cert Gold->Silver->null, and asserts the test_case search
doc cascades each transition. The IT fails on main and passes with
this fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 18, 2026 16:48
@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels May 18, 2026
@harshach harshach added the To release Will cherry-pick this PR into the release branch label May 18, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the propagation gate for Table certification changes so certification updates performed via PATCH are cascaded to child search documents that denormalize the parent Table’s certification (e.g., test_case, test_case_result, test_case_resolution_status, test_suite, column).

Changes:

  • Introduces PropagationType.EXTERNAL_HANDLER to allow requiresPropagation(...) to open the propagation gate for fields whose cascade is handled by dedicated SearchRepository logic (not descriptor-driven scripts).
  • Registers Table certification as EXTERNAL_HANDLER in TableRepository.getSearchPropagationDescriptors() and adds no-op handling for this propagation type in script builders.
  • Adds unit + integration tests covering Table certification add/update/remove propagation to child search docs.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
openmetadata-service/src/test/java/org/openmetadata/service/search/SearchRepositoryBehaviorTest.java Updates mock propagation descriptors and adds regression tests ensuring requiresPropagation returns true for cert-only Table changes.
openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java Adds explicit no-op switch cases for EXTERNAL_HANDLER so descriptor-driven scripts skip fields handled by dedicated cascade logic.
openmetadata-service/src/main/java/org/openmetadata/service/search/PropagationDescriptor.java Adds the new PropagationType.EXTERNAL_HANDLER enum value with rationale.
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java Registers FIELD_CERTIFICATION for search propagation gating using EXTERNAL_HANDLER.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/TableCertificationPropagationIT.java New end-to-end IT verifying Table certification PATCH cascades to test_case_search_index.

Comment on lines +57 to +59
@Execution(ExecutionMode.SAME_THREAD)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class TableCertificationPropagationIT {
The new IT used SAME_THREAD execution mode but project convention is
CONCURRENT. Entity names are timestamped so concurrent execution is
safe, and the cert cascade is scoped by table.id so it won't collide
with other tests' children. Verified the IT still passes under
CONCURRENT.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 18, 2026

Code Review ✅ Approved 1 resolved / 1 findings

Cascades Table certification PATCH updates to child search documents by registering certification with a custom propagation handler. The IT execution mode was updated to CONCURRENT to match project standards.

✅ 1 resolved
Quality: IT uses SAME_THREAD but project standard is CONCURRENT

📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/TableCertificationPropagationIT.java:57
The custom review instructions state integration tests should use @Execution(ExecutionMode.CONCURRENT). The new TableCertificationPropagationIT uses ExecutionMode.SAME_THREAD instead. While this test modifies shared search state that could justify sequential execution, it already uses unique timestamps for entity names to avoid collisions, so it should be safe to run concurrently with other tests.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions
Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (11 flaky)

✅ 4141 passed · ❌ 0 failed · 🟡 11 flaky · ⏭️ 86 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 298 0 1 4
🟡 Shard 2 778 0 3 8
🟡 Shard 3 777 0 1 7
🟡 Shard 4 781 0 1 12
🟡 Shard 5 771 0 2 47
🟡 Shard 6 736 0 3 8
🟡 11 flaky test(s) (passed on retry)
  • Pages/AuditLogs.spec.ts › should apply both User and EntityType filters simultaneously (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should start term as Draft when glossary has reviewers (shard 2, 2 retries)
  • Features/KnowledgeCenter.spec.ts › Article mentions in description should working for Knowledge Center (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate DataProduct Rule Any_In (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Announcement create, edit & delete (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Glossary CSV import preserves typed relations (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)

📦 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

@harshach harshach merged commit d6cec7e into main May 19, 2026
64 of 66 checks passed
@harshach harshach deleted the harshach/issue-28229-repro-fix branch May 19, 2026 15:18
@github-actions
Copy link
Copy Markdown
Contributor

Changes have been cherry-picked to the 1.13 branch.

github-actions Bot pushed a commit that referenced this pull request May 19, 2026
…28236)

* Fixes #28229: cascade Table certification PATCH to child search docs

When a Table's certification is added, changed, or removed via PATCH the
existing cascadeCertificationToChildren path never fired because
SearchRepository.requiresPropagation returned false on a cert-only
ChangeDescription. TableRepository did not list certification in its
propagation descriptors, so the gate stayed closed and the DQ
dashboard's Certification filter kept returning the stale cert on
test_case / test_case_result / test_case_resolution_status / test_suite /
column docs until a full reindex.

Add an EXTERNAL_HANDLER PropagationType for fields whose cascade is
driven by a dedicated SearchRepository handler instead of the generic
descriptor-driven script (cert needs full-object replace on add/update
and explicit removal on delete, which RAW_REPLACE can't express because
it restores the old value on delete). Register certification with this
type on TableRepository so the gate opens and the existing
cascadeCertificationToChildren method runs. Add no-op cases in the
three appendAdd/Update/DeleteScript switches so the new enum value
doesn't accidentally trigger generic auto-propagation.

(cherry picked from commit d6cec7e)
@github-actions
Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.12.9 branch.
Please cherry-pick the changes manually.
You can find more details here.

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

Labels

backend safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Certification change on a parent Table does not cascade to child search docs

3 participants