Skip to content

Commit a063bfe

Browse files
committed
Release v5 modernization with Active Storage service and multi-config support
- Align uploadcare-rails with uploadcare-ruby v5 APIs and signatures\n- Add migration guide and update README/changelog for v5 release\n- Introduce ActiveStorage::Service::UploadcareService and specs\n- Add optional per-call config support plus mount/job wiring for multi-config use\n- Update CI matrix and Gemfiles for modern Rails/Ruby targets\n- Point uploadcare-ruby git dependency to branch v2-rewrite-2 for CI resolution
1 parent f42c7f5 commit a063bfe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+810
-357
lines changed

.github/workflows/gem-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313

1414
- name: Release Gem
1515
if: contains(github.ref, 'refs/tags/v')

.github/workflows/test.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,31 @@ on: [push, pull_request]
33
jobs:
44
test:
55
needs: code-analysis
6+
continue-on-error: ${{ matrix.experimental }}
67
strategy:
78
matrix:
8-
gemfile:
9-
- Gemfile
10-
- gemfiles/Gemfile-rails-7-2
11-
- gemfiles/Gemfile-rails-7-1
12-
- gemfiles/Gemfile-rails-7-0
13-
ruby:
14-
- 3.0
15-
- 3.1
16-
- 3.2
17-
- 3.3
9+
include:
10+
- gemfile: Gemfile
11+
ruby: "3.3"
12+
experimental: false
13+
- gemfile: Gemfile
14+
ruby: "3.4"
15+
experimental: false
16+
- gemfile: gemfiles/Gemfile-rails-8-0
17+
ruby: "3.4"
18+
experimental: false
19+
- gemfile: gemfiles/Gemfile-rails-7-2
20+
ruby: "3.4"
21+
experimental: false
22+
- gemfile: gemfiles/Gemfile-rails-7-1
23+
ruby: "3.3"
24+
experimental: false
25+
- gemfile: gemfiles/Gemfile-rails-7-0
26+
ruby: "3.3"
27+
experimental: false
28+
- gemfile: gemfiles/Gemfile-rails-main
29+
ruby: "3.4"
30+
experimental: true
1831
runs-on: ubuntu-latest
1932
env:
2033
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
@@ -33,7 +46,7 @@ jobs:
3346
strategy:
3447
matrix:
3548
ruby-version:
36-
- 3.3
49+
- "3.4"
3750
steps:
3851
- uses: actions/checkout@v4
3952
- name: Set up Ruby

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.
44
The format is based now on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## 5.0.0 — 2026-02-21
8+
9+
### Breaking Changes
10+
11+
* Align wrapper APIs with `uploadcare-ruby` 5.x classes and method signatures.
12+
* Raise minimum Ruby version to `3.3+`.
13+
* Change wrapper return contracts to use native SDK objects/results instead of legacy hash/monad expectations.
14+
* Update configuration bridge from `Uploadcare.config` to `Uploadcare.configuration`.
15+
16+
### Changed
17+
18+
* Modernized REST/Upload API wrappers to use v5 keyword argument signatures.
19+
* Updated Add-Ons method wiring to v5 method names and request argument format.
20+
* Updated object wrappers (`Uploadcare::Rails::File`, `Uploadcare::Rails::Group`) for v5 resource base classes.
21+
* Updated specs to assert v5-native behavior.
22+
* Added optional per-call `config:` support across API wrappers for multi-config usage in one process.
23+
* Added initial `ActiveStorage::Service::UploadcareService` adapter.
24+
725
## 3.4.4 — 2024-11-07
826

927
### Added

Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ source 'https://rubygems.org'
55
# Specify your gem's dependencies in uploadcare-rails.gemspec
66
gemspec
77

