Skip to content

Fixes #35662: Open data contract links on their asset, inherit schema contracts, show contract activity [Backport #35696 - 2.0] - #35709

Merged
anuj-kumary merged 19 commits into
2.0from
anuj-kumary/404-contract-links-fix-2.0
Oct 20, 2026
Merged

anuj-kumary merged 19 commits into
2.0from
anuj-kumary/404-contract-links-fix-2.0

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #35662

Backport of #35696 to 2.0. Fixes the same four problems with data contracts under a governance approval workflow:

  1. Task link opens a 404. Contract task, notification and activity links now go through a /dataContract/<fqn> route, which redirects to the asset's Contract tab.
  2. Schema contract not carried down to tables. A table now inherits its schema's approved contract when it has no Data Product contract.
  3. Contract missing from the asset's activity. The asset's Activity Feeds & Tasks list and count now include its data contract's activity. A contract's activity takes its asset's domains, so domain-filtered feeds keep it too.
  4. Approvals never reach the feed. Workflow field writes (EntityFieldUtils) now emit change events that record the field changes. ActivityFeedAlert admits dataContract and entityStatus changes, and the summary reads "Status of X changed to Approved".

Type of change:

  • Bug fix

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 because 2.0 differs from main there, so those changes were re-applied by hand:

  • EntityUtilClassBase.getEntityLink is a switch on 2.0. The dataContract link is a case instead of a map entry.
  • Entity activity endpoints: 2.0 builds the feed inline in both ActivityResource endpoints (by id and by FQN). Both now call a new ActivityStreamRepository.getEntityActivity, which adds the asset's contract activity, the same logic as getEntityActivityById on main.
  • EntityFieldUtils uses 2.0's patch() signature (no ETag argument) and builds the event with FormatterUtil.createChangeEventForEntity, which is where that helper lives on 2.0.
  • DataContractRepository / ActivityStreamRepository use 2.0's raw EntityInterface.
  • Migration: 2.0 has no 2.1.0 migration, so migration/{mysql,postgres}/v206 alone applies v206/MigrationUtil.addContractAndStatusToActivityFeedAlert. It adds entityStatus and dataContract to the stored alert in place, keeps its id, consumer offset and admin settings such as enabled, and changes nothing on a re-run. The 2.1.0 call added on main is not part of this backport.
  • Playwright impact map: 2.0's map has no data-contract mapping, so this adds one for the redirect page, contractAPI.ts and DataContractRepository, plus the activity-stream mapping.

Tests:

Use cases covered

Same as #35696.

  • Approval task links open the asset's Contract tab.
  • A table inherits only an approved schema contract.
  • The schema and table activity feeds show the contract's activity, including approvals, also when the feed is filtered by domain.
  • Existing installs pick up the new alert rules without losing their settings.

Unit tests

  • I added unit tests for the new/changed logic.
  • Run on this branch: mvn -o package -pl openmetadata-service -am -Dtest=…. All pass:
    • EntityFieldUtilsTest: 16/16
    • ActivityStreamRepositoryTest: 10/10 (includes the status-change and domain-scoping tests)
    • v206/MigrationUtilTest: 2/2
  • UI (Jest): DataContractRedirectPage.test.tsx and the dataContract case in EntityUtilClassBase.routes.test.ts come 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

  • Added: DataContractResourceIT#testTableInheritsApprovedSchemaContract, ActivityResourceIT#test_getEntityActivity_includesItsDataContractActivity.
  • openmetadata-service and openmetadata-integration-tests compile on this branch: mvn -o package -pl openmetadata-service,openmetadata-integration-tests -am -DskipTests → BUILD SUCCESS.
  • I didn't run the ITs locally for this backport. They run in the merge queue.

Not run locally for this backport (unit tests above were run by hand; ITs run in the merge queue).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Added: playwright/e2e/Pages/DataContractSchemaContract.spec.ts (4 tests). It's the same spec as on main, where it passed 4/4 and then 12/12 over three repeats.
  • I didn't run it against a 2.0 build: the only local stack runs main.

Not run against a 2.0 build; see #35696 for the run on main.

Manual testing performed

Done on main for #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-891a9235e4de

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: I updated the migration scripts or explained why it is not needed. (No JSON Schema change; the seed-data change has its v206 data migration.)
  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Decision check: brings both decision records from Fixes #35662: Open data contract links on their asset, inherit schema contracts, show contract activity #35696.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence 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:

  • Contract links now open the owning asset’s Contract tab.
  • Tables inherit approved schema contracts when no approved Data Product contract applies.
  • Asset activity feeds now include activity from their data contracts.
  • Workflow approvals now appear as status changes in activity feeds.

The changes since the previous review only add final to 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]
Loading

Reviews (7) · Last reviewed commit: "Merge remote-tracking branch 'origin/anu..." · Reviewed by Greptile

… 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)
…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)
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@anuj-kumary anuj-kumary self-assigned this Oct 19, 2026
@anuj-kumary anuj-kumary added the safe to test Add this label to run secure Github workflows on PRs label Oct 19, 2026
@anuj-kumary
anuj-kumary marked this pull request as ready for review October 19, 2026 08:47
@github-actions

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.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 68%
68.3% (82877/121333) 53.2% (51318/96458) 53.95% (15270/28303)

@gitar-bot

gitar-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown
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.

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

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@anuj-kumary
anuj-kumary merged commit 09d320c into 2.0 Oct 20, 2026
77 of 81 checks passed
@anuj-kumary
anuj-kumary deleted the anuj-kumary/404-contract-links-fix-2.0 branch October 20, 2026 02:20

This branch was previously deployed

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

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants