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

Add encoding to job spool operations #1822

Merged
merged 11 commits into from May 15, 2024
Merged

Conversation

awharn
Copy link
Member

@awharn awharn commented Oct 12, 2023

What It Does
Add encoding option to download and view of job spool files

How to Test
Run automated tests, or download a spool file with a different encoding

Review Checklist
I certify that I have:

Additional Comments

Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
@awharn awharn marked this pull request as ready for review May 13, 2024 17:10
Copy link

codecov bot commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.12%. Comparing base (11008bc) to head (7ac79a6).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1822   +/-   ##
=======================================
  Coverage   91.12%   91.12%           
=======================================
  Files         636      636           
  Lines       19035    19040    +5     
  Branches     4009     4011    +2     
=======================================
+ Hits        17346    17351    +5     
  Misses       1688     1688           
  Partials        1        1           

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

Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
@awharn awharn requested a review from anaxceron May 14, 2024 14:27
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.

Requesting a small update for the release note.

@@ -2,6 +2,10 @@

All notable changes to the Zowe CLI package will be documented in this file.

## Recent Changes

- Enhancement: Added the ability to download job spool files using other codepages with `--encoding` on the `zowe jobs download output`, `zowe jobs view spool-file-by-id` and `zowe jobs view all-spool-content` commands. [#1822](https://github.com/zowe/zowe-cli/pull/1822)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a benefit to the user to this note? What does this change accomplish?

Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
@awharn awharn requested a review from anaxceron May 14, 2024 17:57
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.

Looks great, thanks @awharn!

@@ -35,6 +35,7 @@ describe("zos-jobs view spool-file-by-id handler", () => {

afterEach(() => {
jest.resetAllMocks();
DEFAULT_PARAMETERS.arguments.encoding = undefined; // Why is this needed? Where are things being set???
Copy link
Member

Choose a reason for hiding this comment

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

Is this a todo comment or is it ok to leave for now? 😋

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, I wrote that 7 months ago, so I don't really know. I vaguely recall being frustrated because I could not find where that parameter was being set.

Copy link
Member Author

Choose a reason for hiding this comment

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

I figured it out, it was because we weren't deep cloning objects, but were instead assigning them to new objects. The sub-objects were being passed by reference and polluting the results of other tests. We might want to look into any instances where we are using Object.assign({}, in the future.

packages/zosjobs/src/DownloadJobs.ts Outdated Show resolved Hide resolved
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
Copy link

sonarcloud bot commented May 15, 2024

@awharn awharn merged commit 137cc73 into master May 15, 2024
19 checks passed
@awharn awharn deleted the fix-encodings-and-newlines branch May 15, 2024 17:41
@awharn awharn mentioned this pull request May 15, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

None yet

6 participants