From 9ac22fb95d92a3eb641d1bbf9819bdc606cf430a Mon Sep 17 00:00:00 2001 From: James Robinson Date: Wed, 20 Mar 2024 15:36:59 +0000 Subject: [PATCH 1/2] Tweak "is this a substantial change?" heuristic * Don't consider changes to the gemspec (because these are often just changes to dev dependencies) * Consider changes to the changelog (if a dev considers them important enough to include in the changelog then they're probably important enough to release) --- lib/version_checker.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/version_checker.rb b/lib/version_checker.rb index a441d97..c0e38ba 100644 --- a/lib/version_checker.rb +++ b/lib/version_checker.rb @@ -75,6 +75,6 @@ def files_changed_since_tag(repo, tag) end def path_built_into_gem?(path) - path.end_with?(".gemspec") || path.start_with?("app/", "lib/") + path.start_with?("app/", "lib/") || path == "CHANGELOG.md" end end From 66c9042ed0f2bd0272963e90c317b3df7b059201 Mon Sep 17 00:00:00 2001 From: James Robinson Date: Wed, 20 Mar 2024 16:04:29 +0000 Subject: [PATCH 2/2] Replace path_built_into_gem? to clarify purpose This is a heuristic to decide if the changes since the previous version are significant enough to nag the owners of the repo to cut a new release, so let's introduce `change_is_significant?` to clarify this. --- lib/version_checker.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/version_checker.rb b/lib/version_checker.rb index c0e38ba..be08f0e 100644 --- a/lib/version_checker.rb +++ b/lib/version_checker.rb @@ -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") @@ -74,7 +73,9 @@ def files_changed_since_tag(repo, tag) end end - def path_built_into_gem?(path) - path.start_with?("app/", "lib/") || path == "CHANGELOG.md" + 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