Skip to content

Commit f87824a

Browse files
committed
Tighten deps, CI, lint config, and release docs for rc1
1 parent e36e98d commit f87824a

24 files changed

Lines changed: 86 additions & 139 deletions

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Uploadcare API credentials
2-
# Copy this file to .env and fill in your actual keys
2+
# Copy this file to .env and fill in your actual keys (for local development only).
3+
# Never commit real credentials. See MIGRATING_V5.md for v5 client-first setup details.
34
# Get your keys from: https://app.uploadcare.com/projects/-/api-keys/
45

56
UPLOADCARE_PUBLIC_KEY=your_public_key_here

.github/workflows/ruby.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# They are provided by a third-party and are governed by
33
# separate terms of service, privacy policy, and support
44
# documentation.
5-
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
5+
# This workflow installs Ruby, runs tests, and runs style checks in a dedicated job.
66
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
77

88
name: Ruby
@@ -29,10 +29,11 @@ jobs:
2929
ruby-version: ${{ matrix.ruby-version }}
3030
bundler-cache: true
3131
- name: Run tests
32-
run: bundle exec rspec
32+
# Keep test invocation on rake tasks so repository-local pre/post hooks stay centralized.
33+
run: bundle exec rake spec
3334
env:
3435
UPLOADCARE_PUBLIC_KEY: demopublickey
35-
UPLOADCARE_SECRET_KEY: demoprivatekey
36+
UPLOADCARE_SECRET_KEY: demosecretkey
3637

3738
style-check:
3839
runs-on: ubuntu-latest

.rubocop.yml

Lines changed: 12 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ plugins:
44

55
AllCops:
66
NewCops: enable
7-
TargetRubyVersion: 3.3
7+
# RuboCop currently supports up to 3.5; CI still tests this gem on Ruby 4.0.
8+
TargetRubyVersion: 3.4
89
SuggestExtensions: false
910
Exclude:
1011
- 'examples/**/*'
@@ -81,6 +82,9 @@ Style/FrozenStringLiteralComment:
8182
Style/ArgumentsForwarding:
8283
Enabled: false
8384

85+
Gemspec/RequiredRubyVersion:
86+
Enabled: false
87+
8488
RSpec/ContextWording:
8589
Prefixes:
8690
- when
@@ -90,37 +94,17 @@ RSpec/ContextWording:
9094
- unless
9195
- for
9296

93-
RSpec/MultipleExpectations:
94-
Enabled: false
95-
96-
RSpec/ExampleLength:
97-
Enabled: false
98-
99-
RSpec/DescribedClass:
100-
Enabled: false
101-
102-
RSpec/DescribeClass:
103-
Enabled: false
104-
105-
RSpec/ExpectActual:
106-
Enabled: false
107-
97+
# Kept intentionally for API-integration style specs where strict unit-style cops add noise.
10898
RSpec/AnyInstance:
10999
Enabled: false
110100

111-
RSpec/SpecFilePathFormat:
112-
Enabled: false
113-
114-
RSpec/LeadingSubject:
115-
Enabled: false
116-
117-
RSpec/EmptyLineAfterExample:
101+
RSpec/DescribedClass:
118102
Enabled: false
119103

120-
RSpec/EmptyLineAfterFinalLet:
104+
RSpec/ExampleLength:
121105
Enabled: false
122106

123-
RSpec/EmptyLineAfterExampleGroup:
107+
RSpec/MultipleExpectations:
124108
Enabled: false
125109

126110
RSpec/MultipleMemoizedHelpers:
@@ -129,32 +113,15 @@ RSpec/MultipleMemoizedHelpers:
129113
RSpec/NestedGroups:
130114
Enabled: false
131115

132-
RSpec/NamedSubject:
133-
Enabled: false
134-
135-
RSpec/IteratedExpectation:
116+
# Existing test suite uses classic doubles/spies heavily; keep these disabled until specs are migrated.
117+
RSpec/DescribeClass:
136118
Enabled: false
137119

138-
RSpec/BeEq:
120+
RSpec/MessageSpies:
139121
Enabled: false
140122

141123
RSpec/StubbedMock:
142124
Enabled: false
143125

144-
RSpec/EmptyLineAfterHook:
145-
Enabled: false
146-
147-
RSpec/MessageSpies:
148-
Enabled: false
149-
150126
RSpec/VerifiedDoubles:
151127
Enabled: false
152-
153-
RSpec/ReceiveMessages:
154-
Enabled: false
155-
156-
RSpec/HookArgument:
157-
Enabled: false
158-
159-
RSpec/ClassCheck:
160-
Enabled: false

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ Please review [`MIGRATING_V5.md`](./MIGRATING_V5.md) before upgrading from v4.x.
5151

5252
* Support for Ruby versions below `3.3`
5353
* Legacy configuration and transport patterns that were no longer aligned with the v5 architecture
54+
### Risk & Rollout Notes
55+
* Ruby support baseline is now `>= 3.3`; verify application/runtime images before upgrading.
56+
* Recommended rc1 rollout: wire explicit `Uploadcare::Client` instances first, then migrate call sites incrementally.
57+
* Keep rollback simple by pinning to the latest v4 release if your app depends on removed internal APIs.
5458

5559
## 4.5.0 — 2025-07-25
5660
### Added

Gemfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@
22

33
source 'https://rubygems.org'
44

5-
# Ruby 3.4+ and 4.0+ compatibility - these gems are no longer in stdlib
6-
gem 'base64'
7-
gem 'benchmark' # Required for Ruby 4.0+ compatibility
8-
gem 'bigdecimal'
9-
gem 'cgi' # Required for Ruby 4.0+ compatibility
10-
gem 'mutex_m'
11-
125
group :development, :test do
6+
# Ruby 3.4+ stopped shipping some stdlib components as default gems.
7+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4')
8+
gem 'base64', require: false
9+
gem 'cgi', require: false
10+
end
11+
12+
# Ruby 4.1+ removes tsort from default gems.
13+
gem('tsort', require: false) if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('4.1')
14+
1315
gem 'byebug'
1416
gem 'dotenv', '~> 3.2' # For running examples with .env file
15-
gem 'irb'
1617
gem 'rake'
17-
gem 'rdoc'
1818
gem 'redcarpet'
1919
gem 'rspec'
2020
gem 'rubocop'
2121
gem 'rubocop-rake'
2222
gem 'rubocop-rspec'
2323
gem 'simplecov', require: false
24-
gem 'tsort', require: false
2524
gem 'vcr'
2625
gem 'webmock'
2726
gem 'yard'

MIGRATING_V5.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ Version 5 introduces:
1919
- a modernized internal structure built around Zeitwerk and Faraday
2020

2121
Version 5 also raises the minimum supported Ruby version to `3.3`.
22+
The CI matrix for v5 verifies `3.3`, `3.4`, and `4.0`.
23+
24+
If you run examples locally with `.env`, use it only for developer machines and never commit real keys.
25+
The examples expect `UPLOADCARE_PUBLIC_KEY` and `UPLOADCARE_SECRET_KEY` to come from environment variables.
2226

2327
## Recommended Migration Order
2428

lib/uploadcare/operations/multipart_upload.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def upload_parts_sequential(file, presigned_urls, part_size, &block)
104104
end
105105
end
106106

107-
def upload_parts_parallel(file, presigned_urls, part_size, threads, &block)
107+
def upload_parts_parallel(file, presigned_urls, part_size, threads, &)
108108
total_size = file.respond_to?(:size) ? file.size : ::File.size(file.path)
109109
uploaded = { value: 0 }
110110
mutex = Mutex.new
@@ -131,26 +131,26 @@ def upload_parts_parallel(file, presigned_urls, part_size, threads, &block)
131131

132132
workers = threads.times.map do
133133
Thread.new do
134-
run_parallel_worker(worker_context, &block)
134+
run_parallel_worker(worker_context, &)
135135
end
136136
end
137137

138138
workers.each(&:join)
139139
raise errors.first if errors.any?
140140
end
141141

142-
def run_parallel_worker(context, &block)
142+
def run_parallel_worker(context, &)
143143
::File.open(context[:file_path], 'rb') do |worker_file|
144-
process_parallel_jobs(worker_file, context, &block)
144+
process_parallel_jobs(worker_file, context, &)
145145
rescue StandardError => e
146146
record_parallel_error(context, e)
147147
end
148148
end
149149

150-
def process_parallel_jobs(worker_file, context, &block)
150+
def process_parallel_jobs(worker_file, context, &)
151151
loop do
152152
job = context[:queue].pop
153-
break unless process_parallel_job(worker_file, context, job, &block)
153+
break unless process_parallel_job(worker_file, context, job, &)
154154
end
155155
end
156156

spec/uploadcare/api/rest/addons_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
require 'spec_helper'
44

55
RSpec.describe Uploadcare::Api::Rest::Addons do
6+
subject(:addons) { described_class.new(rest: rest) }
7+
68
let(:config) do
79
Uploadcare::Configuration.new(
810
public_key: 'demopublickey',
@@ -15,8 +17,6 @@
1517

1618
let(:rest) { Uploadcare::Api::Rest.new(config: config) }
1719

18-
subject(:addons) { described_class.new(rest: rest) }
19-
2020
describe '#initialize' do
2121
it 'stores the rest client' do
2222
expect(addons.rest).to eq(rest)

spec/uploadcare/api/rest/document_conversions_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
require 'spec_helper'
44

55
RSpec.describe Uploadcare::Api::Rest::DocumentConversions do
6+
subject(:document_conversions) { described_class.new(rest: rest) }
7+
68
let(:config) do
79
Uploadcare::Configuration.new(
810
public_key: 'demopublickey',
@@ -14,8 +16,6 @@
1416

1517
let(:rest) { Uploadcare::Api::Rest.new(config: config) }
1618

17-
subject(:document_conversions) { described_class.new(rest: rest) }
18-
1919
describe '#initialize' do
2020
it 'stores the rest client' do
2121
expect(document_conversions.rest).to eq(rest)

spec/uploadcare/api/rest/file_metadata_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
require 'spec_helper'
44

55
RSpec.describe Uploadcare::Api::Rest::FileMetadata do
6+
subject(:file_metadata) { described_class.new(rest: rest) }
7+
68
let(:config) do
79
Uploadcare::Configuration.new(
810
public_key: 'demopublickey',
@@ -14,8 +16,6 @@
1416

1517
let(:rest) { Uploadcare::Api::Rest.new(config: config) }
1618

17-
subject(:file_metadata) { described_class.new(rest: rest) }
18-
1919
describe '#initialize' do
2020
it 'stores the rest client' do
2121
expect(file_metadata.rest).to eq(rest)

0 commit comments

Comments
 (0)