-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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]: SDKs for ActionsArtifacts APIs #2782
[feat]: SDKs for ActionsArtifacts APIs #2782
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @thomhurst, just a little nit about some code doc clarity... it's definitely not super important, but it would be some nice cleanup.
This looks fantastic otherwaise, thank you for the effort here! ❤️
.Any(item => item.Equals(contentType, StringComparison.OrdinalIgnoreCase)))) | ||
{ | ||
responseBody = await responseMessage.Content.ReadAsByteArrayAsync().ConfigureAwait(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the preference of using Stream instead of ByteArray here. Given that this has changed would you mind updating the related code docs around the Response implementation as well, just for clarity sake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated :)
Resolves #2780
Before the change?
After the change?
Methods to interact with the APIs listed here: https://docs.github.com/en/rest/actions/artifacts
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
I couldn't add integration tests as there isn't any API to create artifacts or anything. But I've added a deserialization test. And then I've hooked into the existing HTTP functionality which should already be thoroughly tested.
I also slightly reworked the internal HTTP sending to receive binary file responses as Streams, rather than raw byte arrays. Artifacts could potentially be large file sizes, and loading these directly into a byte array may not be ideal for memory. So by utilising streams instead, we can reduce memory and write to the disk as we receive data.