Repository navigation
Fixes #37663: keep version author on lifeCycle-only updates - #37977
Conversation
A lifeCycle PATCH does not bump the version, but it restamped the current version's updatedBy/updatedAt. usage-bot then looked like the author of the ingestion-bot version, so its next PATCH in the session consolidated over that version and re-attributed the column description change summary to usage-bot.
DataInsightsEnricherBehaviorIT asserted updatedAt moved on a lifeCycle-only bulk update; it now stays on the current version, so assert that instead.
Code Review ✅ Approved 🟡 Medium riskKeeping prior author and timestamp on lifecycle-only updates changes audit attribution across three store paths; a regression could miscredit later change summaries. Restores the original 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 |
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
|
Backport to |
| updated.setChangeDescription(original.getChangeDescription()); | ||
| } | ||
| updated.setUpdatedBy(original.getUpdatedBy()); | ||
| updated.setUpdatedAt(original.getUpdatedAt()); |
There was a problem hiding this comment.
Stale page writes overwrite results
keepCurrentVersionAttribution() also runs for page processingStatus, processingError, and extractionStats changes, not just lifeCycle. Those writes keep the version unchanged. KnowledgePageRepository.updateIfCurrent() checks only the version and updatedAt before replacing the row.
Keeping updatedAt unchanged now lets a stale writer pass that check after another status or stats write commits. It can overwrite newer results without triggering a retry. Limit this behavior to lifeCycle changes, or give page writes a separate check that changes on every write.
Knowledge Base Used: Metadata entity lifecycle
Describe your changes:
Fixes #37663
This fixes usage-bot being shown as "Authored by" on column descriptions it never touched. A lifeCycle PATCH doesn't bump the entity version, but it was saving usage-bot as the current version's
updatedBy/updatedAtanyway. usage-bot then looked like the author of ingestion-bot's version. On its next PATCH within the 10-minute session window,consolidateChangesfolded that version into usage-bot's update. Its column-description additions were replayed and credited to usage-bot in thechangeSummary. The fix addskeepCurrentVersionAttribution(), which restores the original author and timestamp in all three no-version-bump store paths (storeUpdate,storeUpdateWithOptimisticLockingand the bulkupdateWithDeferredStore).Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
lifeCycletwice within the session window.updatedBy,updatedAtand thecolumns.name.descriptionchangeSummary author all stay ingestion-bot.updatedAt, and the Data Insights daily snapshots for both days stay intact.Unit tests
Backend integration tests
openmetadata-integration-tests/for the changed behavior.ChangeSummaryResourceIT#testLifeCyclePatchesKeepDescriptionAuthor(new)DataInsightsEnricherBehaviorIT#lifecycleOnlyBulkUpdate_keepsExistingTableInBothDailySnapshots(updated: it asserted the old restamp,updatedAt >= today, and now asserts thatupdatedAtis unchanged)Focused plan (
make java_affected ARGS="--scope focused"), mysql-elasticsearch, parallel lane:ChangeSummaryResourceIT(all 5)de72c1acef5ChangeSummaryResourceIT#testLifeCyclePatchesKeepDescriptionAuthorwithout the server fixde72c1acef5minus theEntityRepositorychangeexpected: <ingestion-bot> but was: <admin>ChangeSummaryResourceIT(all 5) +DataInsightsEnricherBehaviorIT(all 9)50b4a4a35e8(PR head)Broader checks (full scope) were not run; the merge queue runs them.
Ingestion integration tests
Playwright (UI) tests
Visual regression baselines
Manual testing performed
None beyond the integration tests above. The IT drives the issue's exact scenario through the REST API: a bot description write, then two lifeCycle PATCHes, then
GET /v1/changeSummary/table/name/{fqn}.UI screen recording:
Not applicable — backend-only bug fix.
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. (N/A — no schema change)
For a UI feature or feature task: … (N/A — backend only)
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.86777c29fae(follow-up50b4a4a35e8only drops the vacuous DIupdatedByassertion the re-review flagged). Fixed: 🔴DataInsightsEnricherBehaviorITasserted thatupdatedAtmoved on a lifeCycle-only bulk update; it now asserts the kept values. Fixed: 🟡 the new IT didn't coverupdatedAt; 🟡 comments trimmed.Decision check: N/A — this restores the existing rule that a version's audit fields describe who made that version; it adds no new contract.
I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference.
Existing misattributed rows aren't repaired. For column descriptions, the real author is usually still in earlier versions'
changeSummary.Fix the page stale-write regression before merging.
Findings
Summary
Keeps the current version's author and timestamp when
lifeCyclechanges without a version bump.Reviews (2) · Last reviewed commit: "Drop an updatedBy assertion that cannot ..." · Reviewed by Greptile