-
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
Conversation
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2433 +/- ##
==========================================
- Coverage 91.50% 91.50% -0.01%
==========================================
Files 641 641
Lines 18376 18414 +38
Branches 3872 3885 +13
==========================================
+ Hits 16815 16849 +34
- Misses 1559 1562 +3
- Partials 2 3 +1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
a439165
to
c62d262
Compare
Signed-off-by: Pujal Gandhi <71276682+pujal0909@users.noreply.github.com>
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
📅 Suggested merge-by date: 2/27/2025 |
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
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.
Changes LGTM, thanks @pujal0909 for adding the truncation warning!
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.
LGTM! 😋
I'm curious to know if it would be possible to add a progress bar.
Trying to copy a PDS with almost 200 members looks like the command hands 😋
Also... I'm afraid that some errors are not being shown 🤔
As a final test, I let it run and here is what happened:
Here you can see that the command result only mentions the members that it was able to copy. (24 out of 193)
But it didn't mention the members that were not copied. likely due to not having enough space on the target PDF 🙏
All of that said, I do believe that this PR does handle quite a bit of scenarios and we could tackle these edge cases in a separate issue 🙏
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
const truncatedMembersFile = path.join(tmpdir(), 'truncatedMembers.txt'); | ||
if(truncatedMembers.length > 0) { | ||
const firstTenMembers = truncatedMembers.slice(0, 10); | ||
fs.writeFileSync(truncatedMembersFile, truncatedMembers.join('\n'), {flag: 'w'}); |
Check failure
Code scanning / CodeQL
Insecure temporary file High
the os temp dir
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.
We've already determined that we are fine with writing the list of truncated members in a temporary file : )
Ideally we would make sure the file permissions are 600
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.
We've already determined that we are fine with writing the list of truncated members in a temporary file : )
Ideally we would make sure the file permissions are 600
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
Reminder: This pull request has a merge-by date coming up within the next 24 hours. Please review this PR as soon as possible. @awharn @adam-wolfe @jace-roell @ATorrise @t1m0thyj @anaxceron |
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
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.
Left a couple comments re: changelog.
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
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.
Nice changelogs! Thanks @pujal0909!
|
I believe these requested-changes were addressed 🙏
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?