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

0.14.0 #131

Merged
merged 22 commits into from
May 29, 2024
Merged

0.14.0 #131

merged 22 commits into from
May 29, 2024

Conversation

makoni
Copy link
Collaborator

@makoni makoni commented May 23, 2024

  • Added new methods to get Document info (async and with completion handler).
  • Privacy manifest added.
  • Updated dependencies for Linux.

Summary by CodeRabbit

  • New Features

    • Added documentInfo method to determine document format and conversion formats, available for both synchronous and asynchronous usage.
    • Introduced PrivacyInfo.xcprivacy for managing privacy-related information.
  • Bug Fixes

    • Updated Swift package versions to improve compatibility and performance.
  • Documentation

    • Enhanced REST API documentation with examples for new documentInfo method.
  • Chores

    • Updated library version to 0.14.0.
    • Improved build and test workflow configurations.

Copy link
Contributor

coderabbitai bot commented May 23, 2024

Walkthrough

The update introduces a new method for determining document format and conversion formats in the Uploadcare REST API, with both synchronous and asynchronous usage options. It also updates the library version, adds privacy information files, and includes new test cases and dependency updates. The changes ensure the codebase is up-to-date and enhances functionality with robust document handling capabilities.

Changes

File Path Change Summary
Documentation/REST API.md Added documentation for the documentInfo method in the REST API, with examples for async and callback usage.
Sources/Uploadcare/Constants.swift Updated libraryVersion constant from "0.13.1" to "0.14.0".
Sources/Uploadcare/PrivacyInfo.xcprivacy Added a new file defining privacy-related information in XML plist format.
Sources/Uploadcare/Uploadcare.swift Introduced documentInfo method for determining document format and conversion formats, supporting async and callback.
Sources/Uploadcare/models/REST/DocumentInfo.swift Added structures ConversionFormat, DocumentFormat, and DocumentInfo for handling document information.
Tests/UploadcareTests/RESTAPIIntegrationAsyncTests.swift Added test31_document_info() for async document information retrieval testing.
Tests/UploadcareTests/RESTAPIIntegrationTests.swift Added test27_document_info() for synchronous document information retrieval testing.
Uploadcare.podspec Updated the library version from '0.13.1' to '0.14.0'.
Uploadcare.xcodeproj/project.pbxproj Added references to DocumentInfo.swift and PrivacyInfo.xcprivacy in the project configuration.
.github/workflows/test.yml Updated build and test configurations for macOS and iOS, renamed steps for clarity.
Package.resolved Updated package pins with new revisions and versions for various Swift packages.
Package.swift Added PrivacyInfo.xcprivacy as a resource for Uploadcare and UploadcareWidget targets.
Sources/Uploadcare/Utils.swift Added condition for Swift version 5.10 and set swiftVersion to "5.9" in getSwiftVersion function.
Sources/UploadcareWidget/PrivacyInfo.xcprivacy Introduced an XML property list file for privacy-related information.

In the world of code, new features bloom,
Document formats now in their room.
Async or sync, the choice is yours,
With version bumps and privacy scores.
Tests ensure it's all in line,
Uploadcare's future looking fine.
🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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
Contributor

@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: 4

Outside diff range and nitpick comments (1)
Documentation/REST API.md (1)

571-588: The documentation for the documentInfo method is clear and provides examples for both asynchronous and callback-based usage. This will be very helpful for developers integrating this API. Ensure that the example UUIDs like "fileUUID" are clearly marked as placeholders to avoid confusion.

Consider adding a note that "fileUUID" is a placeholder and should be replaced with an actual file UUID in production code.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between ce7a27e and a234441.
Files selected for processing (9)
  • Documentation/REST API.md (1 hunks)
  • Sources/Uploadcare/Constants.swift (1 hunks)
  • Sources/Uploadcare/PrivacyInfo.xcprivacy (1 hunks)
  • Sources/Uploadcare/Uploadcare.swift (1 hunks)
  • Sources/Uploadcare/models/REST/DocumentInfo.swift (1 hunks)
  • Tests/UploadcareTests/RESTAPIIntegrationAsyncTests.swift (1 hunks)
  • Tests/UploadcareTests/RESTAPIIntegrationTests.swift (1 hunks)
  • Uploadcare.podspec (1 hunks)
  • Uploadcare.xcodeproj/project.pbxproj (10 hunks)
Files skipped from review due to trivial changes (3)
  • Sources/Uploadcare/Constants.swift
  • Sources/Uploadcare/PrivacyInfo.xcprivacy
  • Uploadcare.podspec
Additional Context Used
LanguageTool (4)
Documentation/REST API.md (4)