8+
local_uploadcare_ruby = File.expand_path('../uploadcare-ruby', __dir__)
9+
if File.directory?(local_uploadcare_ruby)
10+
gem 'uploadcare-ruby', path: local_uploadcare_ruby
11+
else
12+
gem 'uploadcare-ruby', github: 'uploadcare/uploadcare-ruby', branch: 'v2-rewrite-2'
13+
end
14+
815
gem 'http-parser', '~> 1.2', '>= 1.2.3'
916
gem 'rake', '~> 13.0.6'
1017

MIGRATING_V5.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Migrating to uploadcare-rails 5.0
2+
3+
This guide covers migration from `uploadcare-rails` 3.x/4.x to 5.0.
4+
5+
`uploadcare-rails` 5.0 is aligned with the rewritten `uploadcare-ruby` 5.x API.
6+
7+
## Breaking changes
8+
9+
### Ruby version
10+
11+
- Minimum supported Ruby is now `3.3+`.
12+
13+
### Dependency baseline
14+
15+
- `uploadcare-ruby` 5.x is now required.
16+
17+
### Configuration bridge
18+
19+
The Rails wrapper now writes credentials to `Uploadcare.configuration` (v5 API), not `Uploadcare.config`.
20+
21+
```ruby
22+
# v4 style (old)
23+
Uploadcare.config.public_key
24+
25+
# v5 style (new)
26+
Uploadcare.configuration.public_key
27+
```
28+
29+
### REST wrapper return types are now native SDK objects
30+
31+
Methods in `Uploadcare::*Api` wrappers now return `uploadcare-ruby` v5 objects/results directly.
32+
33+
- `Uploadcare::FileApi.get_files` -> `Uploadcare::PaginatedCollection`
34+
- `Uploadcare::FileApi.get_file` -> `Uploadcare::File`
35+
- `Uploadcare::FileApi.store_file` -> `Uploadcare::File`
36+
- `Uploadcare::FileApi.delete_file` -> `Uploadcare::File`
37+
- `Uploadcare::FileApi.store_files` -> `Uploadcare::BatchFileResult`
38+
- `Uploadcare::FileApi.delete_files` -> `Uploadcare::BatchFileResult`
39+
- `Uploadcare::GroupApi.get_groups` -> `Uploadcare::PaginatedCollection`
40+
- `Uploadcare::GroupApi.get_group` -> `Uploadcare::Group`
41+
- `Uploadcare::GroupApi.store_group` -> `Uploadcare::Group`
42+
- `Uploadcare::GroupApi.create_group` -> `Uploadcare::Group`
43+
- `Uploadcare::ProjectApi.get_project` -> `Uploadcare::Project`
44+
- `Uploadcare::WebhookApi.get_webhooks` -> `Array<Uploadcare::Webhook>`
45+
- `Uploadcare::WebhookApi.create_webhook` -> `Uploadcare::Webhook`
46+
- `Uploadcare::WebhookApi.update_webhook` -> `Uploadcare::Webhook`
47+
48+
`Uploadcare::WebhookApi.delete_webhook` returns the direct SDK response payload.
49+
50+
### Conversion API return contract
51+
52+
`Uploadcare::ConversionApi` no longer uses `dry-monads` style `Success(...)`/`Failure(...)` wrappers.
53+
It now returns direct v5 SDK values:
54+
55+
- `convert_video` -> `Uploadcare::VideoConverter`
56+
- `get_video_conversion_status` -> `Uploadcare::VideoConverter`
57+
- `convert_document` -> `Hash`
58+
- `get_document_conversion_status` -> `Uploadcare::DocumentConverter`
59+
- `get_document_conversion_formats_info` -> `Uploadcare::DocumentConverter`
60+
61+
## Migration checklist
62+
63+
1. Upgrade Ruby to `3.3+`.
64+
2. Upgrade to `uploadcare-rails` 5.x.
65+
3. Replace any `Uploadcare.config` usage with `Uploadcare.configuration`.
66+
4. Update integrations that expected Hash/monad responses from wrapper APIs.
67+
5. Run your full application and test suite.
68+

0 commit comments

Comments
 (0)