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(list): Add maxLength and start options to List SDK functions #2409

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

traeok
Copy link
Member

@traeok traeok commented Jan 14, 2025

What It Does

  • Added the maxLength option to List SDK functions (allMembers, dataSetsMatchingPattern, membersMatchingPattern) to specify the maximum number of items to return.
  • Added the start option to List SDK functions (allMembers, dataSetsMatchingPattern, membersMatchingPattern) to specify the first data set/member name to return in the response.
  • Updated logic for a system test that wasn't actually validating the behavior of the start option in List.dataSet. Now, the test validates that start works as expected.

How to Test

See the scripts in this gist.

  1. Checkout this branch on your machine and run npm install && npm run build from the root of the repo.
  2. Grab one of the scripts defined in the gist and save it to a folder where the packages can be imported - I placed mine in packages/zosfiles
  3. For the maxLength script, replace the "USER.*" pattern with a pattern that will match results for your default z/OSMF profile.
  4. For the start script, replace the pattern mentioned in step 3 and adjust the value for the start option to match a data set listed by the pattern.
  5. Observe that maxLength is respected (e.g. maxLength: 1 returns only one data set matching the pattern)
  6. Observe that start is respected (e.g. "USER.*" with "USER.STARTDS" as the start option results in the list starting with USER.STARTDS)

Review Checklist
I certify that I have:

Additional Comments

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.33%. Comparing base (97a3c68) to head (342f8f1).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #2409    +/-   ##
========================================
  Coverage   91.33%   91.33%            
========================================
  Files         639      639            
  Lines       18248    18251     +3     
  Branches     3834     3945   +111     
========================================
+ Hits        16666    16670     +4     
+ Misses       1580     1579     -1     
  Partials        2        2            

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

@traeok traeok changed the title Feat/max items feat(list): Add maxLength and start options to List SDK functions Jan 15, 2025
@traeok traeok marked this pull request as ready for review January 15, 2025 16:32
Copy link

📅 Suggested merge-by date: 1/29/2025

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! 😋

I left one comment regarding uri encoding things 😋
Could we chat about it briefly? 😋

packages/zosfiles/src/methods/list/List.ts Outdated Show resolved Hide resolved
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! 😋
thanks for addressing the comment so quickly 🙏

packages/zosfiles/src/methods/list/List.ts Show resolved Hide resolved
Signed-off-by: Trae Yelovich <[email protected]>
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.

Thanks for reverting the format changes. 😋
I'm not opposed if you'd like to run it agains the entire repo (on a separate PR) 🙏

Also, this worked fine with special characters 🙏
FERNANDO.A10123.ENCO#ED.DATA
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review/QA
Development

Successfully merging this pull request may close these issues.

3 participants