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

Implementation of new "like" parameter for data set creation #766

Merged
merged 28 commits into from
Jul 30, 2020

Conversation

katelynienaber
Copy link
Contributor

Solves linked issue: #754

The changes in this PR will allow calling of zowe.Create.dataSet with the new "like" REST parameter implemented in zOSMF v2.4.

I am not absolutely certain this doesn't belong in Imperative. Please let me know if it should be moved.

Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
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.

Left a few comments.
Also, please don't source test files:
******/zosfile/download/a1595240/a775092.txt

CHANGELOG.md Outdated Show resolved Hide resolved
packages/zosfiles/src/api/methods/create/Create.ts Outdated Show resolved Hide resolved
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
@katelynienaber
Copy link
Contributor Author

Left a few comments.
Also, please don't source test files:
******/zosfile/download/a1595240/a775092.txt

Fixed! Also changed ID. Will check to see if I left it anywhere...

Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
@codecov
Copy link

codecov bot commented Jul 20, 2020

Codecov Report

Merging #766 into master will increase coverage by 0.02%.
The diff coverage is 87.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #766      +/-   ##
==========================================
+ Coverage   91.75%   91.78%   +0.02%     
==========================================
  Files         344      344              
  Lines        5035     4818     -217     
  Branches      747      638     -109     
==========================================
- Hits         4620     4422     -198     
+ Misses        413      394      -19     
  Partials        2        2              
Impacted Files Coverage Δ
...es/zosfiles/src/api/constants/ZosFiles.messages.ts 100.00% <ø> (ø)
packages/zosfiles/src/api/methods/create/Create.ts 91.60% <87.09%> (-1.70%) ⬇️
...owDefinition/RetrieveWorkflowDefinition.handler.ts 68.42% <0.00%> (-0.33%) ⬇️
packages/zosfiles/src/api/utils/ZosFilesUtils.ts 97.84% <0.00%> (+0.97%) ⬆️
...li/list/activeWorkflows/ActiveWorkflows.handler.ts 84.21% <0.00%> (+3.44%) ⬆️
packages/workflows/src/api/ListWorkflows.ts 100.00% <0.00%> (+11.66%) ⬆️

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 2a8805c...c4fa836. Read the comment docs.

Copy link

@ghost ghost 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 adding this parameter! Left a few comments related to tests.

Also I'm having a problem when calling the create dataset API like this:
await Create.dataSet(session, CreateDataSetTypeEnum.DATA_SET_LIKE, "DSNAME.NEW", { like: "DSNAME.OLD" });

An error 500 is returned:

RestClientError: z/OSMF REST API Error:
Rest API failure with HTTP(S) status 500
category: 1
rc:       4
reason:   13
message:  primary

I think the problem may be with the payload being sent:

Resource:  /zosmf/restfiles/ds/DSNAME.NEW
Request:   POST
Headers:   [{"X-CSRF-ZOSMF-HEADER":true}]
Payload:   '{"like":"DSNAME.OLD","secondary":1}'

Seems like the secondary property is getting set in the payload but shouldn't be. Since secondary is set, z/OSMF expects that primary should also be set.

Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
@katelynienaber
Copy link
Contributor Author

Thanks for adding this parameter! Left a few comments related to tests.

Also I'm having a problem when calling the create dataset API like this:
await Create.dataSet(session, CreateDataSetTypeEnum.DATA_SET_LIKE, "DSNAME.NEW", { like: "DSNAME.OLD" });

An error 500 is returned:

RestClientError: z/OSMF REST API Error:
Rest API failure with HTTP(S) status 500
category: 1
rc:       4
reason:   13
message:  primary

I think the problem may be with the payload being sent:

Resource:  /zosmf/restfiles/ds/DSNAME.NEW
Request:   POST
Headers:   [{"X-CSRF-ZOSMF-HEADER":true}]
Payload:   '{"like":"DSNAME.OLD","secondary":1}'

Seems like the secondary property is getting set in the payload but shouldn't be. Since secondary is set, z/OSMF expects that primary should also be set.

I have gotten to the easier comments, now I will take a look at this one...

Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
@katelynienaber
Copy link
Contributor Author

Okay I think I have also gotten to the accidental setting of the secondary parameter...

@katelynienaber katelynienaber requested review from a user and zFernand0 July 20, 2020 16:27
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Copy link

@ghost ghost 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 addressing earlier comments 👍 Pushed a commit to wrap the system test in a TestEnvironment.

The API is working for me now. I was still getting error 500 after you removed the "secondary" property, then realized I was testing on a system that doesn't have the "allocate like" APAR installed. 😢

Will approve once the question about required values on ICreateDataSetOptions is addressed 🙂

katelynienaber and others added 5 commits July 22, 2020 08:43
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
…n class Create

Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
@katelynienaber katelynienaber requested a review from a user July 22, 2020 07:27
Copy link

@ghost ghost 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 adding the ICreateDataSetLikeOptions interface and Create.dataSetLike method, they look good 🙂 Left a few comments.

katelynienaber and others added 2 commits July 23, 2020 10:26
@katelynienaber katelynienaber requested a review from a user July 23, 2020 09:12
@katelynienaber katelynienaber requested a review from a user July 27, 2020 09:27
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
ghost
ghost previously requested changes Jul 28, 2020
test.ts Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@katelynienaber katelynienaber requested a review from a user July 29, 2020 07:11
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
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

Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
Signed-off-by: Katelyn Nienaber <katelyn.nienaber@broadcom.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 2 Code Smells

85.7% 85.7% Coverage
0.0% 0.0% Duplication

warning The version of Java (1.8.0_212) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11.
Read more here

@zFernand0 zFernand0 dismissed ghost ’s stale review July 30, 2020 14:59

done

@zFernand0 zFernand0 merged commit 071584c into master Jul 30, 2020
@zFernand0 zFernand0 deleted the add-like-param branch July 30, 2020 14:59
@katelynienaber
Copy link
Contributor Author

woohoo!

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 SDK - Implement allocation of dataset 'like' feature
3 participants