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-hop project_id_in scope via joins(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_replication and geo_packages_debian_project_component_file_force_primary_checksumming
  • create_verification_details_for override for sharding key population via indirect join
  • copy_project_id callback 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

How to set up and validate locally

  1. Ensure Geo tracking database is configured (see Appendix B)
  2. Run migrations: bin/rake db:migrate && bin/rake db:migrate:geo
  3. In rails console, enable the feature flag:
    Feature.enable(:geo_packages_debian_project_component_file_replication)
  4. Verify the replicator is registered:
    Gitlab::Geo.replicator_classes.map(&:replicable_name)
    # Should include "packages_debian_project_component_file"
  5. 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.

Merge request reports

Loading