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(dl): add oci.download-file-sha256 API #162

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

wuhuizuo
Copy link
Contributor

Signed-off-by: wuhuizuo [email protected]

@ti-chi-bot ti-chi-bot bot requested a review from purelind July 22, 2024 09:11
@ti-chi-bot ti-chi-bot bot added the size/XXL label Jul 22, 2024
Copy link

ti-chi-bot bot commented Jul 22, 2024

I have already done a preliminary review for you, and I hope to help you do a better job.

This pull request adds a new API DownloadFileSha256 to the oci service. The API returns the SHA256 hash of a specific file in an OCI artifact.

Key Changes:

  • DownloadFileSha256 method is added to the oci service. This method requires repository, file and tag as parameters and returns the length and content disposition of the downloaded content.
  • New endpoints for DownloadFileSha256 are added.
  • The download-file-sha256 CLI command is added to the oci service.
  • BuildDownloadFileSha256Payload function is added to build the payload for the DownloadFileSha256 endpoint from CLI flags.
  • DownloadFileSha256 client method is added to the oci service client.
  • GetFileSHA256 function is added to the oci package to get the SHA256 hash of a specific file in an OCI artifact.
  • A number of files have been auto-generated by the goa tool.

Potential Problems:

  • There are no unit tests provided for the changes.
  • Error handling might not be proper in some cases, for example, when the SHA256 hash of a file can't be fetched.
  • The content type for the DownloadFileSha256 API is set to "application/plain-text". If the hash is being returned as a string, "text/plain" might be a more appropriate content type.

Suggestions for Improvement:

  • Add unit tests to cover the new functionality and ensure it works as expected.
  • Review error handling and ensure all edge cases are properly handled.
  • Consider changing the content type to "text/plain" for returning textual data.

@wuhuizuo
Copy link
Contributor Author

/approve

Copy link

ti-chi-bot bot commented Jul 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wuhuizuo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

PR-Agent was enabled for this repository, but no eligible user found. Please link your git user with your CodiumAI identity here.

@ti-chi-bot ti-chi-bot bot added the approved label Jul 22, 2024
@ti-chi-bot ti-chi-bot bot merged commit 599d9c5 into main Jul 22, 2024
3 checks passed
@ti-chi-bot ti-chi-bot bot deleted the feature/dl-api/oci-file-sha256 branch July 22, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant