feat(datastore): the container upstream write envelope and associate part 4/15 (S17 Phase 6 plan: 42/42)

Why

The first container association write. One READ COMMITTED transaction holds the virtual child row's lock, the candidate's own row is read FOR SHARE against a concurrent tombstone, the list is settled, and the insert lands last.

The repair record rides here because the renumber emits it, and it names the parent repositories.id, which is what that field means everywhere else.

The list-repair WARN names the parent under repository_id, the id an operator can look up. npm and Maven name the child surrogate under their own keys, and Name the parent repository in the npm and Maven... (#1437) • Unassigned adds the parent id to their records.

Associate's argument guards get their tests in the next part, which merges right after this one: feat(datastore): container upstream reposition ... (!2844 - merged) • Hayley Swimelar • 19.5.

Datastore only: no route reaches Associate yet, so no e2e scenario or user doc changes here. The scenario catalogs land with test(managementapi): cover the container upstre... (!2859 - merged) • Hayley Swimelar • 19.5, and the user docs with feat(managementapi): container virtual upstream... (!2856 - merged) • Hayley Swimelar • 19.5.

Size

This part is 642 changed lines against main, past the 500 that docs/dev/development-model.md asks a description to justify.

Group Changed lines
Production Go (container_virtual_upstreams.go 352, query_names.go 9, container_virtual_resolution.go 5) 366
Sidecar (container_virtual_upstreams.md) 160
Tests (container_virtual_upstreams_test.go 114, npm_virtual_upstreams_test.go 2) 116

It stays one part because every function in it is on Associate's call path, so a split would land the transaction envelope and its lock order with no caller to review them against.

The stack

Fifteen parts, each stacked on the last, each green on its own, reviewed in this order. Each part stays under 700 changed lines, counted as insertions plus deletions against the part it targets.

Part MR What
1 feat(datastore): container virtual upstream sto... (!2778 - merged) • Hayley Swimelar • 19.5 store types and the list read
2 chore(datastore): add the container upstream po... (!2839 - merged) • Hayley Swimelar • 19.5 the position helpers
3 chore(datastore): add the container upstream wr... (!2841 - merged) • Hayley Swimelar • 19.5 the write statements
4 feat(datastore): the container upstream write e... (!2843 - merged) • Hayley Swimelar • 19.5 the write envelope and associate
5 feat(datastore): container upstream reposition ... (!2844 - merged) • Hayley Swimelar • 19.5 reposition and dissociate
6 test(datastore): cover the container upstream a... (!2846 - merged) • Hayley Swimelar • 19.5 associate against Postgres
7 test(datastore): cover the container upstream m... (!2852 - merged) • Hayley Swimelar • 19.5 the mutations against Postgres
8 test(datastore): cover the container upstream l... (!2853 - merged) • Hayley Swimelar • 19.5 the list read and repairs against Postgres
9 feat(datastore): refuse deleting a container vi... (!2854 - merged) • Hayley Swimelar • 19.5 the repository delete guard
10 Draft: chore(managementapi): empty part 10/15, ... (!2855 - closed) • Hayley Swimelar • 19.5 closed unmerged, its core landed with Step 41
11 feat(managementapi): container virtual upstream... (!2856 - merged) • Hayley Swimelar • 19.5 the association routes
12 test(managementapi): cover the container upstre... (!2857 - merged) • Hayley Swimelar • 19.5 handler reads and associate
13 test(managementapi): cover the container upstre... (!2858 - merged) • Hayley Swimelar • 19.5 handler refusals and update
14 test(managementapi): cover the container upstre... (!2859 - merged) • Hayley Swimelar • 19.5 handler dissociate and the catalogs
15 test(managementapi): the container upstream ass... (!2860 - merged) • Hayley Swimelar • 19.5 the integration walk

The delete guard in part 9 lands before the routes in part 11, so no window exists where a container association is writable without the refusal that protects it.

Related to #314 (closed)

Edited by Hayley Swimelar

Merge request reports

Loading
Loading