Skip to content

File tags - #191

Open
alxgsv wants to merge 2 commits into
mainfrom
feature/tags
Open

File tags#191
alxgsv wants to merge 2 commits into
mainfrom
feature/tags

Conversation

@alxgsv

@alxgsv alxgsv commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Tags are now supported by Upload and REST APIs https://uploadcare.com/docs/api/

Summary by CodeRabbit

  • New Features

    • Added file tag support for direct, URL, multipart, and multi-file uploads.
    • Added APIs to list, replace, add, and remove file tags, including atomic updates.
    • File responses now include associated tags.
    • Tags are normalized, deduplicated, and validated automatically.
    • Added REST API examples for file tag operations.
  • Documentation

    • Documented upload-time tag options, tag rules, and management operations.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7024756d-006e-4f0a-91d9-52b202e0e00a

📥 Commits

Reviewing files that changed from the base of the PR and between 1e0cfe6 and 68bc001.

📒 Files selected for processing (1)
  • spec/uploadcare/operations/multipart_upload_spec.rb

Walkthrough

This change adds file tag management through REST and client resource APIs. It adds tag normalization and validation for uploads, supports tags across upload modes, includes file tags in file resources, and adds documentation, examples, and tests.

Changes

File tag support

Layer / File(s) Summary
Upload tag normalization
lib/uploadcare/internal/*, lib/uploadcare/api/upload/files.rb, lib/uploadcare/operations/*, spec/uploadcare/internal/*, spec/uploadcare/api/upload/files_spec.rb, spec/uploadcare/operations/multipart_upload_spec.rb
Upload options accept tags for direct, batch, URL, and multipart uploads. Tags are trimmed, lowercased, deduplicated, validated, and serialized as comma-separated values.
REST file tag endpoints
lib/uploadcare/api/rest.rb, lib/uploadcare/api/rest/file_tags.rb, spec/uploadcare/api/rest*.rb, api_examples/rest_api/*, api_examples/support/run_rest_example.rb, api_examples/README.md
The REST client adds memoized file tag access and GET, PUT, and PATCH operations. Examples cover listing, replacement, and incremental updates.
Resource and client integration
lib/uploadcare.rb, lib/uploadcare/client*, lib/uploadcare/resources/*, spec/uploadcare/client_spec.rb, spec/uploadcare/resources/*, spec/uploadcare/*_spec.rb
Client-scoped and class-level APIs manage file tags. File resources expose tags, and tag operations return updated tags and change lists.
Documentation and changelog
README.md, CHANGELOG.md
Documentation describes upload tags, file tag operations, normalization, validation, and the file.tags response field.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 67.65% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding file tag support across upload and REST APIs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/tags

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@lib/uploadcare/api/upload/files.rb`:
- Around line 202-203: Remove tags from the URL-upload request and its related
API surface: in lib/uploadcare/api/upload/files.rb:202-203, stop merging tags
into /from_url/ parameters; update lib/uploadcare/api/upload/files.rb:66,
lib/uploadcare/operations/upload_router.rb:84, and README.md:439 to no longer
document or expose URL-upload tags. Replace the mock-only coverage in
spec/uploadcare/api/upload/files_spec.rb:206-218 with behavior verifying tags
are not sent; apply URL tags only through client.file_tags after status returns
a UUID. Update FileTagNormalizer and its tests to discard blank tags instead of
rejecting them.
🪄 Autofix

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: 5f1e405f-273f-44bb-a7fe-2fec455931ba

📥 Commits

Reviewing files that changed from the base of the PR and between 3e29092 and 1e0cfe6.

📒 Files selected for processing (30)
  • CHANGELOG.md
  • README.md
  • api_examples/README.md
  • api_examples/rest_api/get_files_uuid_tags.rb
  • api_examples/rest_api/patch_files_uuid_tags.rb
  • api_examples/rest_api/put_files_uuid_tags.rb
  • api_examples/support/run_rest_example.rb
  • lib/uploadcare.rb
  • lib/uploadcare/api/rest.rb
  • lib/uploadcare/api/rest/file_tags.rb
  • lib/uploadcare/api/upload/files.rb
  • lib/uploadcare/client.rb
  • lib/uploadcare/client/file_tags_accessor.rb
  • lib/uploadcare/internal/file_tag_normalizer.rb
  • lib/uploadcare/internal/upload_params_generator.rb
  • lib/uploadcare/operations/multipart_upload.rb
  • lib/uploadcare/operations/upload_router.rb
  • lib/uploadcare/resources/file.rb
  • lib/uploadcare/resources/file_tags.rb
  • spec/uploadcare/api/rest/file_tags_spec.rb
  • spec/uploadcare/api/rest_spec.rb
  • spec/uploadcare/api/upload/files_spec.rb
  • spec/uploadcare/client_spec.rb
  • spec/uploadcare/coverage_boost_spec.rb
  • spec/uploadcare/internal/file_tag_normalizer_spec.rb
  • spec/uploadcare/internal/upload_params_generator_spec.rb
  • spec/uploadcare/multi_account_spec.rb
  • spec/uploadcare/resources/file_spec.rb
  • spec/uploadcare/resources/file_tags_spec.rb
  • spec/uploadcare_spec.rb

Comment thread lib/uploadcare/api/upload/files.rb
The "sequential upload (threads <= 1)" and progress-callback contexts
never passed `threads:`, so `normalize_upload_options` fell back to
`config.upload_threads`, which defaults to 2. Both contexts therefore
ran the parallel path with two workers while asserting strict part
ordering, failing intermittently on loaded CI runners.

Pin `upload_threads: 1` in those contexts so the sequential path is
actually exercised — it had no coverage before.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@alxgsv
alxgsv requested a review from vipulnsward August 7, 2026 11:21
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.

1 participant