Repository navigation
Fixes #34343: keep data contract owners and reviewers when recording results (2.0) - #37009
Conversation
…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.
❌ 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 |
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. 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 |
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:
updateLatestResultreloads the stored contract with its patch fields before settinglatestResult, instead of patching the bare copy the caller passes in. Same change as on main.DataContractRepository.updateLatestResult: reload withgetPatchFields(), difforiginalvsupdatedDataContractResourceIT.testContractResultsPreserveOwnersAndReviewers: create with owner + reviewer, edit, record results, assert both survive (main's test checksextensionviaCustomPropertyTestSupport, 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.