Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For Uploadcare::ConversionApi added get_document_conversion_formats_info method to get the possible document conversion formats. #145

Merged
merged 2 commits into from
Jun 1, 2024

Conversation

vipulnsward
Copy link
Collaborator

@vipulnsward vipulnsward commented Jun 1, 2024

Description

For Uploadcare::ConversionApi added get_document_conversion_formats_info method to get the possible document conversion formats.

Checklist

Summary by CodeRabbit

  • New Features

    • Added functionality to retrieve document conversion format information using the Uploadcare API.
  • Chores

    • Updated uploadcare-ruby dependency version from 4.4.1 to 4.4.2.
  • Tests

    • Added test cases for the new document conversion format retrieval method.
  • Style

    • Excluded files under the spec directory from the Metrics/ModuleLength RuboCop rule.

Copy link

coderabbitai bot commented Jun 1, 2024

Walkthrough

The recent updates introduce a new method get_document_conversion_formats_info to the Uploadcare::ConversionApi class, allowing users to retrieve document conversion formats from the Uploadcare API. Additionally, a new test case and VCR cassette are added to support this method. The dependency version of uploadcare-ruby is updated to 4.4.2, and RuboCop configuration is adjusted to exclude spec files from the Metrics/ModuleLength rule.

Changes

Files Change Summary
CHANGELOG.md Added a summary of the new get_document_conversion_formats_info method to the "Unreleased" section.
lib/uploadcare/rails/api/rest/conversion_api.rb Added the get_document_conversion_formats_info method to retrieve document conversion formats.
spec/fixtures/vcr_cassettes/conversion_api_get_document_formats.yml Captured HTTP interaction for retrieving document conversion formats.
spec/uploadcare/rails/api/rest/conversion_api_spec.rb Added test cases for the get_document_conversion_formats_info method.
uploadcare-rails.gemspec Updated uploadcare-ruby dependency version from 4.4.1 to 4.4.2.
.rubocop.yml Excluded files under the spec directory from the Metrics/ModuleLength rule.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant UploadcareRails
    participant UploadcareAPI

    User->>UploadcareRails: Call get_document_conversion_formats_info
    UploadcareRails->>UploadcareAPI: GET /conversion/formats/document/
    UploadcareAPI-->>UploadcareRails: Return supported formats (e.g., jpg, avif, bmp, gif)
    UploadcareRails-->>User: Return supported formats
Loading

Poem

In the code where data flows,
New formats bloom like a rose. 🌹
From API to test and spec,
Conversion magic we now check.
With RuboCop rules set aside,
Our gem's version takes a ride.
Uploadcare's path is clear and bright,
Document formats take flight! 🚀


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (1)
spec/uploadcare/rails/api/rest/conversion_api_spec.rb (1)

Line range hint 17-109: The test for get_document_conversion_formats_info is well-implemented and covers the basic successful response scenario. Consider adding tests for edge cases, such as invalid UUIDs or API errors.

Would you like me to help by adding these additional test cases?

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 22386b3 and d1a4b9c.

Files selected for processing (5)
  • CHANGELOG.md (1 hunks)
  • lib/uploadcare/rails/api/rest/conversion_api.rb (1 hunks)
  • spec/fixtures/vcr_cassettes/conversion_api_get_document_conversion_formats_info.yml (1 hunks)
  • spec/uploadcare/rails/api/rest/conversion_api_spec.rb (2 hunks)
  • uploadcare-rails.gemspec (1 hunks)
Files skipped from review due to trivial changes (1)
  • uploadcare-rails.gemspec
Additional context used
LanguageTool
CHANGELOG.md

[duplication] ~13-~13: Possible typo: you repeated a word
Context: ...on formats. ## 3.4.2 — 2024-05-11 ### Added * Added API support for `AWS Rekognition Modera...


[style] ~55-~55: Consider using a different verb for a more formal wording.
Context: ... ## 3.3.2 — 2023-03-26 ### Changed * Fixed an issue with the configuration * Updat...


