Skip to content

Commit

Permalink
check only compats of latest two major versions for now
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmeurer committed Jun 19, 2024
1 parent 5277d42 commit b765851
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
14 changes: 10 additions & 4 deletions app/models/rails_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ class RailsRelease < ApplicationRecord
end

scope :latest_major, -> {
versions = pluck(:version).group_by { _1[/\A\d+/] }
.values
.map(&:max)
order(:version).where(version: versions)
pluck(:version)
.group_by { _1[/\A\d+/] }
.sort_by(&:first)
.last(2)
.to_h
.values
.map(&:max)
.then {
where(version: _1).order(:version)
}
}

def to_s
Expand Down
5 changes: 4 additions & 1 deletion app/services/check_git_branches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def call
when compat.checked_before?(1.week.ago)
compat.unchecked!
External::Github.delete_branch(compat.id)
Compats::Check.call_async compat

if RailsRelease.latest_major.include?(compat.rails_release)
Compats::Check.call_async compat
end
end
end

Expand Down
2 changes: 0 additions & 2 deletions app/services/compats/check_unchecked.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ def do_check
RailsRelease
.latest_major
.reverse
.concat(RailsRelease.all)
.uniq
.each do |rails_release|

rails_release
Expand Down

0 comments on commit b765851

Please sign in to comment.