Repository navigation
docs: EntityRepository decomposition epic (#32946) — salvage plan for closing #33248 - #33516
Conversation
PR #33248 replaced the 13,731-line EntityRepository with 209 composed components across 911 files, plus a 161-file Collate companion. The platform review concluded the restructure mostly reorganises: 9 interfaces supplying 207 default methods, 13.7k -> 23k lines, and the structural pains that motivated #32946 (diff fused with writes, duplicated import/bulk write paths, "add a capability = edit 8 places") all survive the move. This document records the decision to close that PR and run the decomposition as an epic instead: - the baseline measured on main today (13_731 lines / 140 protected names / 13 *ForImport / 3 ThreadLocals / 17 supports* flags / 303 global DAO lookups), which becomes the Step-0 ratchet's starting constants; - a ~20-PR salvage inventory for the parts of #33248 that are unambiguous wins - 5 bug fixes, 7 perf items (505 -> 5 SQL on table metrics), the transaction test harness that already caught a Collate rollback bug, and the UI/ingestion/Collate lanes - each as a small standalone PR off main; - the 13-pain list that becomes one sub-issue each under #32946; - Step 0 (behaviour recording: size ratchet + golden master), which gates every refactor PR; - the wave order and the per-PR verification recipe. Docs only. Adds one row to docs/index.md. Sub-issue of #32946. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
❌ 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 |
…32946 Five sub-issues were opened on 2026-09-15 by porting #33248's atomicity tests onto main at 500d929, and the plan as written would have duplicated them: - #33353 is the P1 read-path N+1 (table custom metrics / column extensions); - #33358 is the passing subset of the ported atomicity ITs, i.e. the pin that T2/T3 must reconcile against rather than re-create; - #33359, #33360 and #33361 are three bugs on main that the port uncovered and that the salvage inventory did not list at all - bulk soft delete/restore committing twice per level, hard delete cancelling Flowable instances before the enclosing commit, and deadlock replay missing on hard delete plus a nested executeInTransaction replaying only the inner unit. Adds those three to Group 1 with their root cause on main, marks P1 and T2/T3, adds an "Existing issue" column to the pain table, and narrows the set of sub-issues still to open to pains 0-6, 9, 11 and 12. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Backfills the issue numbers now that they exist: #33517-#33527 for pains 0-6, 9, 11 and 12, #33524 for the read-path N+1s that #33353 does not cover, and #33528 tracking the salvage PRs. Records that #33248 and its Collate companion are closed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
| with `TableScript`/`GlossaryTermScript`/`UserScript`/`TestCaseScript`. It must **not** extend | ||
| `BaseEntityIT` (200 inherited tests, protected helpers); it reuses `SdkClients`, the SDK | ||
| `EntityServiceBase`, `BulkApi.upsert`, `CsvJobClient`, the `*TestFactory` classes, and | ||
| `TestNamespace.trackRoot`. |
There was a problem hiding this comment.
The proposed line-count check does not enforce the stated ratchet. With actual >= budget - 50, up to 50 lines can be removed without lowering the budget, although this section and the Wave-D requirements say every reduction must update the constant. This weakens the planned gate and lets small improvements go unrecorded. Use zero slack for this metric or document that reductions within the slack are intentionally allowed.
scripts/harness/check_harness.py regenerates docs/generated/api-reference.md in place to detect staleness, and a `git add -A docs/` swept the result in. The refresh is real - main gained the dataQuality/dimensions endpoints and /v1/lineage/scene without regenerating the doc - but it does not belong in a docs-plan PR. Leaving the standing harness warning for its own change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Code Review ✅ ApprovedAdds comprehensive documentation for the EntityRepository decomposition epic, detailing a salvage plan to replace PR #33248's big-bang refactor with incremental improvements. The plan includes baseline metrics, a ~20-PR inventory of wins to re-land, 13 pain-point sub-issues, and verification recipes for each refactor PR. All paths and line references were verified against OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 557 passed · ❌ 0 failed · 🟡 0 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) 54m 40s ⏱️ Max setup 4m 34s · max shard execution 17m 19s · max shard-job elapsed before upload 20m 50s · reporting 4s 🌐 226.31 requests/attempt · 2.24 app boots/UI scenario · 36.48% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Describe your changes:
Related to #32946 (this PR does not close it — it sets up the epic that will).
PR #33248 replaced the 13,731-line
EntityRepositorywith 209 composed components across 911 files(+86k/−33k), with a 161-file Collate companion (open-metadata/openmetadata-collate#6639). The
platform review concluded that the restructure mostly reorganises: the god class becomes 9
interfaces supplying 207 default methods, total lines go 13.7k → 23k, one-line reads become 7–9 line
calls, 69 updater subclasses gain boilerplate, and the structural pains that motivated #32946 (diff
fused with writes, duplicated import/bulk write paths, "add a capability = edit 8 places") all
survive the move. #33248's own
docs/entity-repository-unified-design.mdrecords the same verdict.This PR adds the plan that replaces it: close #33248, re-land its unambiguous wins as small
standalone PRs off
main, and run the decomposition as an epic under #32946 — one pain persub-issue, one RFC per pain, every refactor PR checked against a behaviour recording.
docs/plans/2026-09-17-entity-repository-epic.mdcontains:last 30 days' commits on
maintouchedEntityRepository.javaitself (of 700 commits in thewindow), so 2.0/1.13 cherry-picks would stop applying; two repos would have to move in lockstep.
main@03be0fc2555, not estimated — 13,731 lines / 140 distinctprotectedmethod names against 5 abstract ones / 13*ForImportmethods / 3ThreadLocalfields / 17
supports*flags / 303Entity.getCollectionDAO()call sites / 56 files spellingEntityRepository<…>.EntityUpdater/ 146 test files callingmockStatic(Entity.class). Thesebecome the Step-0 ratchet's starting constants.
mainand whether it is a hunkcherry-pick or a re-implementation: 5 real bug fixes (B1–B5), 7 performance items (P1 is the
headline — table/column custom metrics and column extensions go 505 → 5 SQL statements), the
transaction-test harness that already caught a live Collate rollback bug, and the
UI/Playwright/ingestion/MCP/Collate lanes. It also lists what is not salvaged, so nobody
re-mines the branch later.
EntityRepositorygod class #32946 with what hurts / root cause / howwe know it is fixed.
including the honest scenario matrix (a first PATCH never consolidates;
renameAllowedis falsefor Table/User/TestCase; search indexing is synchronous post-commit today).
Every path, line reference and issue number in the document was verified against
origin/mainat03be0fc2555before writing.Type of change:
High-level design:
N/A — documentation only. The design being recorded is the content of the document.
Tests:
Use cases covered
EntityRepositorycan find which Decompose theEntityRepositorygod class #32946 sub-issue covers the painthey just hit, and which salvage PR already carries the fix from Fixes 32946: Replace entity repository inheritance with composition #33248.
Unit tests
Not applicable — no code changes.
Backend integration tests
Not applicable — no backend API changes.
Ingestion integration tests
Not applicable.
Playwright (UI) tests
Not applicable — no UI changes.
Manual testing performed
python3 scripts/harness/check_harness.py— 5 warnings, all pre-existing onmain; this PR addsnone (the new
docs/index.mdrow resolves, anddocs/plans/**is not in the dead-referencescope).
main, and re-measured eachbaseline number quoted above against
origin/main@03be0fc2555.UI screen recording / screenshots:
Not applicable.
Checklist:
EntityRepositorygod class #32946 — intentionally not viaFixes, since the epicstays open).
🤖 Generated with Claude Code
The PR appears safe to merge, with one non-blocking documentation-design concern remaining in the existing review thread.
Findings
Summary
This documentation-only PR establishes the incremental execution plan for decomposing
EntityRepository.actual >= budget - 50still permits small reductions without updating the baseline.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Wave A: docs and independent salvage] --> B[Wave B: guarded fixes and tests] B --> C[Wave C: dependent performance and atomicity work] C --> D0[Step 0: ratchet and golden master] D0 --> D1[Step 1: EntityDiff and UpdatePolicy] D1 --> D2[Step 2: dependency injection] D2 --> D3[Step 3: aspects] D3 --> D4[Step 4: WriteContext pipeline] D4 --> D5[Step 5: UnitOfWork and outbox] D5 --> D6[Step 6: coupling-surface decision]Reviews (2) · Last reviewed commit: "docs: drop the incidentally-regenerated ..."