Near line 20: Possible typo: you repeated a word
Context: ...elete-webhook-api-reference) * Convert document * [Document conversion job status](#document-conver...


Near line 22: Possible typo: you repeated a word
Context: ...on-job-status-api-reference) * Convert video * [Video conversion job status](#video-conversio...


Near line 62: Use a comma before ‘or’ if it connects two independent clauses (unless they are closely connected and short).
Context: ..., for example) to your Uploadcare object or it will get deallocated. ## List of fi...


Near line 471: The usual collocation for “returned” is “to”, not “in”.
Context: ...RL. A redirected URL will be caught and returned in the completion handler of that method. ...

Markdownlint (60)
Documentation/REST API.md (60)

64: Expected: atx; Actual: atx_closed
Heading style


131: Expected: atx; Actual: atx_closed
Heading style


166: Expected: atx; Actual: atx_closed
Heading style


239: Expected: atx; Actual: atx_closed
Heading style


277: Expected: atx; Actual: atx_closed
Heading style


315: Expected: atx; Actual: atx_closed
Heading style


332: Expected: atx; Actual: atx_closed
Heading style


351: Expected: atx; Actual: atx_closed
Heading style


421: Expected: atx; Actual: atx_closed
Heading style


438: Expected: atx; Actual: atx_closed
Heading style


451: Expected: atx; Actual: atx_closed
Heading style


468: Expected: atx; Actual: atx_closed
Heading style


493: Expected: atx; Actual: atx_closed
Heading style


510: Expected: atx; Actual: atx_closed
Heading style


531: Expected: atx; Actual: atx_closed
Heading style


553: Expected: atx; Actual: atx_closed
Heading style


571: Expected: atx; Actual: atx_closed
Heading style


590: Expected: atx; Actual: atx_closed
Heading style


631: Expected: atx; Actual: atx_closed
Heading style


660: Expected: atx; Actual: atx_closed
Heading style


708: Expected: atx; Actual: atx_closed
Heading style


12: Expected: 0 or 2; Actual: 1
Trailing spaces


838: Expected: 0 or 2; Actual: 16
Trailing spaces


884: Expected: 0 or 2; Actual: 16
Trailing spaces


189: Column: 1
Hard tabs


411: Column: 36
Hard tabs


567: Column: 6
Hard tabs


639: Column: 1
Hard tabs


641: Column: 1
Hard tabs


860: Column: 1
Hard tabs


28: Expected: 1; Actual: 2
Multiple consecutive blank lines


738: Expected: 1; Actual: 2
Multiple consecutive blank lines


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


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


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


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


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


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


149: null
Fenced code blocks should be surrounded by blank lines


169: null
Fenced code blocks should be surrounded by blank lines


185: null
Fenced code blocks should be surrounded by blank lines


204: null
Fenced code blocks should be surrounded by blank lines


224: null
Fenced code blocks should be surrounded by blank lines


390: null
Fenced code blocks should be surrounded by blank lines


406: null
Fenced code blocks should be surrounded by blank lines


439: null
Fenced code blocks should be surrounded by blank lines


744: null
Fenced code blocks should be surrounded by blank lines


760: null
Fenced code blocks should be surrounded by blank lines


776: null
Fenced code blocks should be surrounded by blank lines


783: null
Fenced code blocks should be surrounded by blank lines


799: null
Fenced code blocks should be surrounded by blank lines


815: null
Fenced code blocks should be surrounded by blank lines


822: null
Fenced code blocks should be surrounded by blank lines


840: null
Fenced code blocks should be surrounded by blank lines


856: null
Fenced code blocks should be surrounded by blank lines


867: null
Fenced code blocks should be surrounded by blank lines


886: null
Fenced code blocks should be surrounded by blank lines


902: null
Fenced code blocks should be surrounded by blank lines


473: null
Bare URL used


473: null
Bare URL used

Additional comments not posted (5)
Sources/Uploadcare/models/REST/DocumentInfo.swift (3)

11-24: The ConversionFormat struct is well-defined and adheres to the Codable protocol for easy serialization. The use of decodeIfPresent in the initializer ensures that the name property can default to an empty string if not present, which is a safe approach to handle potential missing data in JSON.


26-49: The DocumentFormat struct is correctly implemented with properties and a custom initializer. The use of decodeIfPresent for both name and conversionFormats with sensible defaults (empty string and empty array) is commendable as it prevents runtime errors due to missing data.


51-74: The DocumentInfo struct is well implemented. The optional error property allows for error handling without throwing exceptions, which is a good practice in robust API design. The use of decodeIfPresent with defaults ensures that the object can always be instantiated, even if some data is missing in the JSON response.

Tests/UploadcareTests/RESTAPIIntegrationTests.swift (1)

1035-1037: Ensure comprehensive validation of documentInfo properties.

The assertions correctly validate that no error occurred and that the document format and conversion formats are as expected. This aligns well with the functionality described in the PR summary.

