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

Identical member names - PDS enhancement #2427

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

Conversation

pujal0909
Copy link
Contributor

@pujal0909 pujal0909 commented Feb 3, 2025

What It Does

When copying PDSs, if the source and target have identical member names, the default behavior now is to prompt the user to confirm before overwriting the members contents (when the safe-replace option is not set to true). If the user uses the replace flag, it bypasses the prompt.

How to Test

  1. Copy a source PDS into a target PDS, with both having members with the same names.
  2. Notice that a prompt appears where you can select 'y/N'
  3. Now copy the same source PDS into the same target PDS with the replace option.
  4. Notice that the prompt is skipped

Review Checklist
I certify that I have:

Additional Comments

Signed-off-by: Pujal <[email protected]>
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.38%. Comparing base (59b1fc5) to head (476f2a1).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2427   +/-   ##
=======================================
  Coverage   91.37%   91.38%           
=======================================
  Files         639      639           
  Lines       18280    18298   +18     
  Branches     3847     3850    +3     
=======================================
+ Hits        16703    16721   +18     
  Misses       1575     1575           
  Partials        2        2           

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

Signed-off-by: Pujal <[email protected]>
@pujal0909 pujal0909 marked this pull request as ready for review February 4, 2025 14:55
Copy link

github-actions bot commented Feb 4, 2025

📅 Suggested merge-by date: 2/18/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 some comments, please review.

packages/cli/src/zosfiles/copy/ds/Ds.handler.ts Outdated Show resolved Hide resolved
packages/cli/src/zosfiles/copy/ds/Ds.handler.ts Outdated Show resolved Hide resolved
packages/cli/src/zosfiles/copy/ds/Ds.handler.ts Outdated Show resolved Hide resolved
packages/zosfiles/CHANGELOG.md Outdated Show resolved Hide resolved
packages/cli/CHANGELOG.md Outdated Show resolved Hide resolved
packages/zosfiles/CHANGELOG.md Outdated Show resolved Hide resolved
@pujal0909 pujal0909 changed the title Like named PDS members enhancement Identical member names - PDS enhancement Feb 7, 2025
@pujal0909 pujal0909 requested a review from traeok February 7, 2025 16:25
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 did leave some comments for possible improvements, but I do like the code as-is and works as expected 🙏

fromPds: string,
toPds: string
): Promise <boolean> {
const sourceResponse = await List.allMembers(session, fromPds);
Copy link
Member

Choose a reason for hiding this comment

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

I do like how clean this implementation looks! 🙏
And I know this might be a bit picky, but in order to minimize the number of calls to the mainframe, could we cache this call?
await List.allMembers(session, fromPds);

or perhaps return it as part of the function too? 😅

That way, the copyPDS doesn't have to make the same call to get the list of members from the fromPds` 😋

packages/cli/CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Pujal <[email protected]>
Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

Changes LGTM, thanks @pujal0909 for enhancing the copy PDS command!

@pujal0909 pujal0909 requested a review from jace-roell February 12, 2025 01:03
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.

4 participants