Commit Graph
2 Commits
Author SHA1 Message Date
AlexKucera e6fc0c7fb9 fix(migrator): retry failed writes serially
CI / test (push) Canceled after 0s
Pass-B writes (issue body rewrite + each comment) ran only at the
caller's --concurrency, so a transient target 5xx either aborted the
run or silently lost the write. A self-hosted Gitea throws bursts of
500s under concurrent writes, losing comments and leaving bodies with
stale cross-refs.

Failed writes are now deferred and replayed once serially (concurrency
1) after the concurrent wave -- serial load removes the backpressure
causing the 500s, so nearly all recover. Writes still failing serially
are logged and skipped; a genuinely-down target still aborts via
CircuitOpenError.

Adds two phase tests: persistent-fail (no abort) and transient (recover).
2026-08-13 16:10:10 +02:00
AlexKucera 9d585f601a refactor(migrator): bind repo-transfer context in Migration
CI / test (push) Canceled after 0s
Introduce a frozen Migration handle binding the identity quintet
(src/tgt clients, owner, name, NumberMap) the four entity phases
previously received as five loose params. The phases now take the
handle; migrate_repo builds one and drives all phases with it.
Retire RefCtx and the shared _path helper (absorbed into the
handle's .path()/.rewrite() accessors), deleting code rather than
leaving dead types. migrate_issues_and_prs mutates m.numbers in
place (returns None).

Add tests/test_phases.py: the previously-untested entity layer is
now reachable through the Migration seam (two mock-transport
clients + a number map, no network), covering the two-pass issue/PR
flow, label/milestone mappings, state-setting, best-effort PR merge,
the deleted-branch head fallback, and release+asset re-upload.

Closes #2
2026-08-11 16:31:58 +02:00