Uploadcare.xcodeproj/project.pbxproj (1)

241-248: Added references to DocumentInfo.swift and PrivacyInfo.xcprivacy in the project file.

This ensures that the new files are recognized by the Xcode project and are included in the build phases appropriately.

Sources/Uploadcare/Uploadcare.swift Show resolved Hide resolved
Tests/UploadcareTests/RESTAPIIntegrationAsyncTests.swift Outdated Show resolved Hide resolved
Tests/UploadcareTests/RESTAPIIntegrationTests.swift Outdated Show resolved Hide resolved
Tests/UploadcareTests/RESTAPIIntegrationTests.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@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 a234441 and 0778217.
Files selected for processing (1)
  • .github/workflows/test.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/test.yml

@makoni
Copy link
Collaborator Author

makoni commented May 23, 2024

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented May 23, 2024

Actions Performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@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: 1

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 0778217 and 5c6057a.
Files selected for processing (8)
  • .github/workflows/test.yml (1 hunks)
  • Package.resolved (1 hunks)
  • Package.swift (1 hunks)
  • Sources/Uploadcare/Utils.swift (1 hunks)
  • Sources/UploadcareWidget/PrivacyInfo.xcprivacy (1 hunks)
  • Tests/UploadcareTests/RESTAPIIntegrationAsyncTests.swift (1 hunks)
  • Tests/UploadcareTests/RESTAPIIntegrationTests.swift (1 hunks)
  • Uploadcare.podspec (2 hunks)
Files skipped from review due to trivial changes (1)
  • Sources/UploadcareWidget/PrivacyInfo.xcprivacy
Files skipped from review as they are similar to previous changes (3)
  • Tests/UploadcareTests/RESTAPIIntegrationAsyncTests.swift
  • Tests/UploadcareTests/RESTAPIIntegrationTests.swift
  • Uploadcare.podspec
Additional comments not posted (6)
.github/workflows/test.yml (2)

12-24: The updates to the macOS build and test job are correctly configured.


32-32: The Swift version matrix for Ubuntu testing is well-defined, ensuring compatibility across different Swift versions.

Package.swift (2)

42-45: The inclusion of PrivacyInfo.xcprivacy in the Uploadcare target is aligned with the PR's privacy enhancement objectives.

Verification successful

The PrivacyInfo.xcprivacy files are present in the Sources/UploadcareWidget and Sources/Uploadcare directories. We need to verify if these files are correctly referenced in the Package.swift file and included in the build process.


The PrivacyInfo.xcprivacy file is referenced twice in the Package.swift file. This could be due to multiple targets or an error. We need to review the context of these references to determine if this is intentional or a potential issue.


The PrivacyInfo.xcprivacy file is correctly referenced in both the Uploadcare and UploadcareWidget targets in the Package.swift file. This inclusion aligns with the PR's objective to handle privacy-related information.

  • Uploadcare target: PrivacyInfo.xcprivacy is included as a resource.
  • UploadcareWidget target: PrivacyInfo.xcprivacy is included as a resource.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that `PrivacyInfo.xcprivacy` is included in the build artifacts.

# Test: Search for the resource in the build output. Expect: Resource should be present.
fd --type file "PrivacyInfo.xcprivacy" --exec ls -l {}

Length of output: 244



Script:

#!/bin/bash
# Description: Verify that `PrivacyInfo.xcprivacy` is correctly referenced in the `Package.swift` file.

# Search for the inclusion of `PrivacyInfo.xcprivacy` in the `Package.swift` file.
rg 'PrivacyInfo.xcprivacy' Package.swift

Length of output: 116



Script:

#!/bin/bash
# Description: Review the context of `PrivacyInfo.xcprivacy` references in the `Package.swift` file.

# Display the lines around the references to `PrivacyInfo.xcprivacy` in the `Package.swift` file.
rg -C 5 'PrivacyInfo.xcprivacy' Package.swift

Length of output: 509


49-52: Consistent application of privacy considerations with the inclusion of PrivacyInfo.xcprivacy in the UploadcareWidget target.

Package.resolved (2)

2-9: Updated async-http-client to version 1.21.1 correctly reflects the latest stable release, ensuring the project benefits from the latest improvements and bug fixes.


40-45: The update to swift-crypto version 3.4.0 ensures the project uses a secure and up-to-date cryptography library.

Sources/Uploadcare/Utils.swift Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@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 5c6057a and 8abe9aa.
Files selected for processing (1)
  • Sources/Uploadcare/Utils.swift (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Sources/Uploadcare/Utils.swift

@makoni makoni requested a review from rsedykh May 29, 2024 11:22
@makoni makoni merged commit 723b0f0 into master May 29, 2024
7 checks passed
@makoni makoni deleted the feature/document-info branch May 29, 2024 11:33
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.

None yet

2 participants