Skip to content

Commit 22795de

Browse files
authored
Merge pull request #353 from ellnix/fix-async-delete-regression
Fix missing index_uid in clean up job (#352)
2 parents 9f71936 + 30d5ed0 commit 22795de

File tree

7 files changed

+17
-15
lines changed

7 files changed

+17
-15
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ jobs:
3636
run: bundle exec rspec
3737
- name: Upload coverage reports to Codecov
3838
uses: codecov/codecov-action@v4
39-
env:
40-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
39+
if: matrix.ruby-version == '3.1' && matrix.rails-version == '7.0'
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
4142

4243
linter_check:
4344
name: linter-check

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ group :test do
3131
gem 'jdbc-sqlite3', platform: :jruby
3232
gem 'rspec', '~> 3.0'
3333
gem 'simplecov', require: 'false'
34-
gem 'codecov', require: 'false'
34+
gem 'simplecov-cobertura', require: 'false'
3535
gem 'threads'
3636

3737
gem 'byebug'

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.7"
2-
31
volumes:
42
bundle:
53
play_bundle:

lib/meilisearch-rails.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ def ms_entries_for(document:, synchronous:)
576576
ms_configurations.filter_map do |options, settings|
577577
{
578578
synchronous: synchronous || options[:synchronous],
579-
index_uid: options[:index_uid],
579+
index_uid: ms_index_uid(options),
580580
primary_key: primary_key
581581
}.with_indifferent_access unless ms_indexing_disabled?(options)
582582
end

spec/integration_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,9 @@
616616
)
617617

618618
expect(book.ms_entries).to contain_exactly(
619-
a_hash_including("index_uid" => safe_index_uid('SecuredBook')),
620-
a_hash_including("index_uid" => safe_index_uid('BookAuthor')),
621-
a_hash_including("index_uid" => safe_index_uid('Book')),
619+
a_hash_including("index_uid" => "#{safe_index_uid('SecuredBook')}_test"),
620+
a_hash_including("index_uid" => "#{safe_index_uid('BookAuthor')}_test"),
621+
a_hash_including("index_uid" => "#{safe_index_uid('Book')}_test"),
622622
)
623623
end
624624

@@ -629,9 +629,9 @@
629629
)
630630

631631
expect(book.ms_entries).to contain_exactly(
632-
a_hash_including("index_uid" => safe_index_uid('SecuredBook')),
633-
a_hash_including("index_uid" => safe_index_uid('BookAuthor')),
634-
a_hash_including("index_uid" => safe_index_uid('Book')),
632+
a_hash_including("index_uid" => "#{safe_index_uid('SecuredBook')}_test"),
633+
a_hash_including("index_uid" => "#{safe_index_uid('BookAuthor')}_test"),
634+
a_hash_including("index_uid" => "#{safe_index_uid('Book')}_test"),
635635
)
636636
end
637637
end

spec/ms_clean_up_job_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def create_indexed_record
2323
end
2424

2525
let(:record_entries) do
26-
record.ms_entries(true).each { |h| h[:index_uid] += '_test' }
26+
record.ms_entries(true)
2727
end
2828

2929
let(:indexes) do

spec/spec_helper.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44

55
unless ENV.fetch('DISABLE_COVERAGE', false)
66
require 'simplecov'
7-
require 'codecov'
87

98
SimpleCov.start do
109
add_filter %r{^/spec/}
1110
minimum_coverage 86.70
1211

13-
formatter SimpleCov::Formatter::Codecov if ENV['CI']
12+
if ENV['CI']
13+
require 'simplecov-cobertura'
14+
15+
formatter SimpleCov::Formatter::CoberturaFormatter
16+
end
1417
end
1518
end
1619

0 commit comments

Comments
 (0)