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
This commit is contained in:
1 parent
1613ec72b8
commit
9d585f601a
12 files changed
+654
-124
No files matched your search
@@ -52,11 +52,6 @@ class CircuitOpenError(RuntimeError):
|
||||
"""
|
||||
|
||||
|
||||
def _path(owner: str, repo: str, suffix: str = "") -> str:
|
||||
"""Shared repo-scoped API path (used by every migration module)."""
|
||||
return f"/repos/{owner}/{repo}{suffix}"
|
||||
|
||||
|
||||
class ApiClient:
|
||||
"""Bearer-auth client over the Forgejo/Gitea REST API (``/api/v1``)."""
|
||||
|
||||
|
||||
Reference in new issue
Block a user