Org migration target cell: Add foundation
Summary
Introduces the foundational concept of an "org migration target cell" - a specialized type of Geo node/site that receives organizations during cross-cell migration.
You can get the full picture here: Draft: Implement behavior of org migration targ... (!219850)
What is an org migration target cell?
An org migration target cell:
- Replicates and verifies data like a Geo secondary
- Does NOT proxy requests to the primary (requests go directly to source cell)
- Does NOT OAuth against the primary
-
Is identified by the
org_migration_target_cellfeature flag
What's included
New methods on GeoNode:
-
org_migration_target?- Returns true if this node is an org migration target -
secondary?- Modified to exclude org migration targets -
secondary_or_org_migration_target?- Combined check for code that needs both behaviors
New methods on Gitlab::Geo:
-
Gitlab::Geo.org_migration_target?- Module-level check -
Gitlab::Geo.secondary_or_org_migration_target?- Combined check -
Gitlab::Geo.replica_org?(org)- Check if org data should be replicated -
Gitlab::Geo.replica_namespace?(ns)- Check if namespace data should be replicated -
Gitlab::Geo.replica_project?(proj)- Check if project data should be replicated -
Gitlab::Geo.replica_organization_id?(id)- ID-based org check -
Gitlab::Geo.replica_namespace_id?(id)- ID-based namespace check -
Gitlab::Geo.replica_project_id?(id)- ID-based project check
Feature flag:
-
org_migration_target_cell- Controls org migration target behavior (disabled by default)
What's NOT included
The total change is too large to review. Therefore this MR contains only the foundational methods and their unit tests. The integration of these methods throughout the codebase (workers, services, replicators, views, console, rake tasks) will follow in subsequent MRs.
Testing
-
✅ 100% unit test coverage of all new methods -
✅ All edge cases and branches covered
References
| MR | Status |
|---|---|
| Org migration target cell: Add foundation (!223454) | You are here |
| Org migration target cell: Core Rails behavior (!225219) | |
| Draft: Implement behavior of org migration target cell (!219850) |
How to set up and validate locally
See gitlab-development-kit!5555
Run the end-to-end script which installs GDK from scratch and actually uses the final Rails MR Draft: Implement behavior of org migration targ... (!219850):
# Set your license (required - Premium or Ultimate)
export GITLAB_ACTIVATION_CODE="your-activation-code"
# OR
export GITLAB_LICENSE_FILE="/path/to/license.gitlab-license"
# Optional: customize branches (these are the defaults)
export GDK_BRANCH="mk/gdk-org-configure-replication"
export GITLAB_BRANCH="mk/org-migration-target"
# Run from an empty directory
mkdir org-migration-test && cd org-migration-test
# Download and run the script
curl -fsSL "https://gitlab.com/gitlab-org/gitlab-development-kit/-/raw/mk/gdk-org-configure-replication/support/cells/org-migration-install" -o org-migration-install
chmod +x org-migration-install
./org-migration-install
Related
- Part of: #546267
- Related to: Protocells: POC of "Org Migration Target Cell" ... (#571916 - closed)
- Full POC implementation: Draft: Implement behavior of org migration targ... (!219850)
Reviewer guidance
Focus on:
- Conceptual soundness - Does the org migration target concept make sense?
- Method naming and signatures - Are they clear and intuitive?
- Test coverage - Are all edge cases covered?
Don't worry about:
- Integration code (that's intentionally excluded)
- Usage of these methods (that comes next)