Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #15 from alphagov/change-heuristic
Browse files Browse the repository at this point in the history
Tweak "is this a substantial change?" heuristic
  • Loading branch information
robinjam authored Mar 20, 2024
2 parents 49c5b72 + 66c9042 commit 1e61bdf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/version_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def message_builder(gems)
repo_name = gem["app_name"]
repo_url = gem["links"]["repo_url"]
rubygems_version = fetch_rubygems_version(repo_name)
if !rubygems_version.nil? &&
files_changed_since_tag(repo_name, "v#{rubygems_version}").any? { |path| path_built_into_gem?(path) }
if !rubygems_version.nil? && change_is_significant?(repo_name, rubygems_version)
"<#{repo_url}|#{repo_name}> has unreleased changes since v#{rubygems_version}"
end
}.join("\n")
Expand Down Expand Up @@ -74,7 +73,9 @@ def files_changed_since_tag(repo, tag)
end
end

def path_built_into_gem?(path)
path.end_with?(".gemspec") || path.start_with?("app/", "lib/")
def change_is_significant?(repo_name, previous_version)
files_changed_since_tag(repo_name, "v#{previous_version}").any? do |path|
path.start_with?("app/", "lib/") || path == "CHANGELOG.md"
end
end
end

0 comments on commit 1e61bdf

Please sign in to comment.