ADR-005: Repository Migration Strategy¶
Status¶
Approved - 2025-11-13
Context¶
The SyRF monorepo was initially developed in a test repository (camaradesuk/syrf-test) to validate the monorepo structure, CI/CD workflows, and GitOps deployment before committing to production. Now that the monorepo is stable and functional, we need to migrate it to the production repository.
Current State¶
Three repositories exist:
camaradesuk/syrf-web- Original Angular frontend repository- Contains 470+ GitHub issues
- Contains 47 open pull requests
- Contains GitHub Discussions
- Contains ZenHub workspace configuration
-
Team familiar with this repository name
-
camaradesuk/syrf-test- Monorepo test repository - Contains complete monorepo code (all services + libraries)
- Contains validated CI/CD workflows
- Contains GitVersion configuration
- Contains 3 branches (main, backup-before-web-remerge, migration)
-
Contains monorepo version tags (api-v*, pm-v*, web-v*, etc.)
-
Multiple archived polyrepos - Original service repositories
syrf-api,syrf-projectmanagement,syrf-lib-*(all archived)
Problem Statement¶
We need to consolidate the monorepo into a single production repository while:
- Preserving valuable GitHub metadata (issues, PRs, discussions)
- Maintaining ZenHub workspace continuity
- Minimizing disruption to team workflows
- Preserving git history traceability
Original Plan¶
Initially planned repository name: camaradesuk/syrf-monorepo
Why this is suboptimal:
- Creates yet another repository (4th total)
- Fragments GitHub metadata across repositories
- Loses connection to existing issues and PRs
- Requires ZenHub workspace migration/reconfiguration
- Confusing for users (which repo to use?)
Decision¶
Migrate the monorepo to camaradesuk/syrf by force-pushing to the existing syrf-web repository and renaming it.
Migration Strategy¶
- Create backup: Mirror
syrf-webtocamaradesuk/syrf-web-legacy(all branches, tags, refs) - Force push monorepo: Push all branches and tags from
syrf-testtosyrf-web - Rename repository: Rename
syrf-webtosyrfvia GitHub settings - Update references: Update documentation and remote URLs
Why This Approach¶
Preserves GitHub metadata (most critical):
- All 470+ issues remain in place with original IDs
- All 47 PRs remain in place (may need rebasing)
- All GitHub Discussions preserved
- All repository settings preserved (secrets, webhooks, collaborators)
- All GitHub Actions workflows and run history preserved
ZenHub continuity:
- Repository rename is transparent to ZenHub (same internal repo ID)
- Workspace continues functioning without reconfiguration
- All ZenHub metadata preserved (epics, estimates, dependencies)
Git history traceability:
- syrf-web's main branch history already merged into monorepo (via
git mv) - Force push preserves this ancestry relationship
- File history traceable from old paths to new paths
- All commits remain accessible via git log
GitHub automatic redirects:
- Old URLs (
camaradesuk/syrf-web) redirect to new URLs (camaradesuk/syrf) - External links continue working
- Minimal impact on bookmarks and external references
Consequences¶
Positive¶
- Single source of truth: One repository for all code and metadata
- Metadata preservation: No loss of issues, PRs, or discussions
- Zero ZenHub disruption: Workspace continues functioning without changes
- Git history preserved: Full traceability via git log and git mv
- Automatic redirects: Old URLs continue working via GitHub redirects
- Clean repository name:
syrf(notsyrf-monorepo) aligns with project name
Negative¶
- Open PRs require rebasing: PRs targeting old file paths need manual updates
- Example:
/src/app/component.ts→src/services/web/src/app/component.ts -
Only affects 3 recent PRs (44 older PRs are stale and can be closed)
-
Team must update local clones: One-time action to update remote URLs
- Force push is destructive: Original syrf-web code replaced on main branch
- Mitigation: Complete backup created in
syrf-web-legacy -
Mitigation: Original code still accessible via backup repo and git history
-
Documentation updates required: 28 files need updating
syrf-monorepo→syrf(naming consistency)camaradesuk/syrf-test→camaradesuk/syrf(URL updates)
Neutral¶
- Branch coexistence: 96 total branches after migration (3 monorepo + 93 original)
- No naming conflicts detected
-
Original feature branches preserved for reference
-
Tag coexistence: 700+ tags after migration (monorepo + original)
- No naming conflicts (monorepo uses prefixes:
api-v*,pm-v*,web-v*) - Original syrf-web tags preserved (unprefixed:
v3.*,v4.*)
Alternatives Considered¶
Alternative 1: Create New Repository (syrf-monorepo)¶
Description: Create brand new repository camaradesuk/syrf-monorepo and start fresh.
Pros:
- Clean slate, no force push needed
- No risk of breaking existing PRs
Cons:
- ❌ Loses all GitHub metadata (470+ issues, 47 PRs, discussions)
- ❌ Requires ZenHub migration (workspace reconfiguration, metadata may not transfer)
- ❌ Fragments history (issues in old repo, code in new repo)
- ❌ Confusing for users ("Which repo do I use?")
- ❌ External links broken (no automatic redirects)
Verdict: Rejected - Metadata loss is unacceptable.
Alternative 2: Rename syrf-test to syrf¶
Description: Simply rename the test repository to the production name.
Pros:
- Simplest technical approach
- No force push required
Cons:
- ❌ Loses all GitHub metadata from syrf-web (470+ issues, 47 PRs, discussions)
- ❌ Loses ZenHub workspace (configured on syrf-web, not syrf-test)
- ❌ No automatic redirects (syrf-test → syrf, but syrf-web remains orphaned)
- ❌ Team confusion ("Where did all our issues go?")
Verdict: Rejected - Unacceptable metadata loss.
Alternative 3: GitHub Repository Transfer¶
Description: Use GitHub's repository transfer feature to move syrf-test's code while preserving syrf-web's metadata.
Pros:
- Native GitHub feature
- Designed for repository migrations
Cons:
- ❌ Not applicable: Transfer moves entire repository, not just code
- ❌ Cannot merge repositories: Transfer doesn't combine metadata from two repos
- ❌ Still requires force push: To combine repos, force push is necessary
Verdict: Rejected - GitHub transfers don't solve the metadata consolidation problem.
Implementation Plan¶
See Repository Migration Guide for detailed step-by-step instructions.
High-level phases:
- Pre-migration: Review and handle 47 open PRs (merge/close/keep)
- Create backup: Mirror syrf-web to syrf-web-legacy (safety net)
- Force push: Push monorepo from syrf-test to syrf-web (preserves metadata)
- Rename: Rename syrf-web to syrf (GitHub handles redirects)
- Update references: Update 28 documentation files
- Validate: Verify ZenHub, CI/CD, branches, tags, issues, PRs
Estimated time: 3 hours
Validation¶
Success criteria:
- ✅ Repository accessible at
https://github.com/camaradesuk/syrf - ✅ All 470+ issues accessible with original IDs
- ✅ All 47 PRs accessible (may need rebasing)
- ✅ ZenHub workspace functional (same workspace ID)
- ✅ All branches present (96 total: 3 monorepo + 93 original)
- ✅ All tags present (700+: monorepo + original)
- ✅ Git history traceable (syrf-web commits visible in git log)
- ✅ CI/CD runs successfully on new repository
- ✅ Old URLs redirect to new repository
Rollback Plan¶
If critical issues arise:
Option 1: Rename back to syrf-web
- Preserves all metadata
- Simple one-step revert
Option 2: Restore from backup
- Force push from
syrf-web-legacyto restore original state - Requires re-archiving or deleting the monorepo attempt
Option 3: Continue using syrf-test
- Unarchive syrf-test
- Document decision to keep separate repositories
References¶
- GitHub Docs: Renaming a repository
- GitHub Docs: About redirects
- Repository Migration Guide
- ADR-003: Cluster Architecture
Decision Record¶
Date: 2025-11-13
Decision makers: Chris (Product Owner), Claude Code (Technical Advisor)
Approved by: Chris
Implementation target: ASAP (with detailed documentation for reference)
Notes¶
Why Not "syrf-monorepo"?¶
The name "syrf-monorepo" was initially planned to clearly distinguish the monorepo from individual service repositories. However:
- All old service repos are archived - No ambiguity remains
- "monorepo" is an implementation detail - Users don't need to know the internal structure
- Simpler is better -
syrfaligns with project branding - Precedent: Most organizations use simple names (e.g.,
facebook/react, notfacebook/react-monorepo)
Branch and Tag Conflicts¶
Analysis performed (2025-11-13):
- Branches: 3 syrf-test branches, 93 syrf-web branches → No conflicts
- Tags: Monorepo uses prefixes (
api-v*,pm-v*,web-v*), syrf-web uses unprefixed (v*) → No conflicts
Open PRs Impact¶
47 open PRs as of 2025-11-13:
- 3 recent PRs (2025-10 to 2025-11) - Require manual review and decision
- 44 older PRs (2021-2024) - Candidates for closure (stale)
Force push impact on PRs:
- PRs remain open and functional
- Base branch (main) code changes, so PRs may need rebasing
- File path changes (due to
git mv) require manual conflict resolution - Recommendation: Merge or close PRs before migration for cleaner migration
ZenHub Behavior¶
Repository renames in ZenHub:
- ZenHub uses internal repository ID (not name)
- Renaming a repository doesn't break ZenHub workspace
- Workspace automatically shows new repository name
- All ZenHub metadata preserved (epics, estimates, dependencies, pipelines)
Verified behavior: GitHub repository renames are transparent to ZenHub.
Change Log¶
| Date | Change | Author |
|---|---|---|
| 2025-11-13 | Initial ADR creation | Claude Code |