Skip to content

Prepare 5.0.0 release#159

Merged
vipulnsward merged 43 commits into
mainfrom
5-0-stable
May 18, 2026
Merged

Prepare 5.0.0 release#159
vipulnsward merged 43 commits into
mainfrom
5-0-stable

Conversation

@vipulnsward

@vipulnsward vipulnsward commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • promote the release branch from 5.0.0.rc1 to 5.0.0
  • align the gemspec and development Gemfile with released uploadcare-ruby 5.0.0
  • add/update changelog, migration guide, release notes, upgrade examples, and release checklist
  • harden the RubyGems publish workflow for tag-based releases
  • fix release blockers and CodeRabbit actionables: advisory Ruby 4 CI, uploader config serialization, public_key to pubkey, RubyGems secret guard, range headers, client resolution, UUID preconditions, and group URL normalization

Validation

  • RubyGems lists uploadcare-ruby 5.0.0
  • RubyGems does not list uploadcare-rails 5.0.0 yet
  • no v5.0.0 git tag exists yet; only v5.0.0.rc1
  • bundle check - dependencies satisfied
  • bundle exec rake - 190 examples, 0 failures
  • bundle exec rubocop - no offenses
  • workflow YAML parse for .github/workflows/*.yml
  • git diff --check
  • bundle exec rake build produced pkg/uploadcare-rails-5.0.0.gem
  • gem artifact metadata: version 5.0.0, Ruby >= 3.3.0, rails >= 7.2, uploadcare-ruby >= 5.0.0, MFA required, 42 files
  • artifact SHA256: a3351f6170989f90c5dc7c7788fd5e528745e588101af42140439e81ecb4b0d4
  • gbrain code-check against origin/main - PASS 8/10, no important issues remaining
  • GitHub Actions Test matrix succeeded; CodeRabbit succeeded; Snyk succeeded

Release gate

uploadcare-ruby 5.0.0 is published and the PR is green. Ruby 4 remains advisory until ecosystem support is stable.

Before tagging uploadcare-rails v5.0.0, smoke-test one 4.x to 5.0 migration using MIGRATING_V5.md, then merge to main, tag v5.0.0 from main, and let the Publish Gem workflow publish the gem.

… 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
- Remove old gemfiles for Rails 7.0, 7.1, and main\n- Add gemfiles/Gemfile-rails-8-1\n- Set CI matrix to run only 7.2, 8.0, 8.1 across Ruby 3.3/3.4/4.0\n- Relax batch file API expectations to support v2-rewrite-2 response shape in matrix runs
Integrate Uploadcare-backed ActiveStorage behavior into the gem so apps can use standard Rails APIs (preview and variant) without custom helpers.

- auto-register Uploadcare PDF previewer in engine initialization
- prepend remote variant processing for Uploadcare service blobs
- map Rails-style resize_to_limit/resize_to_fill to Uploadcare transformations
- add integration, previewer, and variant processing specs
- document ActiveStorage integration usage in README
Center the gem on explicit Uploadcare::Client instances instead of the
old wrapper API layer (FileApi, GroupApi, UploadApi, etc.). This is the
architectural change needed to align with uploadcare-ruby gem-rewrite-3.

Key changes:

- Add Uploadcare::Rails.client as the central client resolver with
  support for default global client and per-call overrides
- Remove all 10 wrapper API files (FileApi, GroupApi, ProjectApi,
  WebhookApi, ConversionApi, FileMetadataApi, AddonsApi, UploadApi,
  and their base classes)
- Rewrite File and Group as standalone decorators instead of SDK
  resource subclasses, each carrying client context
- Rename mount macros to has_uploadcare_file / has_uploadcare_files
  with uploadcare_client: option (old names kept as aliases)
- Fix multi-account bugs: mounts, jobs, Active Storage previewer,
  and variant processing all resolve and carry client context
- Active Storage service now owns @client, previewer and variant
  processing access it via blob.service.client
- Jobs reconstruct client from serialized config.to_h
- Replace do_not_store with store_files_after_save
- Point all Gemfiles to gem-rewrite-3 branch, remove local path fallback
- Strip configuration to Rails-only concerns
- Add f.uploadcare_file_field with uploadcare_file as alias
1. Group store now actually persists files: fetches the group to get
   file UUIDs, then calls client.files.batch_store. Previously it only
   called client.groups.find which is read-only. Fixed in the Group
   wrapper, both mount callbacks (AR + Mongoid), and StoreGroupJob.

2. Group delete restored: delegates to the SDK resource's delete method
   via client.groups.find(group_id:).delete.

3. File and Group initialization now uses attributes.key? instead of
   truthiness check, so false-valued booleans (is_image: false,
   is_ready: false) are preserved instead of silently dropped as nil.

Specs updated to assert actual batch_store calls and boolean preservation.
@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown

Walkthrough

Major v5 refactor: CI/docs and gemspec updates; YAML/credentials-backed configuration and client factory; new ActionView uploader helpers and internal tag builders; Uploadcare ActiveStorage service with preview/variant support; new attachment wrappers, model macros, hooks, and jobs; legacy REST wrapper removal; extensive tests updated/added.

Changes

Rails v5 client-first refactor and integrations

Layer / File(s) Summary
Release workflows, packaging, and docs
.github/workflows/*, CHANGELOG.md, docs/*, README.md, MIGRATING_V5.md, uploadcare-rails.gemspec, .gitignore, .rubocop.yml, Gemfile, gemfiles/*
Adds manual gem publish flow, validates gem version vs tag, updates test CI matrix, bumps Ruby target, updates changelog/README/release notes/migration guide, and pins uploadcare-ruby dependency.
Core configuration & engine
lib/uploadcare-rails.rb, lib/uploadcare/rails.rb, lib/uploadcare/rails/configuration.rb, lib/uploadcare/rails/engine.rb, lib/uploadcare/rails/version.rb, generator templates, and related specs
Refactors configuration to YAML/credentials-backed Uploadcare::Rails::Configuration, adds client factory/caching (Uploadcare::Rails.client), engine initializers to load config/uploadcare.yml and credentials, and bumps gem version to 5.0.0.
ActionView helpers and uploader tags
lib/uploadcare/rails/action_view/*, lib/uploadcare/rails/internal/uploader_field_helpers.rb, lib/generators/*, spec/uploadcare/rails/action_view/*
Adds uploadcare_file_field/uploadcare_files_field form-builder helpers, internal uploader tag builders, validation for include/stylesheet helpers, updates importmap generator messaging, and removes legacy uploader_tags/form_builder modules; tests updated.
Active Storage service & integration
lib/active_storage/service/uploadcare_service.rb, lib/uploadcare/rails/active_storage/*, lib/uploadcare/rails/internal/*storage*, spec/uploadcare/rails/active_storage/*
Implements ActiveStorage::Service::UploadcareService, previewer, and remote variant processing, with trusted-host, redirect, timeout, integrity, and UUID mapping helpers; extensive specs validate flows and error cases.
Model macros, attachments, hooks, and jobs
lib/uploadcare/rails/attached_*.rb, lib/uploadcare/rails/internal/model_macros.rb, lib/uploadcare/rails/internal/active_record_hooks.rb, lib/uploadcare/rails/internal/mongoid_hooks.rb, lib/uploadcare/rails/internal/attachment_loading.rb, lib/uploadcare/rails/jobs/*, spec/.../internal/*, spec/.../attached_*, spec/.../jobs/*
Adds has_uploadcare_file / has_uploadcare_files macros, AttachedFile/AttachedFiles wrappers with caching and transform helpers, AR/Mongoid hook registration, job retry/queue configs, and tests covering sync/async and client resolution logic.
Internal helpers and HTTP utilities
lib/uploadcare/rails/internal/{client_resolver,id_extractor,files_count_extractor,remote_http_fetching,trusted_uploadcare_hosts,active_storage_uuid_mapping,active_storage_service_helpers,uploader_field_helpers,..}
New internal modules for client resolution, UUID extraction, files-count parsing, trusted-host validation, HTTP fetch with redirects/timeouts, ActiveStorage UUID mapping, attachment-loading helpers, and uploader field option processing; covered by unit/spec tests.
Legacy REST wrapper & API removals
lib/uploadcare/rails/api/rest/*, lib/uploadcare/rails/api/upload/*, removed specs
Removes the old Rails REST wrapper classes (FileApi, GroupApi, ProjectApi, WebhookApi, ConversionApi, AddonsApi, UploadApi, and Api::Rest::Base) and corresponding tests in favor of direct SDK client usage.
Generators & templates
lib/generators/templates/*, lib/generators/*, spec/generators/*
Generator now emits config/uploadcare.yml from ERB YAML template and updates post-install instructions and generator specs.
Tests & spec harness updates
spec/*
Adds many new specs for Active Storage, previewer, variant processing, attachment wrappers, internal helpers, and updates/removes many legacy API specs to reflect rewritten public surface.
sequenceDiagram
  participant Variant as ActiveStorage::Variant
  participant Service as ActiveStorage::Service::UploadcareService
  participant CDN as Uploadcare CDN
  Variant->>Service: process -> build source URL (uuid)
  Service->>CDN: GET transformed image URL
  CDN-->>Service: HTTP response (image bytes)
  Service->>Variant: upload(bytes) -> store variant in ActiveStorage
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 5-0-stable

@vipulnsward vipulnsward marked this pull request as ready for review May 18, 2026 12:33

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (6)
spec/uploadcare/rails/action_view/uploadcare_include_tags_spec.rb (1)

106-110: ⚡ Quick win

Add a negative test for invalid version in uploadcare_stylesheet_tag.

You already assert invalid solution; mirroring invalid version coverage will lock down the new version validator path too.

Suggested spec addition
   it 'rejects unsupported stylesheet solutions' do
     expect do
       uploadcare_stylesheet_tag(solution: 'evil')
     end.to raise_error(ArgumentError, /solution/)
   end
+
+  it 'rejects unsupported stylesheet versions' do
+    expect do
+      uploadcare_stylesheet_tag(version: '../evil')
+    end.to raise_error(ArgumentError, /version/)
+  end
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@spec/uploadcare/rails/action_view/uploadcare_include_tags_spec.rb` around
lines 106 - 110, Add a negative test mirroring the existing invalid-solution
spec to assert uploadcare_stylesheet_tag rejects invalid versions: create an
example in the same spec that calls uploadcare_stylesheet_tag(version: 'bad')
(or other clearly invalid value) inside an expect { ... }.to
raise_error(ArgumentError, /version/), referencing the uploadcare_stylesheet_tag
helper to exercise the version validation path.
spec/uploadcare/rails/jobs/store_file_job_spec.rb (1)

26-33: ⚡ Quick win

Remove duplicate test.

This test is identical to lines 17-24. The only difference is "default client" vs "the default client" in the description. Duplicate tests add maintenance burden without improving coverage.

♻️ Proposed fix to remove the duplicate
-    it 'stores a file using the default client' do
-      files_accessor = double
-      client = double(files: files_accessor)
-      allow(Uploadcare::Rails).to receive(:client).and_return(client)
-      expect(files_accessor).to receive(:batch_store).with(uuids: [ 'file-uuid' ])
-
-      described_class.new.perform('file-uuid')
-    end
-
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@spec/uploadcare/rails/jobs/store_file_job_spec.rb` around lines 26 - 33, The
spec contains a duplicate example of the same behavior: remove the redundant
"stores a file using the default client" test (the second identical example
testing described_class.new.perform('file-uuid') and expecting
files_accessor.batch_store with uuids: ['file-uuid']) so only one test remains;
locate the example that stubs Uploadcare::Rails.client and uses files_accessor
and delete that duplicate block to avoid redundant specs.
spec/uploadcare/rails/jobs/store_group_job_spec.rb (1)

29-39: ⚡ Quick win

Remove duplicate test.

This test is redundant with lines 17-27. Both verify that the job fetches a group and batch-stores its files using the default client. The variation in file count (1 vs 2 files) doesn't add meaningful coverage since the file extraction logic is already tested separately in lines 41-52.

♻️ Proposed fix to remove the duplicate
-    it 'fetches group and batch-stores using the default client' do
-      group_resource = double(files: [ { 'uuid' => 'f1' } ])
-      groups_accessor = double
-      files_accessor = double
-      client = double(groups: groups_accessor, files: files_accessor)
-      allow(Uploadcare::Rails).to receive(:client).and_return(client)
-      allow(groups_accessor).to receive(:find).with(group_id: 'group-id').and_return(group_resource)
-      expect(files_accessor).to receive(:batch_store).with(uuids: %w[f1])
-
-      described_class.new.perform('group-id')
-    end
-
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@spec/uploadcare/rails/jobs/store_group_job_spec.rb` around lines 29 - 39,
Remove the redundant example block that duplicates the earlier test: delete the
"it 'fetches group and batch-stores using the default client'" example (the one
that sets group_resource = double(files: [ { 'uuid' => 'f1' } ]) and stubs
Uploadcare::Rails.client, groups_accessor.find, and expects
files_accessor.batch_store) since the earlier example already verifies
described_class.new.perform('group-id') calls files_accessor.batch_store; keep
the original test and ensure groups_accessor, files_accessor, and the perform
invocation remain covered by the existing spec.
spec/uploadcare/rails/jobs/delete_file_job_spec.rb (1)

26-33: ⚡ Quick win

Remove duplicate test.

This test is identical to lines 17-24. The only difference is "default client" vs "the default client" in the description. Duplicate tests add maintenance burden without improving coverage.

♻️ Proposed fix to remove the duplicate
-    it 'deletes a file using the default client' do
-      files_accessor = double
-      client = double(files: files_accessor)
-      allow(Uploadcare::Rails).to receive(:client).and_return(client)
-      expect(files_accessor).to receive(:batch_delete).with(uuids: [ 'file-uuid' ])
-
-      described_class.new.perform('file-uuid')
-    end
-
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@spec/uploadcare/rails/jobs/delete_file_job_spec.rb` around lines 26 - 33,
Remove the duplicate RSpec example that tests deletion via the default client:
delete the "it 'deletes a file using the default client' do" block that sets up
files_accessor and client doubles, stubs Uploadcare::Rails.client, expects
files_accessor to receive(:batch_delete).with(uuids: ['file-uuid']), and calls
described_class.new.perform('file-uuid'); the earlier identical example (the one
testing deletion with the default client, using the same doubles, expectation,
and described_class.new.perform invocation) should remain and this redundant
block should be removed.
lib/uploadcare/rails/internal/id_extractor.rb (2)

10-14: ⚡ Quick win

Inconsistent nil vs empty string return behavior.

The method returns nil when input is not present (line 11), but returns an empty string "" when input is present but no UUID is matched (line 13, since nil.to_s returns ""). This inconsistency may confuse callers who expect uniform nil-checking or truthiness checks.

🔄 Suggested fix for consistent nil returns
 def call(input_str, regex = UUID_REGEX)
   return unless input_str.present?

-  input_str.match(regex).to_s
+  input_str.match(regex)&.to_s
 end

This returns nil when no match is found, making the behavior consistent with the early return.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/uploadcare/rails/internal/id_extractor.rb` around lines 10 - 14, The
method call currently returns nil when input_str is blank but returns an empty
string when a regex match is absent (because match.to_s yields ""), causing
inconsistent nil/empty behavior; update the implementation in the call method
(which uses UUID_REGEX) to explicitly return nil when no match is found (e.g.,
capture the result of input_str.match(regex) and return nil if it's nil,
otherwise return the matched string) so callers get consistent nil for "no
UUID".

7-7: 💤 Low value

Simplify UUID regex by removing redundant word boundaries.

The regex includes \b after the first group ([0-9a-f]{8}\b-) and before the last group (-\b[0-9a-f]{12}). Since hyphens are non-word characters and hex digits are word characters, these boundaries are always present and the explicit \b checks are redundant.

♻️ Simplified regex
-      UUID_REGEX = /\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b/
+      UUID_REGEX = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i

The simplified pattern is more standard and easier to understand while maintaining the same matching behavior. (This also incorporates the case-insensitive flag from the previous comment.)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/uploadcare/rails/internal/id_extractor.rb` at line 7, The UUID_REGEX
contains redundant \b word-boundary anchors around hyphens; remove the \b
occurrences and make the pattern case-insensitive so it remains correct and
simpler. Update the UUID_REGEX constant (UUID_REGEX) to use a standard UUID
pattern without the internal \b anchors and add the /i flag to match uppercase
hex as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/gem-push.yml:
- Around line 45-51: The Configure RubyGems credentials step currently writes
~/.gem/credentials even if RUBYGEMS_API_KEY is empty; add an explicit non-empty
check for the RUBYGEMS_API_KEY environment variable at the start of that step
(e.g., test -n "$RUBYGEMS_API_KEY") and fail fast with an error message and
non-zero exit if it is missing, before creating the ~/.gem directory or writing
the credentials file so the workflow aborts with a clear message instead of
producing an opaque push failure.

In `@CHANGELOG.md`:
- Around line 17-18: Update the two markdown links that currently point to the
5-0-stable branch so they use a stable release tag or main; replace the
repository URLs referencing MIGRATING_V5.md and docs/release-notes-5.0.0.md that
include "blob/5-0-stable/..." with a permalink such as "blob/v5.0.0/..." (or
"blob/main/...") so the migration guide and release-notes links remain stable
after branch cleanup.

In `@lib/uploadcare/rails/attached_file.rb`:
- Around line 36-46: Add explicit precondition checks that raise a clear error
when uuid is blank before making any API calls: in the instance methods store
and delete, and in any code paths that construct an Uploadcare::Resources::File
or call resolve_client.files (the API load paths around the other file-loading
code at ~79-82), validate that uuid.present? (or !uuid.to_s.empty?) and raise a
descriptive ArgumentError (eg. "uuid must be present") so failures are fast and
clear; update the methods store, delete, and the file-loading helper to perform
this check at the top before constructing resources or calling resolve_client.

In `@lib/uploadcare/rails/attached_files.rb`:
- Around line 44-47: The group URL base may be blank or missing a trailing slash
which leads to malformed per-file URLs; update the URL normalization used by
file_urls (and the similar block around lines 98-100) so that map_file_urls /
group_file_url always operate on a normalized base: ensure cdn_url (or the
derived group base) is set to a non-empty string and ends with a single "/"
before concatenating per-file paths (or use a URL-joining helper) so generated
per-file URLs never collapse segments when cdn_url is blank or lacks a trailing
slash.

In `@lib/uploadcare/rails/internal/active_storage_service_helpers.rb`:
- Around line 58-61: The Range header generation in build_request incorrectly
uses range.end directly for exclusive ranges; update build_request
(Net::HTTP::Get creation) to detect exclusive ranges (range.exclude_end?) and
subtract 1 from range.end when exclusive so the HTTP Range uses inclusive
endpoints (e.g., end_pos = range.end - 1 if range.exclude_end? else range.end),
then set request["Range"] = "bytes=#{range.begin}-#{end_pos]" only when range is
present, ensuring end_pos stays >= range.begin.

In `@lib/uploadcare/rails/internal/client_resolver.rb`:
- Around line 8-15: The branch that handles client_or_options currently falls
through to the default client for unsupported types; instead, change the else
branch to raise a clear ArgumentError (or TypeError) when client_or_options is
not an Uploadcare::Client or Hash so callers can't silently operate against the
wrong account — update the case in client_resolver (the code handling
client_or_options, Uploadcare::Client, and the
client(**client_or_options.symbolize_keys) call) to raise an error with a
descriptive message including the actual class of client_or_options rather than
returning client.

In `@lib/uploadcare/rails/internal/uploader_field_helpers.rb`:
- Around line 163-165: The method uploadcare_file_group_attribute? should prefer
the actual bound object's class over constantizing object_name to avoid picking
the wrong model; change the model resolution to use object&.class first and fall
back to object_name.to_s.camelize.safe_constantize if object is nil, then
proceed with the existing has_uploadcare_files_for_*? detection logic using
method_name.

---

Nitpick comments:
In `@lib/uploadcare/rails/internal/id_extractor.rb`:
- Around line 10-14: The method call currently returns nil when input_str is
blank but returns an empty string when a regex match is absent (because
match.to_s yields ""), causing inconsistent nil/empty behavior; update the
implementation in the call method (which uses UUID_REGEX) to explicitly return
nil when no match is found (e.g., capture the result of input_str.match(regex)
and return nil if it's nil, otherwise return the matched string) so callers get
consistent nil for "no UUID".
- Line 7: The UUID_REGEX contains redundant \b word-boundary anchors around
hyphens; remove the \b occurrences and make the pattern case-insensitive so it
remains correct and simpler. Update the UUID_REGEX constant (UUID_REGEX) to use
a standard UUID pattern without the internal \b anchors and add the /i flag to
match uppercase hex as well.

In `@spec/uploadcare/rails/action_view/uploadcare_include_tags_spec.rb`:
- Around line 106-110: Add a negative test mirroring the existing
invalid-solution spec to assert uploadcare_stylesheet_tag rejects invalid
versions: create an example in the same spec that calls
uploadcare_stylesheet_tag(version: 'bad') (or other clearly invalid value)
inside an expect { ... }.to raise_error(ArgumentError, /version/), referencing
the uploadcare_stylesheet_tag helper to exercise the version validation path.

In `@spec/uploadcare/rails/jobs/delete_file_job_spec.rb`:
- Around line 26-33: Remove the duplicate RSpec example that tests deletion via
the default client: delete the "it 'deletes a file using the default client' do"
block that sets up files_accessor and client doubles, stubs
Uploadcare::Rails.client, expects files_accessor to
receive(:batch_delete).with(uuids: ['file-uuid']), and calls
described_class.new.perform('file-uuid'); the earlier identical example (the one
testing deletion with the default client, using the same doubles, expectation,
and described_class.new.perform invocation) should remain and this redundant
block should be removed.

In `@spec/uploadcare/rails/jobs/store_file_job_spec.rb`:
- Around line 26-33: The spec contains a duplicate example of the same behavior:
remove the redundant "stores a file using the default client" test (the second
identical example testing described_class.new.perform('file-uuid') and expecting
files_accessor.batch_store with uuids: ['file-uuid']) so only one test remains;
locate the example that stubs Uploadcare::Rails.client and uses files_accessor
and delete that duplicate block to avoid redundant specs.

In `@spec/uploadcare/rails/jobs/store_group_job_spec.rb`:
- Around line 29-39: Remove the redundant example block that duplicates the
earlier test: delete the "it 'fetches group and batch-stores using the default
client'" example (the one that sets group_resource = double(files: [ { 'uuid' =>
'f1' } ]) and stubs Uploadcare::Rails.client, groups_accessor.find, and expects
files_accessor.batch_store) since the earlier example already verifies
described_class.new.perform('group-id') calls files_accessor.batch_store; keep
the original test and ensure groups_accessor, files_accessor, and the perform
invocation remain covered by the existing spec.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74100b6f-9c4a-4fe3-8983-f83d8d95dfa8

📥 Commits

Reviewing files that changed from the base of the PR and between dd51c06 and e87f096.

📒 Files selected for processing (107)
  • .github/workflows/gem-push.yml
  • .github/workflows/test.yml
  • .gitignore
  • .rubocop.yml
  • CHANGELOG.md
  • Gemfile
  • MIGRATING_V5.md
  • README.md
  • docs/release-notes-5.0.0.md
  • gemfiles/Gemfile-rails-7-2
  • gemfiles/Gemfile-rails-8-0
  • gemfiles/Gemfile-rails-8-1
  • lib/active_storage/service/uploadcare_service.rb
  • lib/generators/templates/uploadcare_config.yml.erb
  • lib/generators/templates/uploadcare_config_template.erb
  • lib/generators/uploadcare_config_generator.rb
  • lib/generators/uploadcare_importmap_generator.rb
  • lib/uploadcare-rails.rb
  • lib/uploadcare/errors/type_error.rb
  • lib/uploadcare/rails.rb
  • lib/uploadcare/rails/action_view/form_builder.rb
  • lib/uploadcare/rails/action_view/uploadcare_form_builder.rb
  • lib/uploadcare/rails/action_view/uploadcare_include_tags.rb
  • lib/uploadcare/rails/action_view/uploadcare_uploader_tags.rb
  • lib/uploadcare/rails/active_record/mount_uploadcare_file.rb
  • lib/uploadcare/rails/active_record/mount_uploadcare_file_group.rb
  • lib/uploadcare/rails/active_storage/integration.rb
  • lib/uploadcare/rails/active_storage/uploadcare_previewer.rb
  • lib/uploadcare/rails/active_storage/variant_remote_processing.rb
  • lib/uploadcare/rails/api/rest/addons_api.rb
  • lib/uploadcare/rails/api/rest/base.rb
  • lib/uploadcare/rails/api/rest/conversion_api.rb
  • lib/uploadcare/rails/api/rest/file_api.rb
  • lib/uploadcare/rails/api/rest/file_metadata_api.rb
  • lib/uploadcare/rails/api/rest/group_api.rb
  • lib/uploadcare/rails/api/rest/project_api.rb
  • lib/uploadcare/rails/api/rest/webhook_api.rb
  • lib/uploadcare/rails/api/upload/base.rb
  • lib/uploadcare/rails/api/upload/upload_api.rb
  • lib/uploadcare/rails/attached_file.rb
  • lib/uploadcare/rails/attached_files.rb
  • lib/uploadcare/rails/configuration.rb
  • lib/uploadcare/rails/engine.rb
  • lib/uploadcare/rails/internal/active_record_hooks.rb
  • lib/uploadcare/rails/internal/active_storage_service_helpers.rb
  • lib/uploadcare/rails/internal/active_storage_uuid_mapping.rb
  • lib/uploadcare/rails/internal/attachment_loading.rb
  • lib/uploadcare/rails/internal/client_resolver.rb
  • lib/uploadcare/rails/internal/file_uuid_extraction.rb
  • lib/uploadcare/rails/internal/files_count_extractor.rb
  • lib/uploadcare/rails/internal/id_extractor.rb
  • lib/uploadcare/rails/internal/image_transformations.rb
  • lib/uploadcare/rails/internal/model_macros.rb
  • lib/uploadcare/rails/internal/mongoid_hooks.rb
  • lib/uploadcare/rails/internal/remote_http_fetching.rb
  • lib/uploadcare/rails/internal/trusted_uploadcare_hosts.rb
  • lib/uploadcare/rails/internal/uploader_field_helpers.rb
  • lib/uploadcare/rails/jobs/delete_file_job.rb
  • lib/uploadcare/rails/jobs/store_file_job.rb
  • lib/uploadcare/rails/jobs/store_group_job.rb
  • lib/uploadcare/rails/mongoid/mount_uploadcare_file.rb
  • lib/uploadcare/rails/mongoid/mount_uploadcare_file_group.rb
  • lib/uploadcare/rails/objects/concerns/loadable.rb
  • lib/uploadcare/rails/objects/file.rb
  • lib/uploadcare/rails/objects/group.rb
  • lib/uploadcare/rails/services/files_count_extractor.rb
  • lib/uploadcare/rails/services/id_extractor.rb
  • lib/uploadcare/rails/version.rb
  • spec/generators/uploadcare_config_generator_spec.rb
  • spec/spec_helper.rb
  • spec/support/stub_config_keys.rb
  • spec/uploadcare/rails/action_view/uploadcare_form_builder_spec.rb
  • spec/uploadcare/rails/action_view/uploadcare_include_tags_spec.rb
  • spec/uploadcare/rails/action_view/uploadcare_uploader_tags_spec.rb
  • spec/uploadcare/rails/active_record/mount_uploadcare_file_spec.rb
  • spec/uploadcare/rails/active_storage/integration_spec.rb
  • spec/uploadcare/rails/active_storage/uploadcare_previewer_spec.rb
  • spec/uploadcare/rails/active_storage/uploadcare_service_spec.rb
  • spec/uploadcare/rails/active_storage/variant_remote_processing_spec.rb
  • spec/uploadcare/rails/api/rest/addons_api_spec.rb
  • spec/uploadcare/rails/api/rest/conversion_api_spec.rb
  • spec/uploadcare/rails/api/rest/file_api_spec.rb
  • spec/uploadcare/rails/api/rest/group_api_spec.rb
  • spec/uploadcare/rails/api/rest/project_api_spec.rb
  • spec/uploadcare/rails/api/rest/webhook_api_spec.rb
  • spec/uploadcare/rails/api/upload/upload_api_spec.rb
  • spec/uploadcare/rails/attached_file_spec.rb
  • spec/uploadcare/rails/attached_files_spec.rb
  • spec/uploadcare/rails/configuration_spec.rb
  • spec/uploadcare/rails/internal/active_record_group_macros_spec.rb
  • spec/uploadcare/rails/internal/active_record_hooks_spec.rb
  • spec/uploadcare/rails/internal/attachment_loading_spec.rb
  • spec/uploadcare/rails/internal/mongoid_hooks_spec.rb
  • spec/uploadcare/rails/internal/uploader_field_helpers_spec.rb
  • spec/uploadcare/rails/jobs/delete_file_job_spec.rb
  • spec/uploadcare/rails/jobs/store_file_job_spec.rb
  • spec/uploadcare/rails/jobs/store_group_job_spec.rb
  • spec/uploadcare/rails/mongoid/mount_uploadcare_file_group_spec.rb
  • spec/uploadcare/rails/mongoid/mount_uploadcare_file_spec.rb
  • spec/uploadcare/rails/objects/file_spec.rb
  • spec/uploadcare/rails/objects/group_spec.rb
  • spec/uploadcare/rails/services/id_extractor_spec.rb
  • spec/uploadcare/rails/transformations/image_transformations_spec.rb
  • spec/uploadcare/rails_spec.rb
  • uploadcare-rails.gemspec
  • v2.x-migrations-guide.md
  • v4.x-migrations-guide.md
💤 Files with no reviewable changes (39)
  • spec/uploadcare/rails/api/rest/addons_api_spec.rb
  • spec/uploadcare/rails/api/rest/project_api_spec.rb
  • spec/uploadcare/rails/api/rest/file_api_spec.rb
  • v2.x-migrations-guide.md
  • lib/generators/templates/uploadcare_config_template.erb
  • spec/uploadcare/rails/objects/file_spec.rb
  • spec/uploadcare/rails/mongoid/mount_uploadcare_file_spec.rb
  • spec/uploadcare/rails/api/rest/webhook_api_spec.rb
  • lib/uploadcare/rails/api/rest/conversion_api.rb
  • lib/uploadcare/rails/api/rest/group_api.rb
  • lib/uploadcare/rails/objects/concerns/loadable.rb
  • lib/uploadcare/errors/type_error.rb
  • spec/uploadcare/rails/api/upload/upload_api_spec.rb
  • lib/uploadcare/rails/objects/group.rb
  • lib/uploadcare/rails/api/rest/webhook_api.rb
  • lib/uploadcare/rails/services/id_extractor.rb
  • lib/uploadcare/rails/api/upload/base.rb
  • lib/uploadcare/rails/mongoid/mount_uploadcare_file.rb
  • spec/uploadcare/rails/api/rest/group_api_spec.rb
  • lib/uploadcare/rails/api/rest/project_api.rb
  • spec/spec_helper.rb
  • lib/uploadcare/rails/api/rest/file_metadata_api.rb
  • lib/uploadcare/rails/services/files_count_extractor.rb
  • lib/uploadcare/rails/api/rest/addons_api.rb
  • spec/uploadcare/rails/action_view/uploadcare_uploader_tags_spec.rb
  • lib/uploadcare/rails/action_view/uploadcare_form_builder.rb
  • spec/uploadcare/rails/objects/group_spec.rb
  • lib/uploadcare/rails/api/upload/upload_api.rb
  • lib/uploadcare/rails/api/rest/base.rb
  • lib/uploadcare/rails/mongoid/mount_uploadcare_file_group.rb
  • lib/uploadcare/rails/active_record/mount_uploadcare_file.rb
  • spec/uploadcare/rails/api/rest/conversion_api_spec.rb
  • spec/uploadcare/rails/mongoid/mount_uploadcare_file_group_spec.rb
  • lib/uploadcare/rails/action_view/uploadcare_uploader_tags.rb
  • spec/uploadcare/rails/active_record/mount_uploadcare_file_spec.rb
  • v4.x-migrations-guide.md
  • lib/uploadcare/rails/api/rest/file_api.rb
  • lib/uploadcare/rails/active_record/mount_uploadcare_file_group.rb
  • lib/uploadcare/rails/objects/file.rb

Comment thread .github/workflows/gem-push.yml
Comment thread CHANGELOG.md Outdated
Comment thread lib/uploadcare/rails/attached_file.rb
Comment thread lib/uploadcare/rails/attached_files.rb
Comment thread lib/uploadcare/rails/internal/active_storage_service_helpers.rb
Comment thread lib/uploadcare/rails/internal/client_resolver.rb
Comment thread lib/uploadcare/rails/internal/uploader_field_helpers.rb
@alxgsv alxgsv self-requested a review May 18, 2026 13:30
@vipulnsward vipulnsward merged commit 4785d05 into main May 18, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants