Add Geo replication for Packages::Debian::ProjectComponentFile
What does this MR do and why?
Implements Geo replication and verification for Packages::Debian::ProjectComponentFile behind the geo_packages_debian_project_component_file_replication feature flag, following the established Geo SSF blob replicator pattern.
This is Task 2 (Implementation) for the Add Geo Support issue. It is stacked on top of the Task 1 (DB schema) MR !228787.
Change follows the documented template: .gitlab/issue_templates/Geo Replicate a new blob type.md
What's included
- EE model concern with
ReplicableModel,VerifiableModel, and 2-hopproject_id_inscope viajoins(component: :distribution) - Replicator, registry model, and verification state model
- GraphQL type, resolver, and finder (with
experiment: { milestone: '18.10' }metadata) - Feature flags:
geo_packages_debian_project_component_file_replicationandgeo_packages_debian_project_component_file_force_primary_checksumming -
create_verification_details_foroverride for sharding key population via indirect join -
copy_project_idcallback on state model for single-record creates - Factories, specs (replicator, registry, finder, GraphQL resolver/type)
- Cross-cutting patches: Geo class lists, inflections, shared contexts, integration specs
- Documentation: datatypes, API docs, Prometheus metrics, GraphQL reference, OpenAPI specs
Selective sync query
The selective_sync_scope delegates to Project.selective_sync_scope(node) via a 2-hop join:
scope :project_id_in, ->(ids) {
joins(component: :distribution).where(packages_debian_project_distributions: { project_id: ids })
}
References
- Parent issue: Add Geo support for Packages::Debian::ProjectCo... (#333611) • Chad Woolley • 19.0
- Task work item: Implement Geo replication behind feature flag f... (#594714) • Unassigned
- Epic: Protocells Code Yellow Interlock - Migrate Firs... (&18384) • Nick Nguyen, Mark Wood
- Task 1 (DB schema) MR: Add Geo replication DB schema for Packages::Deb... (!228787) • Chad Woolley
- Feature flag:
geo_packages_debian_project_component_file_replication
How to set up and validate locally
- Ensure Geo tracking database is configured (see Appendix B)
- Run migrations:
bin/rake db:migrate && bin/rake db:migrate:geo - In rails console, enable the feature flag:
Feature.enable(:geo_packages_debian_project_component_file_replication) - Verify the replicator is registered:
Gitlab::Geo.replicator_classes.map(&:replicable_name) # Should include "packages_debian_project_component_file" - Run specs:
ENABLE_SPRING=1 bin/rspec ee/spec/replicators/geo/packages_debian_project_component_file_replicator_spec.rb ee/spec/models/geo/packages_debian_project_component_file_registry_spec.rb ee/spec/finders/geo/packages_debian_project_component_file_registry_finder_spec.rb
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.