Repository navigation
Fixes #32459: Allow owners to read private memories - #32858
Conversation
Private memory visibility depends on owners, but projected GETs cleared that relationship before the visibility guard ran. Load the decision field for ID and name reads so owners are not denied.
❌ 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 |
✅ Playwright Results — workflow succeededValidated commit ✅ 936 passed · ❌ 0 failed · 🟡 3 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 49m 2s ⏱️ Max setup 5m 19s · max shard execution 15m 53s · max shard-job elapsed before upload 19m 21s · reporting 6s 🌐 206.47 requests/attempt · 2.44 app boots/UI scenario · 24.76% common-shard skew Optimization targets still in progress:
🟡 3 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review ✅ ApprovedFixes private memory visibility check for owners by hydrating the OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
Private memory visibility depends on owners, but projected GETs cleared that relationship before the visibility guard ran. Load the decision field for ID and name reads so owners are not denied.
|
picked to 2.0 |



Describe your changes:
Fixes #32459
Private context-memory visibility is checked after the entity is fetched. When a caller did not request
owners(including the default GET projection), the relationship was absent from the fetched entity, so an owner could be rejected with a 403 for their own private memory.This change uses the existing
ContextMemoryVisibility.guardFields(...)helper for both direct read paths so the visibility decision always has the owner relationship it needs:GET /api/v1/contextCenter/memories/{id}GET /api/v1/contextCenter/memories/name/{fqn}The integration tests issue both requests as the non-admin owner without a
fieldsparameter. Each test reproduced the 403 before the corresponding resource change and passes afterward.Type of change:
High-level design:
N/A — small bug fix that reuses the existing visibility-decision field helper.
Tests:
Use cases covered
Unit tests
openmetadata-service/src/test/java/org/openmetadata/service/resources/context/ContextMemoryVisibilityTest.javaguardFields: 100% lines (6/6) and 100% branches (4/4).Backend integration tests
openmetadata-integration-tests/for the changed API endpoints.openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/ContextMemoryIT.javaIngestion integration tests
Playwright (UI) tests
Manual testing performed
mvn install -pl openmetadata-service -DskipTests.ContextMemoryITagainst its local PostgreSQL, Elasticsearch, MinIO, and OpenMetadata test containers.fields; both returned the expected memory instead of 403.UI screen recording / screenshots:
Not applicable — no UI changes.
Checklist:
Fixes <issue-number>: <short explanation>.Fixes #<issue-number>above.guardFieldsJavadoc documents why visibility decision fields are required.