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

OSTree Plugin Updates #33

Merged
merged 2 commits into from
Jan 25, 2024
Merged

OSTree Plugin Updates #33

merged 2 commits into from
Jan 25, 2024

Conversation

kyleishie
Copy link
Contributor

@kyleishie kyleishie commented Jan 25, 2024

  • adds arm64 building to ostree plugin
  • adds more crud operations around ostree remotes
  • adds ability to specify an ephemeral remote when syncing
  • renames files in orasostree and beskerctl to make more sense relative to their contents

Summary by CodeRabbit

  • New Features

    • Introduced new functionality for managing remote repositories, including updating, deleting, and syncing with an ephemeral remote.
  • Bug Fixes

    • Removed unsupported platform "linux/arm64" to prevent build issues.
  • Documentation

    • Updated API documentation to reflect new endpoints and operations for repository management.
  • Tests

    • Enhanced testing with a new subtest to verify remote creation and deletion.

adds more crud operations around ostree remotes
adds ability to specify an ephemeral remote when syncing
renames files in orasostree and beskerctl to make more sense relative to their contents
Copy link
Contributor

coderabbitai bot commented Jan 25, 2024

Warning

Rate Limit Exceeded

@kyleishie has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 35 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between d344f11 and be51599.

Walkthrough

The codebase has been updated to enhance the functionality of OSTree repository management. It now supports updating, deleting, and synchronizing repositories, including handling of ephemeral remotes. A platform exclusion was also removed from the build configuration, allowing for broader compatibility.

Changes

Files Change Summary
build/mage/build.go Removed exclusion of "linux/arm64" platform
internal/plugins/ostree/api.go
internal/plugins/ostree/pkg/ostreerepository/api.go
pkg/plugins/ostree/api/v1/api.go
Added methods for updating, deleting, and syncing repositories, including ephemeral remote support
internal/plugins/ostree/pkg/libostree/pull_test.go Modified test to include creation and deletion of a remote
pkg/plugins/ostree/api/v1/.../endpoint.go
pkg/plugins/ostree/api/v1/http.go
pkg/plugins/ostree/api/v1/http_client.go
pkg/plugins/ostree/api/v1/oas2.go
Updated to include new endpoints and methods for delete and update operations

🐇✨
In the code's warren, beneath the moon's glow,
New paths are forged, as the data streams flow.
Repos sync and remotes take flight,
In the digital meadow, all codes unite. 🌟🌙

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

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.

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 10b5a9b and d344f11.
Files selected for processing (9)
  • build/mage/build.go (1 hunks)
  • internal/plugins/ostree/api.go (1 hunks)
  • internal/plugins/ostree/pkg/libostree/pull_test.go (1 hunks)
  • internal/plugins/ostree/pkg/ostreerepository/api.go (2 hunks)
  • pkg/plugins/ostree/api/v1/api.go (2 hunks)
  • pkg/plugins/ostree/api/v1/endpoint.go (2 hunks)
  • pkg/plugins/ostree/api/v1/http.go (4 hunks)
  • pkg/plugins/ostree/api/v1/http_client.go (2 hunks)
  • pkg/plugins/ostree/api/v1/oas2.go (4 hunks)
Additional comments: 14
internal/plugins/ostree/api.go (2)
  • 46-51: The method UpdateRemote correctly checks the repository name before proceeding with the update operation. This is consistent with the other CRUD methods in the file.
  • 54-59: The method DeleteRemote follows the same pattern as UpdateRemote for error checking, which maintains consistency across CRUD operations.
pkg/plugins/ostree/api/v1/api.go (2)
  • 45-50: The addition of the EphemeralRemote field to OSTreeRepositorySyncRequest struct is consistent with the PR's objective to support ephemeral remote syncing. The comment explaining the mutual exclusivity with the Remote field is clear and helpful.
  • 96-104: The addition of UpdateRemote and DeleteRemote methods to the OSTree interface aligns with the PR's objectives to extend CRUD operations for OSTree remotes.
internal/plugins/ostree/pkg/libostree/pull_test.go (1)
  • 114-121: The new subtest should create then delete remote in TestRepo_Pull function is a good addition to the test suite, ensuring that the creation and deletion of a remote can be verified through automated tests.
pkg/plugins/ostree/api/v1/oas2.go (2)
  • 44-65: The addition of delete and put operations for the /repository/remote endpoint in the OpenAPI Specification is necessary for the new delete and update remote functionality. The descriptions and operation IDs are clear and follow the existing naming conventions.
  • 161-173: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [142-170]

The new request and response definitions for DeleteRemote and UpdateRemote operations are correctly added to the OpenAPI Specification, ensuring that the API documentation is up-to-date with the code changes.

pkg/plugins/ostree/api/v1/http.go (2)
  • 55-67: The HTTP router setup for the DeleteRemote endpoint is correct, using the DELETE method and the appropriate path. The server options and error encoder are consistently applied as with other endpoints.
  • 111-123: The HTTP router setup for the UpdateRemote endpoint is also correct, using the PUT method. The consistency in handling request and response encoding is maintained.
pkg/plugins/ostree/api/v1/endpoint.go (2)
  • 88-122: The new types DeleteRemoteRequest and DeleteRemoteResponse, along with the MakeEndpointOfDeleteRemote function, are correctly implemented to handle the deletion of remotes. The validation function is also provided, which is good practice.
  • 234-270: The new types UpdateRemoteRequest and UpdateRemoteResponse, along with the MakeEndpointOfUpdateRemote function, are correctly implemented to handle the updating of remotes. The validation function is also provided, which is good practice.
pkg/plugins/ostree/api/v1/http_client.go (2)
  • 135-182: The DeleteRemote method in the HTTPClient is implemented correctly, sending a DELETE request to the appropriate endpoint. The error handling is consistent with other methods in the client.
  • 332-381: The UpdateRemote method in the HTTPClient is implemented correctly, sending a PUT request to the appropriate endpoint. The error handling is consistent with other methods in the client.
internal/plugins/ostree/pkg/ostreerepository/api.go (1)
  • 196-216: The DeleteRemote method follows the same pattern as UpdateRemote for state transition and repository existence check. The method then deletes the remote within a local repo transaction. The implementation is straightforward and follows the expected logic for a delete operation.

internal/plugins/ostree/pkg/ostreerepository/api.go Outdated Show resolved Hide resolved
@ikaneshiro ikaneshiro merged commit 286779e into ctrliq:main Jan 25, 2024
3 checks passed
@kyleishie kyleishie deleted the ostree-updates branch January 25, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants