Skip to content

Fixes #36961: Preserve source editors and show memory owner and updater - #36992

Merged
pmbrull merged 12 commits into
mainfrom
pmbrull/memory-ownership-attribution
Nov 6, 2026
Merged

pmbrull merged 12 commits into
mainfrom
pmbrull/memory-ownership-attribution

Conversation

@pmbrull

@pmbrull pmbrull commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #36961

Memory extraction no longer makes admin the last editor of a Context Center document or article. Its bookkeeping writes (status, stats, errors) keep the source's last editor, falling back to admin only when there is none. Memory cards lead with the memory's owner and show the last updater separately. The memory panel labels Owner in its header and shows Updated by with the updater and date under Metadata; team owners link to teams.

Type of change:

  • Bug fix

High-level design:

  • ContextProcessingEngine.lastEditorOf is shared by the file and page engines and by ContextFileProcessingService.
  • MemoriesView gets a useMemoryAuthors hook. The owner's avatar takes isTeam for a team. The updater loads through useUserProfile, which dedupes requests.
  • The existing label.updated-by-user-time-ago key keeps the word order right in every locale.
  • Record: docs/decisions/2026-11-03-extraction-bookkeeping-keeps-the-sources-last-editor.md.

Tests:

Use cases covered

  • Uploading or editing a document doesn't change who last edited it.
  • A memory owned by a person and updated by the reconciliation bot shows the owner, then "Updated by Memory Reconciliation Agent".
  • A team owner shows the team avatar.

Unit tests

  • Current head fa3beb3b314: 33 planner-selected Java tests passed and 27 Jest tests passed.
  • The follow-up commit fixes the attribution test's checkstyle formatting.
  • Java formatting and impact map checks passed.
  • yarn tsc:check remains blocked by two unchanged files: IngestionWorkflowForm.tsx:413 (RJSF validator type) and OntologyIriInput.test.tsx:104 (exact in ByRoleOptions). No errors were reported in changed files.

Backend integration tests

The complete planner-selected integration suite was not run. The combined IT module now compiles; targeted REST evidence is recorded below.

Playwright (UI) tests

Both new attribution browser cases passed on the combined Docker server. The remaining planner-selected browser suites were not run.

UI screen recording:

36992-memory-attribution.webm

Recorded on the combined review instance (all 12 memory PRs plus the 2026-11-06 fixes):

  • Cards name the owner first, then Updated by the last editor, by display name.
  • The panel shows the Owner in its header and Updated by under Metadata.
  • A team owner links to its team.
  • The article keeps review-owner as its editor after extraction.

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 added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review against REVIEW.md: fresh review of fa3beb3b314 found no remaining Important findings. The extraction attribution and memory-details changes compose without a semantic conflict.
  • Decision check: the record above.

Note: this PR and the memory-details PR #36991 both edit imports in MemoriesView.component.tsx; preserve both changes if a rebase is needed.


Summary by Gitar

  • Memory details:
    • Relabels the owner as "Owner" instead of "Created by", with team owners linked to their team
    • Adds an "Updated by" row showing the last editor and update date in CreateMemoryModal

This will update automatically on new commits.

Regression follow-up (2026-11-04)

  • The memory panel now labels Owner in its header and shows Updated by with the updater and date under Metadata. The owner uses a team link for a team. Five new Jest cases cover distinct/equal/missing identities and the legacy date-only fallback; two browser cases cover the real list/panel and team destination.
  • 126 Jest tests passed across 10 affected suites; both added attribution Playwright tests passed against the rebuilt Docker instance. The list/panel test failed on the missing Owner assertion before the panel fix. The combined OpenMetadata unit run passed 240 tests, including file/page processing and bookkeeping attribution. Existing unrelated application/Playwright type-check errors remain outside changed files.
  • Self-review: db75cbec085a339743fabf62225c9d72119161b8, fresh REVIEW.md pass, no unanswered Important findings. Coverage findings were fixed before this pass.
  • Runtime evidence: all 12 pinned PR heads are present in the combined stack; source heads: OpenMetadata 7d7ac24b6e4e274b935954a067dbae7fa61007a3, AI eacb39819e854615b6eebf27b6fa486b4b9beba3, Collate f10b2d235cd4ec4f461a2db409f43a9289d4e3ae. Targeted combined runs are reported here; this does not claim that every planner-selected integration or browser suite ran.

Merge readiness (2026-11-06)

  • Merged main (94961ed). Preserve Context Center metadata during processing #36668 had wrapped the processing writes in conditional retries. I kept the retries, stamped the source's last editor in all five writes, and moved this PR's tests to updateIfCurrent.
  • Review fixes:
    • The panel shows the updater's display name, like the card does (ed19139).
    • The team-owner test asserts OwnerType.TEAM.
    • The tests wait on the displayed name (ca71465).
  • Tests: 46 Jest tests pass on the branch. The combined OpenMetadata tree passes 288 Java and 90 Jest tests.
  • UI recording attached under UI screen recording.

