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
The migrator was fully synchronous — every HTTP round-trip and git
op serialized over one blocking client, and a stalled git push could
hang it forever. Overlap the independent phases and bound the slow /
memory-heavy paths.
- clients: ApiClient is now thread-safe (per-thread httpx.Client) so
labels, milestones, Pass-B comments, and release assets overlap via
parallel(); --concurrency sizes it (default 8). Pass A issue/PR
creation stays serial — entities are created in source-number order
so the number map resolves forward cross-references.
- releases: stream assets through a spooled temp file instead of
buffering each whole into memory; upload them concurrently.
- reliability: per-op --git-timeout (was unbounded hangs), a circuit
breaker that aborts on a degraded target, jittered retry backoff,
and a bulk timeout for large asset transfers.
- round-trips: set an issue's milestone in the create body; batch the
deleted-branch PR-head git push and refs/pull/* pruning.
- fix: raw_get_stream 4xx/5xx raised AttributeError (resp.read().text
on bytes) instead of ApiError — now decodes. Wrap mirror git ops in
try/finally so tokenized remote URLs are scrubbed even on timeout.
- refactor: drop the typer dependency — the CLI is now stdlib argparse
(same subcommands, flags, and env vars); remove dead code surfaced by
a whole-repo audit (has_lfs, name_map, unused owner_repo param,
stored-but-unread _base_url).
- ci: enable the uv download cache.
Tests cover parallel ordering, the circuit breaker, and the streamed
4xx path. CHANGELOG updated; the runtime dependency is now just httpx.