| 1 |
Preflight checks before any creation |
With read-only calls, verify both tokens (GET /user on each host), that the owner exists and the token may create repositories there, and that the name is free on both hosts, so one host is not created and the other refused. Also test SSH to git.tirsystem.com on port 10022 (needed for the submodule); its result decides whether origin later uses SSH (test passed) or HTTPS (default). |
Yes |
UC-001 |
| 2 |
Create the empty GitHub repository |
POST /user/repos when the owner is the authenticated user, otherwise POST /orgs/{org}/repos, with auto_init false. Use the visibility from the prompt. Report the HTTP status and a hint on failure, without exposing the token. |
Yes |
UC-001 |
| 3 |
Create the empty Gitea repository |
POST /user/repos or POST /orgs/{org}/repos on the Gitea API base, with auto_init false and no template, readme, licence or gitignore. Derive the clone URL from GITEA_URL and the selected owner. |
Yes |
UC-001 |
| 4 |
Configure the Gitea to GitHub push mirror |
Call POST /repos/{owner}/{repo}/push_mirrors with remote_address (the GitHub HTTPS URL built from GITHUB_WEB_URL and the GitHub owner, without credentials), remote_username (GITHUB_USER), remote_password (GITHUB_PAT), an interval and sync_on_commit. Gitea has a known issue where sync_on_commit can be ignored on API creation, so read the result back, trigger push_mirrors-sync, and report the effective setting. The PAT needs push access to the target repository (classic repo scope, or a fine-grained token with Contents write). Stop with a clear error if it is missing. Confirm the mirror feature is enabled on the Gitea server. |
Yes |
UC-001 |
| 5 |
Partial-failure reporting and resume |
Track each step (GitHub repo, Gitea repo, mirror) in a state summary. When a step fails, print what succeeded, what did not, and the exact way to continue. When rerun and the repository already exists and is empty, offer to reuse it instead of failing. Never delete anything automatically. |
No |
|
| 6 |
Document token permissions and API limitations |
Draft the README sections on required GitHub PAT permissions (create in user or org, push), Gitea token scopes (repository write, organization write for org repos), the fact that Gitea stores the mirror password server-side, and the sync_on_commit limitation. |
No |
|