[style] ~102-~102: In American English, abbreviations like “etc.” require a period.
Context: ...s mime-type, image (dimensions, format, etc), video information (duration, format, ...


[style] ~102-~102: In American English, abbreviations like “etc.” require a period.
Context: ...information (duration, format, bitrate, etc), audio information, etc - Field `met...


[style] ~102-~102: In American English, abbreviations like “etc.” require a period.
Context: ...rmat, bitrate, etc), audio information, etc - Field metadata that includes arbi...


[style] ~108-~108: This phrase is redundant (‘I’ stands for ‘interface’). Use simply “API”.
Context: ...plications ### Added - Add Uploadcare API interface: - Uploadcare::FileMetadataApi - ...


[style] ~129-~129: This phrase is redundant (‘I’ stands for ‘interface’). Use simply “API”.
Context: ...with 1.x.* ### Added - Add Uploadcare API interface: - Uploadcare::FileApi - Uploadcare...

Markdownlint
CHANGELOG.md

88-88: Expected: asterisk; Actual: dash
Unordered list style


89-89: Expected: asterisk; Actual: dash
Unordered list style


90-90: Expected: asterisk; Actual: dash
Unordered list style


91-91: Expected: asterisk; Actual: dash
Unordered list style


92-92: Expected: asterisk; Actual: dash
Unordered list style


93-93: Expected: asterisk; Actual: dash
Unordered list style


94-94: Expected: asterisk; Actual: dash
Unordered list style


95-95: Expected: asterisk; Actual: dash
Unordered list style


96-96: Expected: asterisk; Actual: dash
Unordered list style


97-97: Expected: asterisk; Actual: dash
Unordered list style


101-101: Expected: asterisk; Actual: dash
Unordered list style


102-102: Expected: asterisk; Actual: dash
Unordered list style


103-103: Expected: asterisk; Actual: dash
Unordered list style


104-104: Expected: asterisk; Actual: dash
Unordered list style


108-108: Expected: asterisk; Actual: dash
Unordered list style


109-109: Expected: asterisk; Actual: dash
Unordered list style


110-110: Expected: asterisk; Actual: dash
Unordered list style


111-111: Expected: asterisk; Actual: dash
Unordered list style


112-112: Expected: asterisk; Actual: dash
Unordered list style


122-122: Expected: asterisk; Actual: dash
Unordered list style


129-129: Expected: asterisk; Actual: dash
Unordered list style


130-130: Expected: asterisk; Actual: dash
Unordered list style


131-131: Expected: asterisk; Actual: dash
Unordered list style


132-132: Expected: asterisk; Actual: dash
Unordered list style


133-133: Expected: asterisk; Actual: dash
Unordered list style


134-134: Expected: asterisk; Actual: dash
Unordered list style


135-135: Expected: asterisk; Actual: dash
Unordered list style


136-136: Expected: asterisk; Actual: dash
Unordered list style


137-137: Expected: asterisk; Actual: dash
Unordered list style


138-138: Expected: asterisk; Actual: dash
Unordered list style


142-142: Expected: asterisk; Actual: dash
Unordered list style


143-143: Expected: asterisk; Actual: dash
Unordered list style


144-144: Expected: asterisk; Actual: dash
Unordered list style


145-145: Expected: asterisk; Actual: dash
Unordered list style


146-146: Expected: asterisk; Actual: dash
Unordered list style


147-147: Expected: asterisk; Actual: dash
Unordered list style


149-149: Expected: asterisk; Actual: dash
Unordered list style


150-150: Expected: asterisk; Actual: dash
Unordered list style


151-151: Expected: asterisk; Actual: dash
Unordered list style


155-155: Expected: asterisk; Actual: dash
Unordered list style


156-156: Expected: asterisk; Actual: dash
Unordered list style


157-157: Expected: asterisk; Actual: dash
Unordered list style


158-158: Expected: asterisk; Actual: dash
Unordered list style


159-159: Expected: asterisk; Actual: dash
Unordered list style


160-160: Expected: asterisk; Actual: dash
Unordered list style


161-161: Expected: asterisk; Actual: dash
Unordered list style


162-162: Expected: asterisk; Actual: dash
Unordered list style


163-163: Expected: asterisk; Actual: dash
Unordered list style


164-164: Expected: asterisk; Actual: dash
Unordered list style


165-165: Expected: asterisk; Actual: dash
Unordered list style


169-169: Expected: asterisk; Actual: dash
Unordered list style


176-176: Expected: asterisk; Actual: dash
Unordered list style


180-180: Expected: asterisk; Actual: dash
Unordered list style


181-181: Expected: asterisk; Actual: dash
Unordered list style


186-186: Expected: asterisk; Actual: dash
Unordered list style


187-187: Expected: asterisk; Actual: dash
Unordered list style


190-190: Expected: asterisk; Actual: dash
Unordered list style


195-195: Expected: asterisk; Actual: dash
Unordered list style


196-196: Expected: asterisk; Actual: dash
Unordered list style


201-201: Expected: asterisk; Actual: dash
Unordered list style


202-202: Expected: asterisk; Actual: dash
Unordered list style


205-205: Expected: asterisk; Actual: dash
Unordered list style


206-206: Expected: asterisk; Actual: dash
Unordered list style


209-209: Expected: asterisk; Actual: dash
Unordered list style


210-210: Expected: asterisk; Actual: dash
Unordered list style


183-183: Expected: 1; Actual: 2
Multiple consecutive blank lines


192-192: Expected: 1; Actual: 2
Multiple consecutive blank lines


198-198: Expected: 1; Actual: 2
Multiple consecutive blank lines


1-1: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


13-13: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


114-114: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


115-115: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines


119-119: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


120-120: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines


124-124: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


125-125: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines


167-167: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


168-168: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines


168-168: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


173-173: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


174-174: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines


178-178: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


179-179: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines


179-179: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


184-184: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


185-185: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines


185-185: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


189-189: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


193-193: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


194-194: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines


194-194: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


199-199: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


200-200: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines


200-200: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


204-204: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


208-208: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


14-14: null
Lists should be surrounded by blank lines


80-80: null
Lists should be surrounded by blank lines


169-169: null
Lists should be surrounded by blank lines


180-180: null
Lists should be surrounded by blank lines


186-186: null
Lists should be surrounded by blank lines


190-190: null
Lists should be surrounded by blank lines


195-195: null
Lists should be surrounded by blank lines


201-201: null
Lists should be surrounded by blank lines


205-205: null
Lists should be surrounded by blank lines


209-209: null
Lists should be surrounded by blank lines


37-37: null
Bare URL used


63-63: null
Bare URL used

Additional comments not posted (3)
lib/uploadcare/rails/api/rest/conversion_api.rb (1)

24-28: The implementation of get_document_conversion_formats_info follows the established pattern and correctly uses the DocumentConverter.info method. Ensure that error handling is robust in the DocumentConverter.info method.

spec/fixtures/vcr_cassettes/conversion_api_get_document_conversion_formats_info.yml (1)

1-59: The VCR cassette for get_document_conversion_formats_info correctly captures the HTTP request and response. Ensure that the captured data remains relevant and update the cassette as needed when the API changes.

CHANGELOG.md (1)

7-10: The changelog entry for the addition of get_document_conversion_formats_info is clear and appropriately documented under the "Unreleased" section.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d1a4b9c and 8d59a2c.

Files selected for processing (1)
  • .rubocop.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .rubocop.yml

@vipulnsward vipulnsward merged commit 964d360 into main Jun 1, 2024
34 checks passed
@vipulnsward vipulnsward deleted the add-document-converter branch June 2, 2024 18:30
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