From c760591e1c3dab51e5a06c45d526f1869f4548fc Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 28 Jun 2022 00:38:02 -0400 Subject: [PATCH 1/3] Bump development Ruby version to 2.7.6 This is the most recent patch version of the oldest minor version that has not reached end-of-life. --- dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev.yml b/dev.yml index 86025e58..e733cce3 100644 --- a/dev.yml +++ b/dev.yml @@ -7,7 +7,7 @@ up: - mysql-client: or: [mysql@5.7] - ruby: - version: 2.6.5 + version: 2.7.6 - railgun - bundler - custom: From 877399fa716ba290b9e381dc4acbedf72c701a99 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 28 Jun 2022 00:42:02 -0400 Subject: [PATCH 2/3] Require Ruby 2.7+, dropping 2.6 support --- .github/workflows/ci.yml | 6 +----- .rubocop.yml | 2 +- CHANGELOG.md | 2 ++ job-iteration.gemspec | 2 +- lib/job-iteration/csv_enumerator.rb | 9 +-------- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3656593d..1a04cac9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,13 +13,9 @@ jobs: - 6379:6379 strategy: matrix: - ruby: ["2.6", "2.7", "3.0", "3.1"] + ruby: ["2.7", "3.0", "3.1"] gemfile: [rails_5_2, rails_6_0, rails_6_1, rails_7_0, rails_edge] exclude: - - ruby: "2.6" - gemfile: rails_7_0 - - ruby: "2.6" - gemfile: rails_edge - ruby: "3.0" gemfile: rails_5_2 - ruby: "3.1" diff --git a/.rubocop.yml b/.rubocop.yml index 938b0031..2a6551ab 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ inherit_gem: rubocop-shopify: rubocop.yml AllCops: - TargetRubyVersion: 2.6.5 + TargetRubyVersion: 2.7.6 Exclude: - 'vendor/bundle/**/*' Lint/SuppressedException: diff --git a/CHANGELOG.md b/CHANGELOG.md index d2348707..5cbe6c6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ### Master (unreleased) +- [241](https://github.com/Shopify/job-iteration/pull/241) - Require Ruby 2.7+, dropping 2.6 support + ## v1.3.6 (Mar 9, 2022) - [190](https://github.com/Shopify/job-iteration/pull/190) - Fix updating `times_interrupted` and `total_time` when job is throttled diff --git a/job-iteration.gemspec b/job-iteration.gemspec index f2a1d3d3..ce856bff 100644 --- a/job-iteration.gemspec +++ b/job-iteration.gemspec @@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "job-iteration/version" Gem::Specification.new do |spec| - spec.required_ruby_version = ">= 2.6" + spec.required_ruby_version = ">= 2.7" spec.name = "job-iteration" spec.version = JobIteration::VERSION spec.authors = ["Shopify"] diff --git a/lib/job-iteration/csv_enumerator.rb b/lib/job-iteration/csv_enumerator.rb index 4cd93f52..9af9c9b6 100644 --- a/lib/job-iteration/csv_enumerator.rb +++ b/lib/job-iteration/csv_enumerator.rb @@ -49,14 +49,7 @@ def batches(batch_size:, cursor:) private def count_of_rows_in_file - # TODO: Remove rescue for NoMethodError when Ruby 2.6 is no longer supported. - begin - filepath = @csv.path - rescue NoMethodError - return - end - - # Behaviour of CSV#path changed in Ruby 2.6.3 (returns nil instead of raising NoMethodError) + filepath = @csv.path return unless filepath count = %x(wc -l < #{filepath}).strip.to_i From 768407087f1c16cd95bc1f9b6d53c25bfeb3ffd3 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 28 Jun 2022 00:44:15 -0400 Subject: [PATCH 3/3] Require Rails 6.0+, dropping 5.2 support --- .github/workflows/ci.yml | 6 +----- CHANGELOG.md | 1 + Gemfile.lock | 2 +- gemfiles/rails_5_2.gemfile | 6 ------ job-iteration.gemspec | 2 +- 5 files changed, 4 insertions(+), 13 deletions(-) delete mode 100644 gemfiles/rails_5_2.gemfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a04cac9..5287e549 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,12 +14,8 @@ jobs: strategy: matrix: ruby: ["2.7", "3.0", "3.1"] - gemfile: [rails_5_2, rails_6_0, rails_6_1, rails_7_0, rails_edge] + gemfile: [rails_6_0, rails_6_1, rails_7_0, rails_edge] exclude: - - ruby: "3.0" - gemfile: rails_5_2 - - ruby: "3.1" - gemfile: rails_5_2 - ruby: "3.1" gemfile: rails_6_0 include: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cbe6c6a..75360644 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### Master (unreleased) - [241](https://github.com/Shopify/job-iteration/pull/241) - Require Ruby 2.7+, dropping 2.6 support +- [241](https://github.com/Shopify/job-iteration/pull/241) - Require Rails 6.0+, dropping 5.2 support ## v1.3.6 (Mar 9, 2022) diff --git a/Gemfile.lock b/Gemfile.lock index 263ff9e1..36322c74 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,7 +8,7 @@ PATH remote: . specs: job-iteration (1.3.6) - activejob (>= 5.2) + activejob (>= 6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails_5_2.gemfile b/gemfiles/rails_5_2.gemfile deleted file mode 100644 index a47c81c9..00000000 --- a/gemfiles/rails_5_2.gemfile +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -eval_gemfile "../Gemfile" - -gem "activejob", "~> 5.2.0" -gem "activerecord", "~> 5.2.0" diff --git a/job-iteration.gemspec b/job-iteration.gemspec index ce856bff..05ebdd7f 100644 --- a/job-iteration.gemspec +++ b/job-iteration.gemspec @@ -27,5 +27,5 @@ Gem::Specification.new do |spec| spec.metadata["allowed_push_host"] = "https://rubygems.org" spec.add_development_dependency("activerecord") - spec.add_dependency("activejob", ">= 5.2") + spec.add_dependency("activejob", ">= 6.0") end