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

Support for copy/paste of MVS files within and cross lpars #3387

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

likhithanimma1
Copy link
Contributor

@likhithanimma1 likhithanimma1 commented Jan 10, 2025

Proposed changes

Issue: #3012
With this PR, Zowe Explorer now supports copy and paste of MVS files (seq, pds, and members) on same and also cross lpars.

Release Notes

Milestone:

Changelog: Implemented copy/paste functionality of datasets within and cross lpars. #3012

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds or improves functionality)
  • Breaking change (a change that would cause existing functionality to not work as expected)
  • Documentation (Markdown, README updates)
  • Other (please specify above in "Proposed changes" section)

Checklist

General

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • All PR dependencies have been merged and published (if applicable)
  • A GIF or screenshot is included in the PR for visual changes
  • The pre-publish command has been executed:
    • v2 and below: yarn workspace vscode-extension-for-zowe vscode:prepublish
    • v3: pnpm --filter vscode-extension-for-zowe vscode:prepublish

Code coverage

  • There is coverage for the code that I have added
  • I have added new test cases and they are passing
  • I have manually tested the changes

Deployment

  • I have added developer documentation (if applicable)
  • Documentation should be added to Zowe Docs
    • If you're an outside contributor, please post in the #zowe-doc Slack channel to coordinate documentation.
    • Otherwise, please check with the rest of the squad about any needed documentation before merging.
  • These changes may need ported to the appropriate branches (list here):

Further comments

Copy link

github-actions bot commented Jan 10, 2025

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

@likhithanimma1 likhithanimma1 marked this pull request as draft January 10, 2025 08:31
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 93.45238% with 11 lines in your changes missing coverage. Please review.

Project coverage is 93.18%. Comparing base (4fefdf9) to head (668a35e).

Files with missing lines Patch % Lines
.../zowe-explorer/src/trees/dataset/DatasetActions.ts 92.76% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3387      +/-   ##
==========================================
- Coverage   93.18%   93.18%   -0.01%     
==========================================
  Files         120      120              
  Lines       12502    12572      +70     
  Branches     2885     2732     -153     
==========================================
+ Hits        11650    11715      +65     
- Misses        851      856       +5     
  Partials        1        1              

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

Signed-off-by: likhithanimma1 <[email protected]>
Signed-off-by: likhithanimma1 <[email protected]>
@likhithanimma1 likhithanimma1 changed the title Support for copy/paste of MVS files cross lpars Support for copy/paste of MVS files within and cross lpars Jan 13, 2025
Copy link
Contributor

@anaxceron anaxceron 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 couple of comments re: changelogs

packages/zowe-explorer-api/CHANGELOG.md Outdated Show resolved Hide resolved
packages/zowe-explorer/CHANGELOG.md Outdated Show resolved Hide resolved
anaxceron
anaxceron previously approved these changes Jan 15, 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.

Functionality LGTM! 😋


I did run into a bit of an issue in the cross lpar copy 🤔

I haven't done much research but it is possible that this is affected by the allocation configuration on the target system (e.g. management/storage, ... classes)
image


Note: I'm still halfway through the review 😅

@@ -49,13 +49,11 @@ export namespace ZoweExplorerZosmf {
}

public getSession(profile?: imperative.IProfileLoaded): imperative.Session {
if (!this.session) {
Copy link
Member

Choose a reason for hiding this comment

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

If we remove this check, we are already going to call the _getSession and replacing the "existing one"
is that desired, or will that cause some breakage in certain edge cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the check is in place, in the function copyDataSetCrossLpar after generating the sourceSession with the help of this.getSession(sourceprofile) the targetSession will also be generated same as sourceSession with the call this.getSession() which is not the case when u want to paste the copied dataset to different LPAR.

this.getSession(sourceprofile),
{ dsn: toDataSetName, member: toMemberName },
options,
{ volume: undefined },
Copy link
Member

@zFernand0 zFernand0 Jan 15, 2025

Choose a reason for hiding this comment

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

What if the source dataset is not cataloged? It would seem that ZE won't be able to find it in order to perform the copy operation 😢

On the other hand, if we do not want to support uncataloged datasets, we should probably not even specify volume: undefined. Given that volume is also optional in IOptions, why not just pass an empty object instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have made it to send an empty object {}

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.

As a general comment, I like the attention to detail that went though refactoring the copy/paste operations.

I would like to discuss a bit more on the design/implementation decisions taken here 🙏

all things considered, this PR, LGTM! 😋

Comment on lines +37 to +43
Array<{
memberName: string;
contextValue: string;
profileName: string;
dataSetName: string;
}>
> {
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious to understand a bit more of the background of moving from returning an object to returning a Promise<Array<object>>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In case of copy of PDS, I wanted all of its corresponding members to be copied to the clipboard through this function getNodeLabels. So, thought of changing it to Array<object>.

Signed-off-by: likhithanimma1 <[email protected]>
@likhithanimma1
Copy link
Contributor Author

Functionality LGTM! 😋

I did run into a bit of an issue in the cross lpar copy 🤔

I haven't done much research but it is possible that this is affected by the allocation configuration on the target system (e.g. management/storage, ... classes) image

Note: I'm still halfway through the review 😅

https://github.com/zowe/zowe-cli/blob/97a3c6877baa8eb5322df03d34763358f421cad1/packages/zosfiles/src/methods/copy/Copy.ts#L344
Here I see that the generateDatasetOptions function
https://github.com/zowe/zowe-cli/blob/97a3c6877baa8eb5322df03d34763358f421cad1/packages/zosfiles/src/methods/copy/Copy.ts#L409
is always returning alcunit as "TRK". Is that the reason for which target spacu is always TRACK irrespective of source? Do correct me if Iam wrong :)

@zFernand0
Copy link
Member

zFernand0 commented Jan 16, 2025

Is that the reason for which target spacu is always TRACK irrespective of source? Do correct me if Iam wrong :)

I think you are right 🤯
This is something that we can fix as a CLI/SDK issue.

Thanks for looking into this a bit further 🙏


See:

anaxceron
anaxceron previously approved these changes Jan 16, 2025
zFernand0
zFernand0 previously approved these changes Jan 17, 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've added the following issue to the v3.2.0 release plan

Copy link
Contributor

@JillieBeanSim JillieBeanSim 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 question about the code changes, the missing CHANGELOG had me look into changes made in the FTP extension.

options: zosfiles.ICrossLparCopyDatasetOptions,
sourceprofile: imperative.IProfileLoaded
): Promise<zosfiles.IZosFilesResponse> {
throw new ZoweFtpExtensionError("Copy dataset cross lpar is not supported in ftp extension.");
Copy link
Contributor

Choose a reason for hiding this comment

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

What can we expect with an extender that works with this on day 1 and a user tries but their extension wasn't updated like we see the zFTP extension? Should a check be done in ZE making this statement like we do for other new APIs/functionality?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JillieBeanSim Removed it from ftp as the ZE functionality already has the check in place for it.

Copy link
Contributor

@anaxceron anaxceron left a comment

Choose a reason for hiding this comment

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

changelog looks great, thanks @likhithanimma1!

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 feedback 🙏

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

Successfully merging this pull request may close these issues.

4 participants