Skip to content

Commit

Permalink
Merge pull request #353 from ellnix/fix-async-delete-regression
Browse files Browse the repository at this point in the history
Fix missing index_uid in clean up job (#352)
  • Loading branch information
brunoocasali committed May 7, 2024
2 parents 9f71936 + 30d5ed0 commit 22795de
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 15 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ jobs:
run: bundle exec rspec
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: matrix.ruby-version == '3.1' && matrix.rails-version == '7.0'
with:
token: ${{ secrets.CODECOV_TOKEN }}

linter_check:
name: linter-check
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'jdbc-sqlite3', platform: :jruby
gem 'rspec', '~> 3.0'
gem 'simplecov', require: 'false'
gem 'codecov', require: 'false'
gem 'simplecov-cobertura', require: 'false'
gem 'threads'

gem 'byebug'
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.7"

volumes:
bundle:
play_bundle:
Expand Down
2 changes: 1 addition & 1 deletion lib/meilisearch-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def ms_entries_for(document:, synchronous:)
ms_configurations.filter_map do |options, settings|
{
synchronous: synchronous || options[:synchronous],
index_uid: options[:index_uid],
index_uid: ms_index_uid(options),
primary_key: primary_key
}.with_indifferent_access unless ms_indexing_disabled?(options)
end
Expand Down
12 changes: 6 additions & 6 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,9 @@
)

expect(book.ms_entries).to contain_exactly(
a_hash_including("index_uid" => safe_index_uid('SecuredBook')),
a_hash_including("index_uid" => safe_index_uid('BookAuthor')),
a_hash_including("index_uid" => safe_index_uid('Book')),
a_hash_including("index_uid" => "#{safe_index_uid('SecuredBook')}_test"),
a_hash_including("index_uid" => "#{safe_index_uid('BookAuthor')}_test"),
a_hash_including("index_uid" => "#{safe_index_uid('Book')}_test"),
)
end

Expand All @@ -629,9 +629,9 @@
)

expect(book.ms_entries).to contain_exactly(
a_hash_including("index_uid" => safe_index_uid('SecuredBook')),
a_hash_including("index_uid" => safe_index_uid('BookAuthor')),
a_hash_including("index_uid" => safe_index_uid('Book')),
a_hash_including("index_uid" => "#{safe_index_uid('SecuredBook')}_test"),
a_hash_including("index_uid" => "#{safe_index_uid('BookAuthor')}_test"),
a_hash_including("index_uid" => "#{safe_index_uid('Book')}_test"),
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/ms_clean_up_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def create_indexed_record
end

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

let(:indexes) do
Expand Down
7 changes: 5 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

unless ENV.fetch('DISABLE_COVERAGE', false)
require 'simplecov'
require 'codecov'

SimpleCov.start do
add_filter %r{^/spec/}
minimum_coverage 86.70

formatter SimpleCov::Formatter::Codecov if ENV['CI']
if ENV['CI']
require 'simplecov-cobertura'

formatter SimpleCov::Formatter::CoberturaFormatter
end
end
end

Expand Down

0 comments on commit 22795de

Please sign in to comment.