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.
Close two token-leak paths in the git mirror and harden the supply
chain per the OWASP audit (audit/2026-08-11/security-report.md).
Runtime fixes:
- mirror GitError masks the embedded oauth2:<token> in both the
failing command line and git's stderr before raising; cli now
catches GitError with a clean message instead of an uncaught
traceback that printed the live token.
- Scrub token-bearing remote URLs from the bare config at the end
of each run so tokens aren't persisted in .git/config.
- Default mirror workdir is per-user 0700 (/tmp/cb2gitea-<uid>),
not a world-readable /tmp/cb2gitea.
Supply chain:
- Commit uv.lock; CI installs via uv sync --frozen (hash-verified).
- Pin Gitea Actions to commit SHAs, not mutable @vN tags.
- Pin the ruff rule set and exclude audit/ for reproducible linting.
Adds tests/test_mirror.py for the redaction helpers.
Set up the codeberg-to-gitea-migrator project: Python package
with src/ layout (hatchling, ruff, pytest), GPL-3.0-or-later
license, CITATION.cff, README, ADRs for stack/license/forge, and
DOX-structured AGENTS.md. Add Gitea Actions CI.
The package is a stub; migration modules land in follow-up commits.