Repository navigation
Fixes #35662: Open data contract links on their asset, inherit schema contracts, show contract activity [Backport #35696 - 2.0] - #35709
Conversation
… contracts, show contract activity Backport of the main fix to 2.0, adapted to 2.0's code: - Contract task, notification and activity links resolve through the /dataContract/<fqn> route, which redirects to the asset's Contract tab. - A table inherits its schema's approved contract (after a Data Product's). - An asset's activity feed and count include its data contract's activity (ActivityStreamRepository.getEntityActivity, used by both entity endpoints). - Workflow field writes (EntityFieldUtils) emit change events with their changeDescription; ActivityFeedAlert admits dataContract and entityStatus. (cherry picked from commit 57d695f, conflicts resolved by hand)
…d seed contract activity synchronously (cherry picked from commit 90dd90d)
…d activity stream to their specs (cherry picked from commit ad9bec6)
(cherry picked from commit 8b69e50)
…t in place The 2.0.6 SQL deleted the stored ActivityFeedAlert for the seed to recreate, which resets its id, consumer offset and admin settings such as enabled. A v206 data migration now adds the two values to the stored rules and input lists only when missing, and is a no-op on re-run. Records the feed-composition and alert decisions in an ADR. (cherry picked from commit 577d7dd)
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
❌ 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 |
…tle check (backport of 66685ab)
…ix-2.0' into anuj-kumary/404-contract-links-fix-2.0
…per new helper (backport of 8c1c2e4)
…ix-2.0' into anuj-kumary/404-contract-links-fix-2.0
…y lookup failure (backport of b83f403)
…ike other releases (backport of 704eeb5)
…ix-2.0' into anuj-kumary/404-contract-links-fix-2.0
Code Review ✅ Approved🟡 Medium risk · Schema-level contract inheritance changes which contract tables display, while expanded approval-event capture could misattribute or omit governance activity if resolution or filtering is wrong. Backport to 2.0 that opens data contract links on their asset's Contract tab, lets tables inherit an approved schema contract, includes contract activity and workflow status changes in asset activity feeds, and adds a migration for the alert rules. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|



Describe your changes:
Fixes #35662
Backport of #35696 to
2.0. Fixes the same four problems with data contracts under a governance approval workflow:/dataContract/<fqn>route, which redirects to the asset's Contract tab.EntityFieldUtils) now emit change events that record the field changes.ActivityFeedAlertadmitsdataContractandentityStatuschanges, and the summary reads "Status of X changed to Approved".Type of change:
High-level design:
Same design as #35696, and the decision records come with it (
docs/decisions/2026-10-19-a-table-inherits-its-schemas-approved-data-contract.md,docs/decisions/2026-10-19-an-assets-activity-feed-includes-its-data-contracts-activity.md). The cherry-pick of #35696 conflicted in six files because2.0differs frommainthere, so those changes were re-applied by hand:EntityUtilClassBase.getEntityLinkis aswitchon2.0. ThedataContractlink is acaseinstead of a map entry.2.0builds the feed inline in bothActivityResourceendpoints (by id and by FQN). Both now call a newActivityStreamRepository.getEntityActivity, which adds the asset's contract activity, the same logic asgetEntityActivityByIdonmain.EntityFieldUtilsuses2.0'spatch()signature (no ETag argument) and builds the event withFormatterUtil.createChangeEventForEntity, which is where that helper lives on2.0.DataContractRepository/ActivityStreamRepositoryuse2.0's rawEntityInterface.2.0has no 2.1.0 migration, somigration/{mysql,postgres}/v206alone appliesv206/MigrationUtil.addContractAndStatusToActivityFeedAlert. It addsentityStatusanddataContractto the stored alert in place, keeps its id, consumer offset and admin settings such asenabled, and changes nothing on a re-run. The 2.1.0 call added onmainis not part of this backport.2.0's map has no data-contract mapping, so this adds one for the redirect page,contractAPI.tsandDataContractRepository, plus the activity-stream mapping.Tests:
Use cases covered
Same as #35696.
Unit tests
mvn -o package -pl openmetadata-service -am -Dtest=…. All pass:EntityFieldUtilsTest: 16/16ActivityStreamRepositoryTest: 10/10 (includes the status-change and domain-scoping tests)v206/MigrationUtilTest: 2/2DataContractRedirectPage.test.tsxand thedataContractcase inEntityUtilClassBase.routes.test.tscome from Fixes #35662: Open data contract links on their asset, inherit schema contracts, show contract activity #35696. I didn't run them on this branch; PR CI runs them.Backend integration tests
DataContractResourceIT#testTableInheritsApprovedSchemaContract,ActivityResourceIT#test_getEntityActivity_includesItsDataContractActivity.openmetadata-serviceandopenmetadata-integration-testscompile on this branch:mvn -o package -pl openmetadata-service,openmetadata-integration-tests -am -DskipTests→ BUILD SUCCESS.Not run locally for this backport (unit tests above were run by hand; ITs run in the merge queue).
Ingestion integration tests
Playwright (UI) tests
playwright/e2e/Pages/DataContractSchemaContract.spec.ts(4 tests). It's the same spec as onmain, where it passed 4/4 and then 12/12 over three repeats.2.0build: the only local stack runsmain.Not run against a 2.0 build; see #35696 for the run on
main.Manual testing performed
Done on
mainfor #35696 (same behaviour); see that PR for the steps and recording.UI screen recording:
Not re-recorded for this backport. The UI change is identical to #35696, whose recording (on
main) shows every link, inheritance and activity scenario: https://github.com/user-attachments/assets/c002b031-7206-4f91-b250-891a9235e4deChecklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.v206data migration.)🤖 Generated with Claude Code


Confidence Score: 5/5
The latest changes appear safe to merge; they only make unchanged Java bindings explicit.Summary
This backport connects data contracts to their assets:
The changes since the previous review only add
finalto Java bindings. No new findings were accepted. No tests were run during this review.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD Link[Contract link] --> Redirect[Read contract] Redirect --> Tab[Asset Contract tab] Table[Table contract request] --> Product{Approved Data Product contract?} Product -->|Yes| Inherit[Apply parent contract] Product -->|No| Schema{Approved schema contract?} Schema -->|Yes| Inherit Schema -->|No| Own[Use table contract] Approval[Workflow approval] --> Event[Change event with changed fields] Event --> Alert[ActivityFeedAlert] Alert --> Feed[Contract activity in asset feed]Reviews (7) · Last reviewed commit: "Merge remote-tracking branch 'origin/anu..." · Reviewed by Greptile