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

Add content for api response on upload SDK methods #2381

Merged
merged 7 commits into from
Dec 16, 2024
Merged

Conversation

jace-roell
Copy link
Contributor

@jace-roell jace-roell commented Dec 10, 2024

What It Does
Add content for api response on upload SDK methods

How to Test
Invoke one of the following SDK methods and view results.

  • bufferToUss
  • streamtoUss
  • bufferToDataSet
  • streamToDataSet

Review Checklist
I certify that I have:

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.27%. Comparing base (ac260f4) to head (ac0338e).
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2381      +/-   ##
==========================================
- Coverage   91.28%   91.27%   -0.01%     
==========================================
  Files         638      638              
  Lines       18146    18151       +5     
  Branches     3915     3917       +2     
==========================================
+ Hits        16564    16568       +4     
- Misses       1581     1582       +1     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jace-roell jace-roell marked this pull request as ready for review December 10, 2024 16:57
Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Jace for the enhancement - this LGTM!

I was curious to get your thoughts on setting the from property in apiResponse to include the bytes when its a buffer? You can use the Buffer.prototype.inspect function to do so:

const buf = Buffer.from("test string").inspect();
// output: '<Buffer 74 65 73 74 20 73 74 72 69 6e 67>'

If we only want to show the first x bytes to prevent a massive string, you can use the subarray(0, x) function on the buffer before calling inspect. It's definitely not needed in the output, so I'm not requesting any changes here - but I figured it was worth mentioning, as the hardcoded strings Buffer<> and Stream<> appear to be inspired by this output.

(Note: this function does not exist for streams, but this suggestion mostly applies to buffers)

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 😋

left a few minor comments, but the code (and tests LGTM!) 🙏

packages/zosfiles/src/methods/upload/Upload.ts Outdated Show resolved Hide resolved
packages/zosfiles/src/methods/upload/Upload.ts Outdated Show resolved Hide resolved
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
6.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@awharn awharn merged commit 7657a23 into master Dec 16, 2024
23 of 24 checks passed
@awharn awharn deleted the api-response-fix branch December 16, 2024 16:21
@awharn awharn added the release-patch Indicates a patch to existing code has been applied label Dec 16, 2024
Copy link

Release succeeded for the master branch. 🎉

The following packages have been published:

Powered by Octorelease 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-patch Indicates a patch to existing code has been applied released
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

6 participants