From d7f965ae51681fd8b035b272cdd95ba93902d380 Mon Sep 17 00:00:00 2001 From: Luis Padron Date: Mon, 6 Oct 2025 12:37:17 -0400 Subject: [PATCH 1/3] Update to Ruby version 3.3.9 --- .github/workflows/build.yml | 4 +-- .rubocop.yml | 2 +- .ruby-version | 1 + Gemfile | 2 +- Gemfile.lock | 69 ++++++++++++++++++++----------------- git-fastclone.gemspec | 2 +- 6 files changed, 43 insertions(+), 37 deletions(-) create mode 100644 .ruby-version diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 659b033..7a23362 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,10 +12,10 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ["2.7.4", "3.0.6", "3.1.4", "3.2.2", "3.3.0-preview3"] + ruby-version: ["3.2.2", "3.3.9", "3.5.0-preview1"] experimental: [false] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, # change this to (see https://github.com/ruby/setup-ruby#versioning): diff --git a/.rubocop.yml b/.rubocop.yml index 6add5c7..2a10a07 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,7 @@ inherit_from: .rubocop_todo.yml AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.2 NewCops: enable Naming/FileName: diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..3b47f2e --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.3.9 diff --git a/Gemfile b/Gemfile index 3e9f4b2..ac80228 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ source 'https://rubygems.org' group :development do gem 'bundler' gem 'rake' - gem 'rubocop', install_if: -> { RUBY_VERSION >= '2.3' } + gem 'rubocop', install_if: -> { RUBY_VERSION >= '3.2' } end gem 'rspec' diff --git a/Gemfile.lock b/Gemfile.lock index 051cb1c..cd41bb0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,52 +7,57 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.2) + ast (2.4.3) colorize (1.1.0) - diff-lcs (1.5.0) - json (2.6.3) - language_server-protocol (3.17.0.3) - parallel (1.23.0) - parser (3.2.2.4) + diff-lcs (1.6.2) + json (2.15.0) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + parallel (1.27.0) + parser (3.3.9.0) ast (~> 2.4.1) racc - racc (1.7.3) + prism (1.5.1) + racc (1.8.1) rainbow (3.1.1) - rake (13.1.0) - regexp_parser (2.8.2) - rexml (3.2.6) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rake (13.3.0) + regexp_parser (2.11.3) + rspec (3.13.1) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.5) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.1) - rubocop (1.57.2) + rspec-support (~> 3.13.0) + rspec-support (3.13.6) + rubocop (1.81.1) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 3.2.2.4) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.47.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.47.1) + parser (>= 3.3.7.2) + prism (~> 1.4) ruby-progressbar (1.13.0) - unicode-display_width (2.5.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.1.0) PLATFORMS arm64-darwin-22 arm64-darwin-23 + arm64-darwin-24 x64-mingw-ucrt x86_64-linux @@ -64,4 +69,4 @@ DEPENDENCIES rubocop BUNDLED WITH - 2.4.22 + 2.5.22 diff --git a/git-fastclone.gemspec b/git-fastclone.gemspec index 0ec90c2..5a3239a 100644 --- a/git-fastclone.gemspec +++ b/git-fastclone.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |gem| gem.homepage = 'http://square.github.io/git-fastclone/' gem.license = 'Apache' - gem.required_ruby_version = '>= 2.7' + gem.required_ruby_version = '>= 3.2' gem.add_runtime_dependency 'colorize' gem.metadata['rubygems_mfa_required'] = 'true' From 9cc6dd821e949a3314372f7d587fa3487d38fc8c Mon Sep 17 00:00:00 2001 From: Luis Padron Date: Mon, 6 Oct 2025 12:51:33 -0400 Subject: [PATCH 2/3] Auto-correct rubocop errors --- git-fastclone.gemspec | 2 +- lib/git-fastclone.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/git-fastclone.gemspec b/git-fastclone.gemspec index 5a3239a..ce7b243 100644 --- a/git-fastclone.gemspec +++ b/git-fastclone.gemspec @@ -36,6 +36,6 @@ Gem::Specification.new do |gem| gem.required_ruby_version = '>= 3.2' - gem.add_runtime_dependency 'colorize' + gem.add_dependency 'colorize' gem.metadata['rubygems_mfa_required'] = 'true' end diff --git a/lib/git-fastclone.rb b/lib/git-fastclone.rb index dd687d0..b45a0a9 100644 --- a/lib/git-fastclone.rb +++ b/lib/git-fastclone.rb @@ -293,13 +293,13 @@ def thread_update_submodule(submodule_url, submodule_path, threads, pwd) end end - def with_reference_repo_lock(url, &block) + def with_reference_repo_lock(url, &) # Sane POSIX implementations remove exclusive flocks when a process is terminated or killed # We block here indefinitely. Waiting for other git-fastclone processes to release the lock. # With the default timeout of 0 we will wait forever, this can be overridden on the command line. lockfile = reference_repo_lock_file(url, reference_dir, using_local_repo) Timeout.timeout(flock_timeout_secs) { lockfile.flock(File::LOCK_EX) } - with_reference_repo_thread_lock(url, &block) + with_reference_repo_thread_lock(url, &) ensure # Not strictly necessary to do this unlock as an ensure. If ever exception is caught outside this # primitive, ensure protection may come in handy. @@ -307,12 +307,12 @@ def with_reference_repo_lock(url, &block) lockfile.close end - def with_reference_repo_thread_lock(url, &block) + def with_reference_repo_thread_lock(url, &) # We also need thread level locking because pre-fetch means multiple threads can # attempt to update the same repository from a single git-fastclone process # file locks in posix are tracked per process, not per userland thread. # This gives us the equivalent of pthread_mutex around these accesses. - reference_mutex[reference_repo_name(url)].synchronize(&block) + reference_mutex[reference_repo_name(url)].synchronize(&) end def update_submodule_reference(url, submodule_url_list) From 35f17458d85fb45b3ee367806661568112887088 Mon Sep 17 00:00:00 2001 From: Luis Padron Date: Mon, 6 Oct 2025 12:53:02 -0400 Subject: [PATCH 3/3] Add logger dependency to fix 3.5.0 failure --- .github/workflows/build.yml | 2 +- Gemfile | 1 + Gemfile.lock | 2 ++ spec/git_fastclone_runner_spec.rb | 1 - 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a23362..0a81f7f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ["3.2.2", "3.3.9", "3.5.0-preview1"] + ruby-version: ["3.2.2", "3.3.9", "3.4.0", "3.5.0-preview1"] experimental: [false] steps: - uses: actions/checkout@v5 diff --git a/Gemfile b/Gemfile index ac80228..6418b21 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,7 @@ group :development do gem 'rubocop', install_if: -> { RUBY_VERSION >= '3.2' } end +gem 'logger' gem 'rspec' gemspec diff --git a/Gemfile.lock b/Gemfile.lock index cd41bb0..d8fcb91 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,6 +13,7 @@ GEM json (2.15.0) language_server-protocol (3.17.0.5) lint_roller (1.1.0) + logger (1.7.0) parallel (1.27.0) parser (3.3.9.0) ast (~> 2.4.1) @@ -64,6 +65,7 @@ PLATFORMS DEPENDENCIES bundler git-fastclone! + logger rake rspec rubocop diff --git a/spec/git_fastclone_runner_spec.rb b/spec/git_fastclone_runner_spec.rb index ede6c58..4bbc641 100644 --- a/spec/git_fastclone_runner_spec.rb +++ b/spec/git_fastclone_runner_spec.rb @@ -45,7 +45,6 @@ def create_lockfile_double it 'should initialize properly' do stub_const('GitFastClone::DEFAULT_REFERENCE_REPO_DIR', 'new_dir') - expect(Hash).to respond_to(:new).with(2).arguments expect(GitFastClone::DEFAULT_REFERENCE_REPO_DIR).to eq('new_dir') expect(subject.prefetch_submodules).to eq(true) expect(subject.reference_mutex).to eq({})