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

Contribute zowe files download dataset-matching command #1435

Merged
merged 44 commits into from
Jul 6, 2022

Conversation

awharn
Copy link
Member

@awharn awharn commented Jun 6, 2022

Sample command output:

15 data set(s) downloaded successfully to ./
298 data set(s) failed to download:
206 failed because they are archived
    IBMUSER.TEST.DS.ARCHIVED
    ...
15 failed because they are an unsupported type
    IBMUSER.TEST.ZFS
    IBMUSER.TEST.ZFS.DATA
    ...
77 failed because of an uncaught error
    IBMUSER.TEST.DS.BACKUP
    ...

z/OSMF REST API Error:
Rest API failure with HTTP(S) status 500
rc:       4
reason:   3
details:
  - DMS2987 DATA SET CATALOGED TO CA DISK PSEUDO-VOLUME ARCIVE
  - DMS2987 CA DISK HAS ARCHIVED IBMUSER.TEST.DS.BACKUP
  -
  - DMS2971 DO YOU WANT TO RESTORE THE DATA SET? (Y/N)
category: 2
message:  ServletDispatcher failed - received TSO Prompt when expecting TsoServletResponse

...

@codecov
Copy link

codecov bot commented Jun 6, 2022

Codecov Report

Merging #1435 (37a25cd) into master (f801e40) will increase coverage by 0.07%.
The diff coverage is 94.65%.

@@            Coverage Diff             @@
##           master    #1435      +/-   ##
==========================================
+ Coverage   91.93%   92.01%   +0.07%     
==========================================
  Files         388      390       +2     
  Lines        6028     6209     +181     
  Branches      866      910      +44     
==========================================
+ Hits         5542     5713     +171     
- Misses        480      490      +10     
  Partials        6        6              
Impacted Files Coverage Δ
packages/cli/src/zosfiles/-strings-/en.ts 100.00% <ø> (ø)
...ages/cli/src/zosfiles/download/Download.options.ts 100.00% <ø> (ø)
...ckages/zosfiles/src/constants/ZosFiles.messages.ts 100.00% <ø> (ø)
packages/zosfiles/src/methods/list/List.ts 91.78% <84.61%> (-2.72%) ⬇️
...c/zosfiles/download/dsm/DataSetMatching.handler.ts 96.55% <96.55%> (ø)
packages/zosfiles/src/methods/download/Download.ts 96.00% <97.34%> (+1.17%) ⬆️
...s/cli/src/zosfiles/download/Download.definition.ts 100.00% <100.00%> (ø)
...osfiles/download/dsm/DataSetMatching.definition.ts 100.00% <100.00%> (ø)
packages/zosfiles/src/methods/list/index.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 700292e...37a25cd. Read the comment docs.

awharn and others added 17 commits June 6, 2022 14:18
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
@t1m0thyj t1m0thyj marked this pull request as ready for review June 15, 2022 13:07
@t1m0thyj t1m0thyj linked an issue Jun 15, 2022 that may be closed by this pull request
@t1m0thyj
Copy link
Member

t1m0thyj commented Jun 17, 2022

Refactored the APIs based on feedback from team discussion at standup. Before updating all the tests, I'd appreciate reviews to confirm that this implementation matches what we want. 🙂 @gejohnston I believe your comment has also been addressed.

Here's a convenient link to view changes from the last 3 commits: c169e08...files-download-data-sets-matching

To summarize the new implementation, there are now 2 methods:

  • List.dataSetsMatchingPattern - Returns an array of data set objects retrieved from the z/OSMF List API. If listing attributes for all matching data sets at once fails for some reason, we fall back to the much slower alternative of listing attributes for each data set individually, and store an error in each data set object for which we failed to get attributes.
  • Download.allDataSets - This method has been renamed from Download.dataSetsMatchingPattern, and now takes in an array of IZosmfListResponse data set objects returned from the list API instead of DSLEVEL pattern strings. Instead of reporting data sets as being skipped, the new behavior is:
    • For archived data sets, they are treated as a failure and the names of the data sets are printed.
    • For unsupported types, they are also treated as a failure and the names of the data sets are printed.
    • For excluded patterns, they are excluded by the list API and the download API does not care about them.
    • For empty PO data sets, an empty folder with the data set name is created.

@awharn
Copy link
Member Author

awharn commented Jun 17, 2022

I think those all look right, and I think the linked changes all look good. Going to be quite a few tests that need to be updated.

@t1m0thyj t1m0thyj requested a review from gejohnston June 27, 2022 16:19
Copy link
Member

@gejohnston gejohnston left a comment

Choose a reason for hiding this comment

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

Looks good.

@zFernand0
Copy link
Member

FWIW, the pieces (code + tests) that I didn't work on, LGTM! 😋
Happy to formally approve it if we want to move forward 😉

Signed-off-by: Timothy Johnson <[email protected]>
@t1m0thyj
Copy link
Member

t1m0thyj commented Jul 5, 2022

The Windows builds have started to fail because of a bug in Rust 1.62 (rust-lang/rust#98947). For now we can pin the version of Rust in the pipeline to 1.61 to avoid the issue.

@sonarcloud
Copy link

sonarcloud bot commented Jul 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@t1m0thyj t1m0thyj merged commit 884d62a into master Jul 6, 2022
@t1m0thyj t1m0thyj deleted the files-download-data-sets-matching branch July 6, 2022 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zowe files download data-sets-matching
5 participants