Skip to content

copy frontend #920

Closed
ATorrise wants to merge 2 commits intomainfrom
copy-frontend2
Closed

copy frontend #920
ATorrise wants to merge 2 commits intomainfrom
copy-frontend2

Conversation

@ATorrise
Copy link
Copy Markdown
Contributor

@ATorrise ATorrise commented Apr 8, 2026

What It Does
VSCE:

  • Implemented copyDataSetMember and copyDataSet for Zowe Explorer copy/paste, backed by the copyDataset JSONRPC
  • Added allocateLikeDataSet so Explorer’s “allocate like” step can run before copy -> validates that the source data set exists and rejects RECFM=U. creation/allocation of a missing target is intended to be handled on the server during copyDataset
  • Supports PDS-to-PDS, member-to-member, and sequential-to-sequential copies, with --replace and --deleteTargetMembers

SDK:

  • ds.copyDataset client method and request/response types; unit tests for RPC shape

CLI:

  • zowe zssh copy ds calling the same copyDataset path + tests

Native/c:

  • registers copyDataset and maps JSON to the existing ds copy handler

How to Test

Review Checklist
I certify that I have:

Additional Comments

Signed-off-by: Amber <amber.torrise@broadcom.com>
@github-project-automation github-project-automation Bot moved this to New Issues in Zowe CLI Squad Apr 8, 2026
@zowe-robot zowe-robot moved this from New Issues to Review/QA in Zowe CLI Squad Apr 8, 2026
@ATorrise ATorrise changed the title frontend + rpc copy frontend Apr 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

@ATorrise ATorrise marked this pull request as draft April 8, 2026 17:15
@zowe-robot zowe-robot moved this from Review/QA to In Progress in Zowe CLI Squad Apr 8, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 8, 2026

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@ATorrise ATorrise marked this pull request as ready for review April 8, 2026 18:34
@zowe-robot zowe-robot moved this from In Progress to Review/QA in Zowe CLI Squad Apr 8, 2026
Copy link
Copy Markdown
Member

@t1m0thyj t1m0thyj 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 splitting out PRs - makes it easier to review ❤️ Left a few comments

Comment thread native/c/server/rpc_commands.cpp
Comment thread packages/cli/src/copy/data-set/DataSet.handler.ts
Comment thread packages/sdk/package.json

/**
* Zowe Explorer “allocate like” step before copy: validates the model data set exists and is not RECFM=U.
* Does not allocate; actual allocation happens on the server during `copyDataset` when the target is new.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for documenting this limitation 👍 The current implementation should work for copy operations. I think we'll want to create an issue to fully support "Allocate Like" in the future.

Comment on lines +482 to +483
const r = response as ds.CopyDatasetResponse & { stderr?: string; message?: string };
const detail = r.stderr?.trim() || r.message?.trim();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same comment as above about stderr and message - I think we should catch errors instead of checking these properties.

Comment on lines +316 to 321
* Does not allocate; actual allocation happens on the server during `copyDataset` when the target is new.
*
* @param _targetDataSetName Target name Explorer passes for the next step; unused here.
* @param likeDataSetName Model data set name to validate
*/
public async allocateLikeDataSet(
Copy link
Copy Markdown
Member

@zFernand0 zFernand0 Apr 9, 2026

Choose a reason for hiding this comment

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

Regardless of how copyDataset is handled in the backend...
Shouldn't we call await (await this.client).ds.createDataset inside this function?
Otherwise it seems like we are only listing data sets when calling this function. 🤔

}
}

public async copyDataSet(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add TSDoc for copyDataSetMember and copyDataSet to explain the parameters and expected behavior/return values

}

if (sourceDs.recfm === "U") {
Gui.errorMessage("RECFM=U data sets are not supported for copy operations");
Copy link
Copy Markdown
Member

@traeok traeok Apr 13, 2026

Choose a reason for hiding this comment

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

I see we are displaying an error regarding RECFM=U, and then returning the same error details as an unsuccessful response. However, I'm not seeing this error when copying a data set member from one RECFM=FB PDS to a RECFM=U PDS:

Image

When I copy and paste a RECFM=U PDS under a new name, I see the user-friendly error in addition to this null error:

Image

I don't think users would expect the null error, so we should try to hide/remove it. The RECFM=U error message looks good 👍

@zFernand0 zFernand0 mentioned this pull request Apr 17, 2026
4 tasks
@ATorrise ATorrise closed this Apr 20, 2026
@github-project-automation github-project-automation Bot moved this from Review/QA to Closed in Zowe CLI Squad Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

5 participants