feat: Issues & Wiki Backup (M1.5)#4
Open
paladini wants to merge 5 commits into
Open
Conversation
Adds full spec, design, and task breakdown for the issues-wiki-backup feature: wiki git clone/push and GitHub Issues → GitLab migration with labels, milestones, comments, and idempotency via github-issue-id markers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds IssueData, CommentData, LabelData, MilestoneData, IssueMigratorResult dataclasses to support Issues & Wiki backup (M1.5). Adds backup_wiki and backup_issues bool fields to Config (default: false, read from config.yaml backup section, retrocompatible with existing configs). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GithubClient: add get_wiki_ssh_url, list_labels, list_milestones, list_issue_comments, list_issues (filters PRs, paginates via PyGithub, reuses existing rate-limit retry). GitlabClient: add get_project_id, get_wiki_ssh_url, list_issues_markers, list_labels, create_label, list_milestones, create_milestone, close_milestone, create_issue, close_issue, add_issue_comment (all routed through _call for HTTP 429 retry). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Syncs labels and milestones before migrating issues. Idempotency via <!-- github-issue-id: N --> marker — existing GitLab issues are scanned once per repo and skipped. Migrates comments in chronological order. Individual issue failures are caught and counted without aborting the repo. dry_run returns counts without creating anything. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BackupRunner.run() now returns RunSummary (repos + wikis + issues). _backup_wiki() clones/pushes repo.wiki.git; GitOpsError treated as skip (no wiki). _migrate_issues() delegates to IssueMigrator; skips if GitLab project not found with a clear warning. backup.py instantiates IssueMigrator when backup_issues=true, prints extended report with Repos/Wikis/Issues sections, exits 1 on any errors including issue migration failures. config.example.yaml and README updated with backup_wiki/backup_issues options and documented limitations (timestamps, authors, PRs). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.wiki.gitand pushes to GitLab wiki viagit push --mirror. Repos without a wiki are skipped silently. Fully idempotent.<!-- github-issue-id: N -->marker embedded in each issue body.backup_wiki: false/backup_issues: falseby default inconfig.yaml). Existing configs without these fields continue to work unchanged.Changes
src/models.pyIssueData,CommentData,LabelData,MilestoneData,IssueMigratorResult,RunSummarysrc/config.pybackup_wikiandbackup_issuesfrom config withFalsedefaultssrc/github_client.pylist_issues,list_labels,list_milestones,list_issue_comments,get_wiki_ssh_urlsrc/gitlab_client.pyget_project_id,get_wiki_ssh_url,list_issues_markers,create_label,create_milestone,close_milestone,create_issue,close_issue,add_issue_comment,list_labels,list_milestonessrc/issue_migrator.pyIssueMigratororchestrates label sync → milestone sync → issue migration with commentssrc/backup_runner.py_backup_wiki(),_migrate_issues();run()returnsRunSummarybackup.pyIssueMigrator, print extended report (Repos / Wikis / Issues)config.example.yamlbackup_wikiandbackup_issueswith limitations noteREADME.md.specs/features/issues-wiki-backup/Known limitations (documented in README and config)
Test plan
python backup.py --dry-runwithbackup_wiki: false / backup_issues: false→ output identical to pre-PR behaviour (no new sections)python backup.py --dry-runwithbackup_wiki: true / backup_issues: true→ shows Wiki and Issues dry-run lines per repopython backup.py --filter "test-*"with both enabled → wikis appear in GitLab, issues appear with attribution header and idempotency markerN already migrated, 0 created; wiki push is a no-op🤖 Generated with Claude Code