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

feat:Update OpenAPI Specification for Instill API with Parameter Changes and Enhancements #27

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Oct 21, 2024

Summary by CodeRabbit

  • New Features

    • Updated API endpoints for object upload and download with clearer parameter definitions.
    • Introduced lastModifiedTime parameter for enhanced tracking of object uploads.
  • Improvements

    • Enhanced descriptions for parameters and schemas to improve user understanding of API usage.

Copy link

coderabbitai bot commented Oct 21, 2024

Walkthrough

The changes made to the OpenAPI specification for the Instill API involve significant updates to endpoint definitions, parameter descriptions, and schema details. Notably, the expirationTime parameter has been replaced with urlExpireDays in specific endpoints, and new parameters like lastModifiedTime have been introduced. Descriptions across various parameters and schemas have been enhanced for clarity, improving the overall usability and understanding of the API.

Changes

File Change Summary
src/libs/Instill/openapi.yaml - Replaced expirationTime with urlExpireDays in /v1alpha/namespaces/{namespaceId}/object-upload-url and /v1alpha/namespaces/{namespaceId}/object-download-url.
- Added lastModifiedTime parameter to the object upload URL request.
- Refined description of objectExpireDays to indicate that 0 prevents automatic deletion.
- Updated Object schema to clarify contentType and objectExpireDays descriptions.
- Added lastModifiedTime field to Object schema.

Poem

In the fields where data flows,
A rabbit hops where clarity grows.
With days to set and times to keep,
The API's secrets, now less steep.
Hooray for changes, bright and clear,
A joyful leap, let's give a cheer! 🐇✨


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

@github-actions github-actions bot merged commit d0422e9 into main Oct 21, 2024
3 checks passed
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Update OpenAPI Specification for Instill API with Parameter Changes and Enhancements Oct 21, 2024
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 (3)
src/libs/Instill/openapi.yaml (3)

1722-1736: Approve changes to GetObjectUploadURL parameters with a suggestion

The modifications to the GetObjectUploadURL operation parameters are well-considered:

  1. Replacing expirationTime with urlExpireDays simplifies usage by specifying duration in days.
  2. Adding lastModifiedTime enhances object metadata tracking.
  3. Clarifying the objectExpireDays description improves understanding of object lifecycle management.

These changes should improve API usability and provide better control over object management.

Consider adding an example value for the urlExpireDays parameter to further improve clarity:

urlExpireDays:
  in: query
  description: "Expiration time in days for the URL. Minimum is 1 day and maximum is 7 days. If not set or set to 0, defaults to 1 day."
  schema:
    type: integer
    format: int32
    example: 3

1781-1785: Approve change to GetObjectDownloadURL parameter with a suggestion

The replacement of expirationTime with urlExpireDays in the GetObjectDownloadURL operation is consistent with the change made to the GetObjectUploadURL operation. This modification maintains API consistency and simplifies usage by specifying the expiration time in days.

For consistency with the GetObjectUploadURL operation, consider adding an example value for the urlExpireDays parameter:

urlExpireDays:
  in: query
  description: "Expiration time in days for the URL. Minimum is 1 day and maximum is 7 days. If not set or set to 0, defaults to 1 day."
  schema:
    type: integer
    format: int32
    example: 3

Line range hint 3414-3435: Approve changes to Object schema with a suggestion

The modifications to the Object schema are beneficial:

  1. The updated contentType description provides clearer information on how the content type is determined.
  2. The objectExpireDays description now explicitly states that setting it to 0 prevents automatic deletion, which improves understanding of object lifecycle management.
  3. The addition of lastModifiedTime enhances object metadata tracking.

These changes improve the clarity and functionality of the Object schema.

To further improve the schema, consider adding a format specifier for the lastModifiedTime field:

lastModifiedTime:
  title: last modified time
  type: string
  format: date-time
  description: "The date and time when the object was last modified, in RFC3339 format."

This change would explicitly define the expected date-time format, improving API consistency and reducing potential errors in date handling.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a2a3550 and af7d628.

⛔ Files ignored due to path filters (5)
  • src/libs/Instill/Generated/Instill.IObjectClient.GetObjectDownloadURL.g.cs is excluded by !**/generated/**
  • src/libs/Instill/Generated/Instill.IObjectClient.GetObjectUploadURL.g.cs is excluded by !**/generated/**
  • src/libs/Instill/Generated/Instill.Models.Object.g.cs is excluded by !**/generated/**
  • src/libs/Instill/Generated/Instill.ObjectClient.GetObjectDownloadURL.g.cs is excluded by !**/generated/**
  • src/libs/Instill/Generated/Instill.ObjectClient.GetObjectUploadURL.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Instill/openapi.yaml (4 hunks)
🧰 Additional context used
🔇 Additional comments (2)
src/libs/Instill/openapi.yaml (2)

1730-1736: Approve addition of lastModifiedTime to GetFileCatalogResponseMetadata

The addition of the lastModifiedTime field to the GetFileCatalogResponseMetadata schema is a positive change. This new field enhances the metadata information available for files in the catalog, allowing for more precise tracking of file modifications. This change is consistent with the updates made to the Object schema, maintaining consistency across the API.

The inclusion of this field will improve the ability to manage and track file versions within the catalog system.


1724-1724: Approve simplification of fileUids description

The simplification of the fileUids field description in the ProcessCatalogFilesRequest schema is a positive change. The new description, "The file uid.", is concise and clear while still conveying the essential information. This change maintains the required nature of the field while improving the overall readability of the schema.

This simplification contributes to a more streamlined and easily understandable API specification.

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