Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare release V10 release #1114

Merged
merged 3 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ jobs:
- 3.1
- "3.0"
- 2.7
- 2.6
- 2.5
gemfile:
- gemfiles/activerecord_6.0.gemfile
- gemfiles/activerecord_6.1.gemfile
- gemfiles/activerecord_7.1.gemfile
- gemfiles/activerecord_7.0.gemfile
- gemfiles/activerecord_6.1.gemfile
db:
- mysql
- postgresql
Expand All @@ -35,10 +33,6 @@ jobs:
db: postgresql
gemfile: gemfiles/activerecord_7.0.gemfile
exclude:
- ruby: 2.5
gemfile: gemfiles/activerecord_7.0.gemfile
- ruby: 2.6
gemfile: gemfiles/activerecord_7.0.gemfile
- ruby: 3.2
gemfile: gemfiles/activerecord_6.0.gemfile

Expand Down Expand Up @@ -66,7 +60,7 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down
12 changes: 6 additions & 6 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# frozen_string_literal: true

appraise 'activerecord-6.0' do
gem 'activerecord', '~> 6.0.0'
gem 'pg'
gem 'mysql2', '~> 0.5'
end

appraise 'activerecord-6.1' do
gem 'activerecord', '~> 6.1.0'
gem 'pg'
Expand All @@ -17,3 +11,9 @@ appraise 'activerecord-7.0' do
gem 'pg'
gem 'mysql2', '~> 0.5'
end

appraise 'activerecord-7.1' do
gem 'activerecord', '~> 7.1.0'
gem 'pg'
gem 'mysql2', '~> 0.5'
end
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Each change should fall into categories that would affect whether the release is

As such, _Breaking Changes_ are major. _Features_ would map to either major or minor. _Fixes_, _Performance_, and _Misc_ are either minor or patch, the difference being kind of fuzzy for the purposes of history. Adding _Documentation_ (including tests) would be patch level.

### [v9.1.0) / unreleased](https://github.com/mbleigh/acts-as-taggable-on/compare/v9.0.1...master)
### [v10.0.0) / unreleased](https://github.com/mbleigh/acts-as-taggable-on/compare/v9.0.1...master)
* Features
* [@glampr Add support for prefix and suffix searches alongside previously supported containment (wildcard) searches](https://github.com/mbleigh/acts-as-taggable-on/pull/1082)
* [@donquxiote Add support for horizontally sharded databases](https://github.com/mbleigh/acts-as-taggable-on/pull/1079)
Expand Down
9 changes: 4 additions & 5 deletions acts-as-taggable-on.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'acts_as_taggable_on/version'

require_relative 'lib/acts_as_taggable_on/version'

Gem::Specification.new do |gem|
gem.name = 'acts-as-taggable-on'
Expand All @@ -16,13 +15,13 @@ Gem::Specification.new do |gem|
gem.files = `git ls-files`.split($/)
gem.test_files = gem.files.grep(%r{^spec/})
gem.require_paths = ['lib']
gem.required_ruby_version = '>= 2.5.0'
gem.required_ruby_version = '>= 2.7.0'

if File.exist?('UPGRADING.md')
gem.post_install_message = File.read('UPGRADING.md')
end

gem.add_runtime_dependency 'activerecord', '>= 6.0', '< 8'
gem.add_runtime_dependency 'activerecord', '>= 6.1', '< 7.2'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi there @seuros! Just out of curiosity, why did you end up changing the < 8 to < 7.2?.

Reading #1110, it seemed to me that the goal was to avoid needing a new release every time a new AR minor was released but I'm not sure if you see any other risks that could come from other "non major" releases.

Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the issue arises when a new major version is released. Devs often upgrade only their Rails/Activerecord, forgetting this gem, assuming it remains compatible.

Then, I start seeing issues reported as 'errors'.
Upon debugging , it frequently turns out that the developers are using a pre-release, the master branch, or even the next major version of Rails.

We can relax the dependency in master btw.

I plan to refactor this gem soon.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense! thanks for the answer (and the release!)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as predicted #1130 Rails 7.2 released

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let release a new version.


gem.add_development_dependency 'rspec-rails'
gem.add_development_dependency 'rspec-its'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/activerecord_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "activerecord", "~> 7.0.0"
gem "activerecord", "~> 7.0.1"
gem "pg"
gem "mysql2", "~> 0.5"

Expand Down
18 changes: 18 additions & 0 deletions gemfiles/activerecord_7.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.1.0"
gem "pg"
gem "mysql2", "~> 0.5"

group :local_development do
gem "guard"
gem "guard-rspec"
gem "appraisal"
gem "rake"
gem "sqlite3"
gem "byebug", platforms: [:mri]
end

gemspec path: "../"
12 changes: 3 additions & 9 deletions lib/acts_as_taggable_on/tagger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ def tagger?
false
end

def is_tagger?
tagger?
end
alias is_tagger? tagger?
end

module InstanceMethods
Expand Down Expand Up @@ -75,19 +73,15 @@ def tagger?
self.class.is_tagger?
end

def is_tagger?
tagger?
end
alias is_tagger? tagger?
end

module SingletonMethods
def tagger?
true
end

def is_tagger?
tagger?
end
alias is_tagger? tagger?
end
end
end
4 changes: 0 additions & 4 deletions lib/acts_as_taggable_on/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ def like_operator
using_postgresql? ? 'ILIKE' : 'LIKE'
end

def legacy_activerecord?
ActiveRecord.version <= Gem::Version.new('5.3.0')
end

# escape _ and % characters in strings, since these are wildcards in SQL.
def escape_like(str)
str.gsub(/[!%_]/) { |x| "!#{x}" }
Expand Down
2 changes: 1 addition & 1 deletion lib/acts_as_taggable_on/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ActsAsTaggableOn
VERSION = '9.0.1'
VERSION = '10.0.0'
end
8 changes: 2 additions & 6 deletions spec/support/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,14 @@
else
ActiveRecord::Base.default_timezone = :utc
end
config = if ActiveRecord.version >= Gem::Version.new('6.1.0')
ActiveRecord::Base.configurations.configs_for(env_name: db_name)
else
ActiveSupport::HashWithIndifferentAccess.new(ActiveRecord::Base.configurations[db_name])
end
config = ActiveRecord::Base.configurations.configs_for(env_name: db_name)

begin
ActiveRecord::Base.establish_connection(db_name.to_sym)
ActiveRecord::Base.connection
rescue StandardError
case db_name
when /mysql/
when /(mysql)/
ActiveRecord::Base.establish_connection(config.merge('database' => nil))
ActiveRecord::Base.connection.create_database(config['database'],
{ charset: 'utf8', collation: 'utf8_unicode_ci' })
Expand Down