Skip to content

Commit

Permalink
Change the way we query the dependencies column
Browse files Browse the repository at this point in the history
  • Loading branch information
etagwerker committed Sep 11, 2024
1 parent a145087 commit 5e3ddd0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/services/check_git_branches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def call
ReportError.call "remove this when all old git branches are gone"
end
if compat.invalid?
compats = Compat.where(dependencies: compat.dependencies)
compats = Compat.where("dependencies::jsonb = ?", compat.dependencies.to_json)
if compats.size == RailsRelease.count && !compats.include?(compat)
compat.destroy
External::Github.delete_branch(compat.id)
Expand Down
2 changes: 1 addition & 1 deletion app/services/compats/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def check_dependency_subsets
end

subsets.in_groups_of(100, false).each do |group|
if @compat.rails_release.compats.where(dependencies: group).incompatible.any?
if @compat.rails_release.compats.where("dependencies::jsonb = ?", group.to_json).incompatible.any?
@compat.status = :incompatible
@compat.status_determined_by = "dependency_subsets"
return
Expand Down
4 changes: 2 additions & 2 deletions app/services/gemmies/update_compats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ def call(gemmy)
gemmy.dependencies.each do |dependencies|
rails_release
.compats
.where(dependencies: dependencies)
.where("dependencies::jsonb = ?", dependencies.to_json)
.first_or_create!
end
end

compats = Compat.where(dependencies: gemmy.dependencies)
compats = Compat.where("dependencies::jsonb = ?", gemmy.dependencies.to_json)
gemmy.update! compat_ids: compats.pluck(:id).sort
end
end
Expand Down

0 comments on commit 5e3ddd0

Please sign in to comment.