Skip to content
Snippets Groups Projects

Phase 2 enqueuer

Merged Steve Abrams requested to merge 349744-phase2-enqueuer into master
10 files
+ 34
59
Compare changes
  • Side-by-side
  • Inline
Files
10
@@ -49,14 +49,22 @@ class ContainerRepository < ApplicationRecord
scope :aborted_imports, -> { where(migration_state: :import_aborted).unordered }
scope :recently_imported, -> { where(migration_state: :import_done).order(:migration_import_done_at) }
scope :with_target_import_tier, -> do
if ContainerRegistry::Migration.limit_gitlab_org?
where(namespaces: { id: 9970 })
else
where(plans: { name: ContainerRegistry::Migration.target_plan_name })
end
end
scope :ready_for_import, -> do
joins(
project: [namespace: [gitlab_subscription: [:hosted_plan]]]
).where(
migration_state: [:default],
created_at: ...ContainerRegistry::Migration.created_before,
plans: { name: ContainerRegistry::Migration.target_plan_name }
).where(
created_at: ...ContainerRegistry::Migration.created_before
).with_target_import_tier
.where(
"NOT EXISTS (
SELECT 1
FROM feature_gates
Loading