From 7cab90bbe2741ebf99760d869438fa203d718475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 2 May 2024 20:05:56 +0000 Subject: [PATCH 1/6] Drop support for Ruby 2.7 and 3.0 Those are EOL today. --- .github/workflows/ci.yml | 3 +-- .rubocop.yml | 2 +- packwerk.gemspec | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebcaea520..e92524df7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,9 @@ jobs: - gemfiles/Gemfile-rails-6-0 - gemfiles/Gemfile-rails-6-1 ruby: - - "3.0" - "3.1" - "3.2" + - "3.3" env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} name: "Tests: Ruby ${{ matrix.ruby }} ${{ matrix.gemfile }}" @@ -39,7 +39,6 @@ jobs: gemfile: - Gemfile ruby: - - "3.0" - "3.1" - "3.2" env: diff --git a/.rubocop.yml b/.rubocop.yml index 381b94176..bb6d214c0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,7 +6,7 @@ require: - rubocop-sorbet AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.1 NewCops: disable UseCache: true SuggestExtensions: false diff --git a/packwerk.gemspec b/packwerk.gemspec index 7f70583c2..f5f95c3a9 100644 --- a/packwerk.gemspec +++ b/packwerk.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.files = Dir["CHANGELOG.md", "LICENSE.md", "README.md", "lib/**/*", "sorbet/**/*"] spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.7" + spec.required_ruby_version = ">= 3.1" spec.add_dependency("activesupport", ">= 6.0") spec.add_dependency("bundler") From 7024dc2aaf02db222e10435313b6a5f7db8c03fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 2 May 2024 20:09:46 +0000 Subject: [PATCH 2/6] No need to test with specific versions of Rails We only depend on a few features of Active Support and it is very unlikely that they will change between versions of Rails. --- .github/workflows/ci.yml | 2 -- gemfiles/Gemfile-rails-6-0 | 22 ---------------------- gemfiles/Gemfile-rails-6-1 | 22 ---------------------- 3 files changed, 46 deletions(-) delete mode 100644 gemfiles/Gemfile-rails-6-0 delete mode 100644 gemfiles/Gemfile-rails-6-1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e92524df7..dac4c7a60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,6 @@ jobs: matrix: gemfile: - Gemfile - - gemfiles/Gemfile-rails-6-0 - - gemfiles/Gemfile-rails-6-1 ruby: - "3.1" - "3.2" diff --git a/gemfiles/Gemfile-rails-6-0 b/gemfiles/Gemfile-rails-6-0 deleted file mode 100644 index 9ad2e0494..000000000 --- a/gemfiles/Gemfile-rails-6-0 +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -source("https://rubygems.org") - -gemspec path: ".." - -# Specify the same dependency sources as the application Gemfile - -gem("spring") -gem("rails", "~> 6.0.0") -gem("constant_resolver", require: false) -gem("sorbet-runtime", require: false) -gem("rubocop-performance", require: false) -gem("rubocop-sorbet", require: false) -gem("mocha", require: false) -gem("rubocop-shopify", require: false) -gem("tapioca", require: false) - -group :development do - gem("byebug", require: false) - gem("minitest-focus", require: false) -end diff --git a/gemfiles/Gemfile-rails-6-1 b/gemfiles/Gemfile-rails-6-1 deleted file mode 100644 index e704111a6..000000000 --- a/gemfiles/Gemfile-rails-6-1 +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -source("https://rubygems.org") - -gemspec path: ".." - -# Specify the same dependency sources as the application Gemfile - -gem("spring") -gem("rails", "~> 6.1") -gem("constant_resolver", require: false) -gem("sorbet-runtime", require: false) -gem("rubocop-performance", require: false) -gem("rubocop-sorbet", require: false) -gem("mocha", require: false) -gem("rubocop-shopify", require: false) -gem("tapioca", require: false) - -group :development do - gem("byebug", require: false) - gem("minitest-focus", require: false) -end From 0757913bbd288f92e0e8841571f9b0c0fc9cf707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 2 May 2024 20:14:17 +0000 Subject: [PATCH 3/6] Place for development dependencies is the Gemfile --- Gemfile | 1 + packwerk.gemspec | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index dfca0aa91..090a0380b 100644 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,7 @@ gem("rubocop-sorbet", require: false) gem("mocha", require: false) gem("rubocop-shopify", require: false) gem("tapioca", require: false) +gem("railties") group :development do gem("byebug", require: false) diff --git a/packwerk.gemspec b/packwerk.gemspec index f5f95c3a9..dea4c163f 100644 --- a/packwerk.gemspec +++ b/packwerk.gemspec @@ -52,6 +52,4 @@ Gem::Specification.new do |spec| # For ERB parsing spec.add_dependency("better_html") - - spec.add_development_dependency("railties") end From f84f61b89a2434d1d05aa510bc71b98d289cde48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 2 May 2024 20:15:24 +0000 Subject: [PATCH 4/6] All those gems are development gems --- Gemfile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 090a0380b..fd08875f4 100644 --- a/Gemfile +++ b/Gemfile @@ -16,12 +16,10 @@ gem("rubocop-shopify", require: false) gem("tapioca", require: false) gem("railties") -group :development do - gem("byebug", require: false) - gem("minitest-focus", require: false) +gem("byebug") +gem("minitest-focus") - gem("m") - gem("rake") - gem("sorbet-static-and-runtime") - gem("zeitwerk") -end +gem("m") +gem("rake") +gem("sorbet-static-and-runtime") +gem("zeitwerk") From a5e633e4aadd2fc911809c16cf6417769e376472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 2 May 2024 20:19:51 +0000 Subject: [PATCH 5/6] Upgrade nokogiri to work with Ruby 3.3 --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7d08f007a..8ea776376 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -63,20 +63,20 @@ GEM minitest (>= 4, < 6) mocha (1.14.0) netrc (0.11.0) - nokogiri (1.15.3-aarch64-linux) + nokogiri (1.16.4-aarch64-linux) racc (~> 1.4) - nokogiri (1.15.3-arm64-darwin) + nokogiri (1.16.4-arm64-darwin) racc (~> 1.4) - nokogiri (1.15.3-x86_64-darwin) + nokogiri (1.16.4-x86_64-darwin) racc (~> 1.4) - nokogiri (1.15.3-x86_64-linux) + nokogiri (1.16.4-x86_64-linux) racc (~> 1.4) parallel (1.24.0) parser (3.3.1.0) ast (~> 2.4.1) racc prism (0.27.0) - racc (1.7.1) + racc (1.7.3) rack (2.2.4) rack-test (2.0.2) rack (>= 1.3) From 5c46e682cff21758160e7390556d406420cf3527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 2 May 2024 20:21:32 +0000 Subject: [PATCH 6/6] Delete Gemfile.lock in CI Makes sure we are always testing against the latest dependencies. --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dac4c7a60..e35c1856d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,8 @@ jobs: name: "Tests: Ruby ${{ matrix.ruby }} ${{ matrix.gemfile }}" steps: - uses: actions/checkout@v2 + - name: Deletes Gemfile.lock + run: rm Gemfile.lock - name: Set up Ruby ${{ matrix.ruby }} uses: ruby/setup-ruby@v1 with: @@ -44,6 +46,8 @@ jobs: name: "Loading Tests: Ruby ${{ matrix.ruby }} ${{ matrix.gemfile }}" steps: - uses: actions/checkout@v2 + - name: Delete Gemfile.lock + run: rm Gemfile.lock - name: Set up Ruby ${{ matrix.ruby }} uses: ruby/setup-ruby@v1 with: