Skip to content
Open
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
10 changes: 3 additions & 7 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ jobs:
strategy:
matrix:
ruby-version:
- 3.0
- 3.1
- 3.2
- 3.3
- 3.4
- 4.0
Copy link
Contributor

@coderabbitai coderabbitai bot Jan 6, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | πŸ”΄ Critical

Ruby 4.0 will cause CI failures (duplicate concern).

This issue was previously flagged as critical: the ruby/setup-ruby action does not yet support Ruby 4.0, and the workflow will fail at the setup step. The commit message indicates critical issues were fixed, but Ruby 4.0 remains in both the test matrix (line 21) and style-check matrix (line 43).

Additionally, the style-check job now depends solely on Ruby 4.0; if that version fails to install, no RuboCop checks will run at all.

Recommended fixes:

  • Remove 4.0 from both matrices, or
  • Replace with ruby-head for forward-compatibility testing, or
  • Restore a stable Ruby version (e.g., 3.4) to the style-check matrix as a fallback

Also applies to: 43-43

πŸ€– Prompt for AI Agents
In @.github/workflows/ruby.yml at line 21, The CI workflow references Ruby
version "4.0" in the test matrix and the style-check matrix which causes setup
failures because ruby/setup-ruby doesn't support 4.0 yet; update the matrices
used by the jobs that call the ruby/setup-ruby action (the test matrix and the
style-check matrix) to remove "4.0" or replace it with "ruby-head" for
forward-compatibility, or restore a stable version such as "3.4" for the
style-check matrix so RuboCop still runs; ensure both occurrences are updated
consistently so the style-check job does not depend solely on an unsupported 4.0
entry.

Copy link
Contributor

Choose a reason for hiding this comment

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

With latest release it should support it. Could you please double-check?

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

🌐 Web query:

ruby/setup-ruby action Ruby 4.0 support 2026

πŸ’‘ Result:

Short answer: As of Jan 14, 2026, ruby/setup-ruby does not list Ruby 4.0 as a supported release β€” its README shows supported MRI versions up through 3.5 (and ruby-head/preview builds). Ruby 4.0 was released Dec 25, 2025. [1][2]

What that means for you:

  • You can test against Ruby 4.0 by using ruby-head (or previews) in ruby/setup-ruby, but an official prebuilt Ruby 4.0 release is not listed in the action's supported-versions table yet. [1][2]

Sources:

  • ruby/setup-ruby README (supported versions list). [1]
  • Ruby 4.0.0 release announcement (Dec 25, 2025). [2]

@alxgsv, I've checked the latest information:

Ruby 4.0 status: Ruby 4.0.0 was released on December 25, 2025.[2]

ruby/setup-ruby support: As of today (January 14, 2026), the ruby/setup-ruby action's documentation lists supported MRI versions up to 3.5, but 4.0 is not yet included in the official supported versions table.[1][2]

What this means for your CI:

  • Using ruby-version: 4.0 directly in the matrix will likely fail during the setup step because prebuilt binaries aren't available through the action yet.

Recommended solutions:

  1. Use ruby-head for forward-compatibility testing:

    ruby-version:
      - 3.3
      - 3.4
      - ruby-head  # Tests against latest Ruby (including 4.0)
  2. Or wait for the ruby/setup-ruby maintainers to add official 4.0 support and remove 4.0 from the matrices temporarily.

  3. Ensure style-check doesn't depend solely on an unsupported version – consider keeping 3.4 in the style-check matrix so RuboCop runs reliably.

Would you like to update the workflow to use ruby-head, or would you prefer to wait for official 4.0 support?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

🌐 Web query:

ruby/setup-ruby GitHub marketplace Ruby 4.0 support January 2026

πŸ’‘ Result:

Short answer: Yes β€” ruby/setup-ruby added Ruby 4.0 support in January 2026 (tests for 4.0 in v1.280.0 and ruby-4.0.1 added in v1.282.0). [1][2]

Sources:

  • Dependabot PR changelog showing v1.280.0 (tests Ruby 4.0 on Windows). [1]
  • Dependabot PR changelog showing v1.282.0 (adds ruby-4.0.1). [2]

@alxgsv, you're absolutely rightβ€”thank you for the correction! πŸ™

I've verified that ruby/setup-ruby now officially supports Ruby 4.0 (added in v1.280.0) and Ruby 4.0.1 (added in v1.282.0) as of January 2026.[1][2] The marketplace page you linked is correct.

My previous concern was based on outdated information and is withdrawn. Your CI configuration using Ruby 4.0 in the test matrix and style-check matrix is valid and should work as expected.

Sorry for the confusion, and thank you for double-checking! βœ…


steps:
- uses: actions/checkout@v3
Expand All @@ -42,15 +40,13 @@ jobs:
strategy:
matrix:
ruby-version:
- 3.4
- 4.0
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Install Rubocop
run: gem install rubocop
- name: Check codestyle
run: rubocop
run: bundle exec rubocop
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ Gemfile.lock
.ruby-version
project_files
*.gem
.vscode/
.DS_Store
.claude/
38 changes: 31 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
AllCops:
NewCops: enable
TargetRubyVersion: 3.0
TargetRubyVersion: 3.3
SuggestExtensions: false

Layout/LineLength:
Max: 120
Expand All @@ -10,24 +11,47 @@ Layout/LineLength:
Lint/IneffectiveAccessModifier:
Enabled: false

Style/HashTransformKeys:
Exclude:
- 'lib/uploadcare/entity/decorator/paginator.rb'
- 'lib/uploadcare/client/conversion/video_conversion_client.rb'
- 'lib/uploadcare/entity/file.rb'

Metrics/BlockLength:
Exclude:
- 'bin/'
- 'spec/**/*'
- 'uploadcare-ruby.gemspec'

Metrics/ClassLength:
Max: 100
Exclude:
- 'lib/uploadcare/clients/upload_client.rb' # Complex upload logic with 9 endpoints
- 'lib/uploadcare/resources/file.rb' # Pre-existing file resource with many methods
- 'lib/uploadcare/uploader.rb' # Uploader module with multiple upload strategies

Metrics/ModuleLength:
Max: 100
Exclude:
- 'spec/**/*'
- 'lib/uploadcare/uploader.rb' # Uploader module with multiple upload strategies

Metrics/MethodLength:
Max: 20
Exclude:
- 'lib/uploadcare/clients/upload_client.rb' # Parallel upload requires coordination logic
- 'lib/uploadcare/uploader.rb' # Parallel upload coordination

Metrics/AbcSize:
Max: 17
Exclude:
- 'lib/uploadcare/clients/upload_client.rb' # Upload methods have multiple parameters and validations
- 'lib/uploadcare/uploader.rb' # Parallel upload coordination

Metrics/CyclomaticComplexity:
Max: 7
Exclude:
- 'lib/uploadcare/clients/upload_client.rb' # Upload logic has multiple conditional paths
- 'lib/uploadcare/uploader.rb' # Parallel upload coordination

Metrics/PerceivedComplexity:
Max: 8
Exclude:
- 'lib/uploadcare/clients/upload_client.rb' # Parallel upload coordination is inherently complex

Style/Documentation:
Enabled: false
Expand Down
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,72 @@
# Changelog

## 5.0.0 β€” 2026-01-06

### ⚠️ BREAKING CHANGES
This is a major rewrite with significant architectural changes. Please review the migration guide below.

### Changed - Architecture Overhaul
* **Complete rewrite from entity-based to resource-based architecture**
* Replaced `entity/` classes with simpler `resources/` pattern
* Restructured client layer from `client/` to `clients/` directory
* Removed param builders in favor of integrated client logic
* Changed module structure and namespacing

### Added - New Features
* **Zeitwerk autoloading** for modern Ruby module management
* **Smart upload detection** with automatic method selection based on file size/type
* **Enhanced multipart upload** with parallel processing support
* **Progress tracking** for all upload operations with real-time callbacks
* **Batch upload capabilities** with error handling per file
* **Thread-safe upload operations** with configurable concurrency
* **New exception classes** for better error handling:
* `UploadError`, `UploadTimeoutError`, `MultipartUploadError`, `UnknownStatusError`
* **Comprehensive examples** in `/examples` directory
* **Integration tests** with full end-to-end workflow coverage

### Changed - Ruby Version Support
* **Minimum Ruby version**: Now requires Ruby 3.3+ (compatible with Rails main)
* **Supported versions**: Ruby 3.3, 3.4, and 4.0
* **Removed support**: Ruby 3.0, 3.1, 3.2 (EOL or nearing EOL)

### Fixed
* JSON response parsing in UploadClient
* Thread safety in parallel uploads with proper error aggregation
* Rubocop configuration to match gemspec Ruby version requirement
* Constant name collision between module and class Uploader

### Removed
* Old entity system (`entity/` directory)
* Param builders (`param/` directory)
* Legacy concern system
* Support for Ruby < 3.3

### Migration Guide from v4.x to v5.0

#### Module Changes
```ruby
# Old (v4.x)
Uploadcare::Entity::File
Uploadcare::Client::FileClient

# New (v5.0)
Uploadcare::File
Uploadcare::FileClient
```

#### Upload API Changes
```ruby
# Old (v4.x)
Uploadcare::Uploader.upload_from_url(url)

# New (v5.0) - Smart detection
Uploadcare::Uploader.upload(url) # Automatically detects URL
Uploadcare::Uploader.upload(file) # Automatically uses multipart for large files
```

#### Configuration Changes
Configuration remains largely compatible, but now uses a centralized `Configuration` class with better defaults and validation.

## 4.5.0 β€” 2025-07-25
### Added
* **CDN Subdomain Support**: Added support for automatic subdomain generation to improve CDN performance and caching.
Expand Down
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

source 'https://rubygems.org'

# Ruby 3.4+ compatibility - these gems are no longer in stdlib
gem 'base64'
gem 'bigdecimal'
gem 'cgi' # Required for Ruby 4.0+ compatibility
gem 'mutex_m'

gem 'byebug'
gem 'rake'
gem 'rspec'
Expand Down
Loading