Merge order (12 memory PRs). OpenMetadata #36988 first, then #36990 and #36992 in any order, then #36989 (it needs #36988). Right after #36989: Collate #8241, then #8239. Until #8241 lands, Collate main starts a memory created without a stage Approved. Collate #8240 and #8242 can merge any time. OpenMetadata #36991 goes last of the OpenMetadata PRs, after one update once #36989 and #36992 land; its conflicts are already resolved. ai-platform #2035 and #2036 can merge any time. #2034 goes after Collate #8239 and #8241, with one update after #2035, also already resolved.

🤖 Generated with Claude Code

pmbrull and others added 4 commits November 3, 2026 13:06
… cards with the owner

Release testing saw every uploaded document show admin as its last editor once
extraction finished, and memory cards name the reconciliation bot as the author
of memories people own.

- Extraction stats and processing status are written as the source's current
  last editor, as file processing status already was; admin only when none.
- A memory card names its owner first, and "Updated by" whoever changed it last
  only when that is someone else.

ADR:2026-11-03-extraction-bookkeeping-keeps-the-sources-last-editor

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… page extraction

Both engines stamp extraction bookkeeping as the source's last editor; the rule
now lives once on ContextProcessingEngine, and a test covers a finished page
extraction stamping its stats under that editor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…avatar

A memory card names its owner and then whoever changed it last, but it read
the last editor's display name from the profile cache, which only the avatar
filled. The avatar now shows the owner, so a memory owned by tomas and last
updated by the reconciliation bot read "Updated by
MemoryReconciliationApplicationBot". The card now loads the last editor with
useUserProfile, which keeps the raw name when the profile cannot be read.

The tests now go through a mocked getUserByName instead of a store filled by
hand, so they fail when nothing loads the profile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…team owners as teams

- ContextFileProcessingService writes its file and content bookkeeping through
  ContextProcessingEngine.lastEditorOf, so a source with no recorded editor
  is written as admin, as the extraction engines already do.
- A memory card shows a team owner with a team avatar.
- The card names its last editor with label.updated-by-user-time-ago, so the
  word order comes from the locale instead of being concatenated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Nov 3, 2026
@pmbrull pmbrull added the 2.1 label Nov 4, 2026
@pmbrull pmbrull changed the title Fixes #36961: Keep a source's last editor on extraction bookkeeping and lead memory cards with the owner Fixes #36961: Preserve source editors and show memory owner and updater Nov 4, 2026
pmbrull and others added 3 commits November 5, 2026 17:16
…hip-attribution

# Conflicts:
#	openmetadata-service/src/main/java/org/openmetadata/service/context/center/ContextFileProcessingService.java
#	openmetadata-service/src/main/java/org/openmetadata/service/context/center/FileContextProcessingEngine.java
#	openmetadata-service/src/main/java/org/openmetadata/service/context/center/PageContextProcessingEngine.java
#	openmetadata-service/src/test/java/org/openmetadata/service/context/center/ContextFileProcessingServiceTest.java
#	openmetadata-service/src/test/java/org/openmetadata/service/context/center/PageContextProcessingEngineTest.java
The panel printed the raw login, a bot's user name, where the memory card
shows the display name; it now loads the profile the way the card does. The
owner test also asserts a team owner reaches its popover as a team.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This 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 skip-pr-checks label.

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 6, 2026

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 1035 → 1035
- 0 added, 0 removed, 4 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/support/team/TeamClass.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/apiResponse.ts
  openmetadata-ui/src/main/resources/ui/src/components/Settings/Users/CreateUser/CreateUser.component.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/members/MembersCreateUserForm.tsx

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

Copilot AI balanced review requested due to automatic review settings November 6, 2026 08:09

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 6, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 81%
81.61% (141384/173242) 69.03% (51741/74952) 71.99% (28976/40247)

Copilot AI balanced review requested due to automatic review settings November 6, 2026 08:47

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.

@gitar-bot

gitar-bot Bot commented Nov 6, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Changing extraction bookkeeping to reuse each source's last editor could make version history attribute automated status and stats updates to a person.

Preserves the source's last editor during memory extraction bookkeeping, so Context Center documents and articles no longer show admin as last editor. Memory cards lead with the owner and show the last updater by display name, and the memory panel adds Owner and Updated by fields with team owners linking to teams. 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

@pmbrull
pmbrull merged commit 4314541 into main Nov 6, 2026
69 of 70 checks passed
@pmbrull
pmbrull deleted the pmbrull/memory-ownership-attribution branch November 6, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.1 Ingestion 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.

Memory extraction makes admin the last editor of a document, and memory cards show the last updater instead of the owner

4 participants