Commit cfeb9bc5 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '32696-geo-lfs-not-being-synced' into 'master'

Resolve "Geo: LFS not being synced"

Closes #32696

See merge request gitlab-org/gitlab!17633
parents a34b25c5 c8897ab7
......@@ -56,7 +56,10 @@ module Geo
join_statement =
arel_table
.join(file_registry_table, Arel::Nodes::OuterJoin)
.on(arel_table[:id].eq(file_registry_table[:file_id]))
.on(
arel_table[:id].eq(file_registry_table[:file_id])
.and(file_registry_table[:file_type].eq(:lfs))
)
joins(join_statement.join_sources)
end
......
---
title: 'Geo: LFS not being synced'
merge_request: 17633
author:
type: fixed
......@@ -7,4 +7,19 @@ RSpec.describe Geo::Fdw::LfsObject, :geo, type: :model do
it { is_expected.to have_many(:lfs_objects_projects).class_name('Geo::Fdw::LfsObjectsProject') }
it { is_expected.to have_many(:projects).class_name('Geo::Fdw::Project').through(:lfs_objects_projects) }
end
describe '.missing_file_registry', :geo_fdw do
subject { described_class.missing_file_registry }
it 'returns lfs objects that doesnt have a corresponding file registry entry' do
lfs_objects = create_list(:lfs_object, 2)
# simulate existing registry entries with the same +id+, but different +file_type+
lfs_objects.each do |lfs|
create(:geo_file_registry, file_id: lfs.id)
end
expect(subject).to match_ids(lfs_objects)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment