-
Notifications
You must be signed in to change notification settings - Fork 87
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
Record lines truncation of target PDS Enhancement #2433
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Pujal <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2433 +/- ##
==========================================
- Coverage 91.50% 91.49% -0.01%
==========================================
Files 641 641
Lines 18376 18392 +16
Branches 3872 3877 +5
==========================================
+ Hits 16815 16828 +13
- Misses 1559 1561 +2
- Partials 2 3 +1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Pujal <[email protected]>
Signed-off-by: Pujal <[email protected]>
Signed-off-by: Pujal <[email protected]>
Signed-off-by: Pujal <[email protected]>
a439165
to
c62d262
Compare
Signed-off-by: Pujal Gandhi <[email protected]>
Signed-off-by: Pujal <[email protected]>
Signed-off-by: Pujal <[email protected]>
Signed-off-by: Pujal <[email protected]>
Signed-off-by: Pujal <[email protected]>
📅 Suggested merge-by date: 2/27/2025 |
If we already warn users that some members were truncated from the copy operation, what are your thoughts on listing the affected members as part of the CLI response? Otherwise, users are forced to locate & open the local file to see what members were truncated. If there were more than, say, 10 members, we could print so many and then add This isn't a request for changes, but I wanted to propose this as an option for warning the user - this may also help with identifying the troublesome members when copying within a CI environment. |
Signed-off-by: Pujal <[email protected]>
ZosFilesMessages.datasetCopiedSuccessfully.message + " " + | ||
ZosFilesMessages.membersContentTruncated.message + "\n\n" + | ||
firstTenMembers.join('\n') + | ||
`\n... and ${numMembers} more` + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this logic result in the message "and 0 more" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would. Should that part of the response be removed for the case of when there are not more than ten truncated members? I wasn't sure if the inconsistent response would be confusing for users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely a judgement call. If I were to hit the edge-case of exactly 10, I would think it odd to be told that "0 more" occurred. Alternatively if someone were automating on the output, it might be useful to know that "x more" would always be part of the message. I lean to removing the message when it would display "0 more". Perhaps wait a bit to see if others offer opinions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree that adding "...and X more" should only be included if X is greater than 1
Signed-off-by: Pujal <[email protected]>
const truncatedMembersFile = path.join(tmpdir(), 'truncatedMembers.txt'); | ||
if(truncatedMembers.length > 0) { | ||
const firstTenMembers = truncatedMembers.slice(0, 10); | ||
fs.writeFileSync(truncatedMembersFile, truncatedMembers.join('\n')); |
Check failure
Code scanning / CodeQL
Insecure temporary file High
the os temp dir
Signed-off-by: Pujal <[email protected]>
Signed-off-by: Pujal <[email protected]>
it("Should copy a partitioned data set", async () => { | ||
let error; | ||
let response; | ||
|
||
const truncatedMembersFile = path.join(tmpdir(), 'truncatedMembers.txt'); | ||
fs.writeFileSync(truncatedMembersFile, ""); |
Check failure
Code scanning / CodeQL
Insecure temporary file High test
the os temp dir
Signed-off-by: Pujal <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreeing with your discussion with Gene that your truncation response should only include an attached file if truncated items list is greater than 10.
…ssages when x is 0 Signed-off-by: Pujal <[email protected]>
Signed-off-by: Pujal <[email protected]>
|
What It Does
In the scenario when copying from a source PDS to a target PDS where the target does not have enough record lines for a member, initially, it would copy over that member, truncate it's record length, throw a truncation error and would not continue copying over the subsequent members. Now, it will continue copying over the subsequent members and inform the user that member(s)' contents were truncated and they can view the list of members affected in a local file.
How to Test
Review Checklist
I certify that I have:
Additional Comments
Should this technically be a bug fix?
Should the Github security suggestion about using the tmp library be ignored?