Repository navigation
Commit 0945f3d
v0.40.8: ImportRepo API write fence (FU-19, #27)
- Every ImportApiService write transaction takes lock_live_import_repo
(FOR SHARE on the dispatched git_repo row, keyed by its stored path)
first; a removed repository is IMPORT_REPO_REMOVED (409) and the
refused step writes no import_refs or git_tag row.
- edit/save: plan_file_edit computes the blob, trees and commit without
writing; the objects go through the fenced save_entry, then the
default ref moves in its own locked transaction (update_ref_in_txn).
get_root_tree / get_tree_by_hash answer NotFound (404) instead of
panicking; a failed pre-read re-checks liveness (removed_or: exact
lock-free lookup, same id) and becomes REMOVED only for a gone or
re-imported repository.
- Tags: annotated create = lock, INSERT ... RETURNING (insert_tag_in_txn)
and the ref in one transaction, without the compensating delete by
name; lightweight create = lock and ref; delete = lock, ref and git_tag
rows (delete_tag_in_txn) in one transaction, no pre-read. REMOVED wins
over the 404 target / 400 duplicate pre-checks.
- map_ceres_error maps [code:409] to 409 for the tag routes.
- No write transaction takes a second pool connection while open.
- docs/errors.md, directory-entry-api.md and trunk-push.md register the
API surfaces and the lock order.
- Tests: import_api_service fu19_ (6), 26 reverse checks. No schema
change.
Plan: docs/plan/plan-20260923.md (FU-19; DEFER-FU-33 closed,
DEFER-FU-38..41).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Eli Ma <eli@patch.sh>1 parent af349f7 commit 0945f3d
11 files changed
Lines changed: 1626 additions & 279 deletions
File tree
- docs
- plan
- refactoring
- src
- api/router
- ceres/api_service
- common/errors
- jupiter/storage
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
0 commit comments