Skip to content

fix(service): keep derived editors out of the stored page json - #33793

Merged
chirag-madlani merged 1 commit into
mainfrom
chirag-madlani/knowledge-page-editors-storage
Sep 22, 2026
Merged

chirag-madlani merged 1 commit into
mainfrom
chirag-madlani/knowledge-page-editors-storage

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

owners is stripped from the storage json for every entity via EntityRepository.FIELDS_STORED_AS_RELATIONSHIPS (alongside href, children, tags, domains, dataProducts, dataContract, followers, experts, reviewers, certification), so it is always rebuilt from the OWNS relationship.

editors — which KnowledgePageRepository derives the same way from EDITED_BY — had no such protection: it was absent from that list and this repository overrode nothing.

Nothing persists it today, but only because editors is missing from KNOWLEDGE_PATCH_FIELDS, so the update path leaves it null at store time. That is a property of a field list rather than a guarantee — adding editors there would silently start writing a snapshot of the relationship into the json, and setFields hands the stored value back to any caller that does not request the field.

A sweep of every jsonb column in a populated database confirms editors is not stored today. This change makes that invariant explicit so a future addition to KNOWLEDGE_PATCH_FIELDS cannot regress it.

Type of change:

  • Bug fix

Tests:

  • KnowledgePageStorageJsonTest — new unit test that verifies editors is stripped from the stored page json before persistence.

Notes:

Cherry-picked from #33088 (commit 731c1c4) to land as a small, independently-mergeable PR. Original commit authored by @harshach. #33088 has been marked draft while the remaining changes are split out into targeted PRs.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule issues were identified.

Summary

This PR explicitly keeps the relationship-derived editors field out of stored Knowledge Page JSON and adds focused regression coverage.

  • Adds a repository-specific storage-stripping hook for editors.
  • Verifies that editors and the shared owners relationship field are omitted.
  • Confirms ordinary Page attributes remain serialized.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
    P[Page entity] --> S[storageJsonNode]
    S --> C[Strip shared relationship fields]
    C --> E[Strip editors]
    E --> J[Persist attribute-only JSON]
    R[EDITED_BY relationship] --> H[Hydrate editors on requested reads]
Loading

Reviews (1) · Last reviewed commit: "fix(service): keep derived editors out o..."

owners is stripped from the storage json for every entity --
EntityRepository.FIELDS_STORED_AS_RELATIONSHIPS carries it alongside href,
children, tags, domains, dataProducts, dataContract, followers, experts,
reviewers and certification -- so it is always rebuilt from the OWNS
relationship. editors, which KnowledgePageRepository derives the same way from
EDITED_BY, had no such protection: it is absent from that list and this
repository overrode nothing.

Nothing persists it today, but only because editors is missing from
KNOWLEDGE_PATCH_FIELDS, so the update path leaves it null at store time. That
is a property of a field list rather than a guarantee -- adding editors there
would silently start writing a snapshot of the relationship into the json, and
setFields hands the stored value back to any caller that does not request the
field.

A sweep of every jsonb column in a populated database backs this up: no entity
table stores owners except nine table_entity rows holding an empty array, and
entity_extension, which is version history and keeps the whole entity on
purpose.

The test fails without the override and covers owners too, so the base list
cannot quietly lose it either.

(cherry picked from commit 731c1c4)
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Sep 22, 2026
@gitar-bot

gitar-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Changes page persistence serialization for derived editors; bounded internal behavior change.

Prevents editors from being persisted in the stored page JSON by adding it to the stripped fields list, making the invariant explicit and protecting against future regressions if editors is added to KNOWLEDGE_PATCH_FIELDS. Includes a new unit test verifying the field is stripped before persistence.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 477743929d93630811ccb8a6eaa744a5cafe2630 in Playwright run 35711100947, attempt 1.

✅ 4555 passed · ❌ 0 failed · 🟡 3 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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) 37m 43s

⏱️ Max setup 4m 33s · max shard execution 21m 51s · max shard-job elapsed before upload 25m 11s · reporting 16s

🌐 224.69 requests/attempt · 2.22 app boots/UI scenario · 33.10% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 33.1% (convergence target: at most 15%).
  • Browser traffic was 224.69 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.22 per UI scenario (10791 boots / 4850 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 130 0 0 0 0 0
✅ Shard chromium-01 148 0 0 0 0 0
🟡 Shard chromium-02 162 0 1 0 0 0
✅ Shard chromium-03 194 0 0 0 0 0
✅ Shard chromium-04 185 0 0 0 0 0
✅ Shard chromium-05 173 0 0 0 0 0
✅ Shard chromium-06 184 0 0 0 0 0
✅ Shard chromium-07 158 0 0 0 0 0
✅ Shard chromium-08 170 0 0 1 0 0
✅ Shard chromium-09 177 0 0 0 0 0
✅ Shard chromium-10 186 0 0 0 0 0
✅ Shard chromium-11 156 0 0 0 0 0
✅ Shard chromium-12 177 0 0 0 0 0
✅ Shard chromium-13 182 0 0 0 0 0
✅ Shard chromium-14 171 0 0 0 0 0
✅ Shard chromium-15 172 0 0 0 0 0
✅ Shard chromium-16 197 0 0 0 0 0
✅ Shard chromium-17 179 0 0 0 0 0
✅ Shard chromium-18 166 0 0 0 0 0
🟡 Shard chromium-19 142 0 1 0 0 0
✅ Shard chromium-20 188 0 0 0 0 0
✅ Shard chromium-21 128 0 0 0 0 0
✅ Shard chromium-22 169 0 0 0 0 0
🟡 Shard chromium-23 215 0 1 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 51 0 0 0 0 0
✅ Shard import-export-02 99 0 0 0 0 0
✅ Shard ingestion-01 45 0 0 0 0 0
✅ Shard ingestion-02 55 0 0 0 0 0
✅ Shard reindex-01 40 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 3 flaky test(s) (passed on retry)
  • Flow/ConditionalPermissions.spec.ts › User with matchAnyTag permission can only view Container with the tag (shard chromium-02, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard chromium-19, 1 retry)
  • Features/Table.spec.ts › Glossary term should be consistent for search (shard chromium-23, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@chirag-madlani
chirag-madlani added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit 1f5edf9 Sep 22, 2026
152 of 154 checks passed
@chirag-madlani
chirag-madlani deleted the chirag-madlani/knowledge-page-editors-storage branch September 22, 2026 14:52

This branch was previously deployed

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

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants