Skip to content

Fixes #37663: keep version author on lifeCycle-only updates - #37977

Merged
ulixius9 merged 3 commits into
mainfrom
ulixius9/37663-fix
Nov 18, 2026
Merged

ulixius9 merged 3 commits into
mainfrom
ulixius9/37663-fix

Conversation

@ulixius9

@ulixius9 ulixius9 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

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/updatedAt anyway. usage-bot then looked like the author of ingestion-bot's version. On its next PATCH within the 10-minute session window, consolidateChanges folded that version into usage-bot's update. Its column-description additions were replayed and credited to usage-bot in the changeSummary. The fix adds keepCurrentVersionAttribution(), which restores the original author and timestamp in all three no-version-bump store paths (storeUpdate, storeUpdateWithOptimisticLocking and the bulk updateWithDeferredStore).

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • ingestion-bot adds a column description, then another principal PATCHes lifeCycle twice within the session window. updatedBy, updatedAt and the columns.name.description changeSummary author all stay ingestion-bot.
  • A lifeCycle-only bulk update keeps the table's existing updatedAt, and the Data Insights daily snapshots for both days stay intact.

Unit tests

  • Not added. This path needs a real DB and the session-consolidation flow, so it's covered by the integration tests below. No unit-coverage number was collected.

Backend integration tests

  • I added integration tests in openmetadata-integration-tests/ for the changed behavior.
  • ChangeSummaryResourceIT#testLifeCyclePatchesKeepDescriptionAuthor (new)
  • DataInsightsEnricherBehaviorIT#lifecycleOnlyBulkUpdate_keepsExistingTableInBothDailySnapshots (updated: it asserted the old restamp, updatedAt >= today, and now asserts that updatedAt is unchanged)

Focused plan (make java_affected ARGS="--scope focused"), mysql-elasticsearch, parallel lane:

Run Commit Result
ChangeSummaryResourceIT (all 5) de72c1acef5 ✅ PASSED, 5/5
ChangeSummaryResourceIT#testLifeCyclePatchesKeepDescriptionAuthor without the server fix de72c1acef5 minus the EntityRepository change ❌ failed as expected: expected: <ingestion-bot> but was: <admin>
ChangeSummaryResourceIT (all 5) + DataInsightsEnricherBehaviorIT (all 9) 50b4a4a35e8 (PR head) ✅ PASSED, 14/14

Broader checks (full scope) were not run; the merge queue runs them.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Visual regression baselines

  • Not applicable (no rendering change).

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 (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.

    • Reviewed at 86777c29fae (follow-up 50b4a4a35e8 only drops the vacuous DI updatedBy assertion the re-review flagged). Fixed: 🔴 DataInsightsEnricherBehaviorIT asserted that updatedAt moved on a lifeCycle-only bulk update; it now asserts the kept values. Fixed: 🟡 the new IT didn't cover updatedAt; 🟡 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.

RetriggerView in GreptileConfidence Score: 4/5

Fix the page stale-write regression before merging.

Findings

  1. P1 Stale page writes overwrite results ▶

Summary

Keeps the current version's author and timestamp when lifeCycle changes without a version bump.

  • No-version updates keep the current entity version’s author and time.

Reviews (2) · Last reviewed commit: "Drop an updatedBy assertion that cannot ..." · Reviewed by Greptile

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.
@gitar-bot

gitar-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Keeping 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 updatedBy and updatedAt on lifeCycle-only PATCHes across the storeUpdate, optimistic-locking, and bulk update paths, so usage-bot no longer appears as the author of ingestion-bot's version. 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

@ulixius9
ulixius9 marked this pull request as ready for review November 17, 2026 12:49
@ulixius9
ulixius9 requested a review from a team as a code owner November 17, 2026 12:49
@ulixius9
ulixius9 requested review from IceS2 and a balanced review from Copilot November 17, 2026 12:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@ulixius9

Copy link
Copy Markdown
Member Author

Backport to 2.0: #37995

@ulixius9
ulixius9 enabled auto-merge (squash) November 18, 2026 06:06
@ulixius9
ulixius9 merged commit 87661f6 into main Nov 18, 2026
93 of 96 checks passed
@ulixius9
ulixius9 deleted the ulixius9/37663-fix branch November 18, 2026 07:34
updated.setChangeDescription(original.getChangeDescription());
}
updated.setUpdatedBy(original.getUpdatedBy());
updated.setUpdatedAt(original.getUpdatedAt());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

usage-bot incorrectly shown as "Authored by" on field descriptions it did not change

3 participants