Skip to content

Fixes #34343: keep data contract owners and reviewers when recording results (2.0) - #37009

Merged
sonika-shah merged 1 commit into
2.0from
fix/2.0-contract-result-preserve-owners
Nov 4, 2026
Merged

sonika-shah merged 1 commit into
2.0from
fix/2.0-contract-result-preserve-owners

Conversation

@sonika-shah

Copy link
Copy Markdown
Collaborator

Backport of #34979 to 2.0. Fixes #34343.

Issue: after a data contract is edited, the next validation run (scheduled or "Run now") wipes its owners, reviewers and custom properties.

Fix: updateLatestResult reloads the stored contract with its patch fields before setting latestResult, instead of patching the bare copy the caller passes in. Same change as on main.

  • DataContractRepository.updateLatestResult: reload with getPatchFields(), diff original vs updated
  • DataContractResourceIT.testContractResultsPreserveOwnersAndReviewers: create with owner + reviewer, edit, record results, assert both survive (main's test checks extension via CustomPropertyTestSupport, which 2.0 does not have)

Verification (local, MySQL + ES): new IT fails without the fix (owners empty after the result is recorded) and passes with it.

…results (2.0)

Backport of #34979. Recording a validation result patched a copy of the
contract loaded without owners/reviewers/extension, so after an edit the
updater recorded them as deleted. Reload the contract with its patch fields
before setting latestResult.
@sonika-shah
sonika-shah requested a review from a team as a code owner November 4, 2026 05:28
@sonika-shah
sonika-shah requested review from yan-3005 and removed request for a team November 4, 2026 05:28
@github-actions

github-actions Bot commented Nov 4, 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.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Nov 4, 2026
@gitar-bot

gitar-bot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · Reloading patch fields before recording contract results changes persistence behavior; incorrect diffing could overwrite owners, reviewers, or custom properties.

Fixes data contract result recording so the next validation run no longer wipes owners, reviewers, or custom properties. DataContractRepository.updateLatestResult now reloads the stored contract with its patch fields before setting latestResult, and a new integration test covers owners and reviewers surviving a result update. 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

@sonika-shah
sonika-shah merged commit 2a8fc4e into 2.0 Nov 4, 2026
61 of 63 checks passed
@sonika-shah
sonika-shah deleted the fix/2.0-contract-result-preserve-owners branch November 4, 2026 06:41

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

backend 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.

2 participants