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 Submit Jobs CLI and APIs (local-file and stdin) #2139

Merged
merged 9 commits into from
May 15, 2024

Conversation

awharn
Copy link
Member

@awharn awharn commented May 13, 2024

What It Does

Adds additional options for jobs submitted from a user's computer, such as:

  • Logical Record Length
  • Block Size
  • Internal Reader Encoding

Removes duplication among the Jobs interfaces in a non-breaking way

Resolves #742 (--job-encoding IBM-037)
Resolves #876 (--job-encoding IBM-1147)

How to Test

Review Checklist
I certify that I have:

Additional Comments

Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
@awharn awharn self-assigned this May 13, 2024
Copy link

codecov bot commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.13%. Comparing base (7ac79a6) to head (7ee1b35).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2139   +/-   ##
=======================================
  Coverage   91.12%   91.13%           
=======================================
  Files         636      636           
  Lines       19040    19046    +6     
  Branches     4011     3947   -64     
=======================================
+ Hits        17351    17357    +6     
  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>
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>
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
@awharn awharn marked this pull request as ready for review May 14, 2024 14:27
@awharn awharn changed the title Add encoding to Submit Jobs CLI and APIs Add encoding to Submit Jobs CLI and APIs (local-file and stdin) May 14, 2024
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
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 good!

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.

LGTM, thanks Andrew!

I mentioned the possibility of an extender using something like keyof ISubmitParms to accept certain key names in a function. Since the changes still keep all existing properties in the same interfaces, this should not be breaking. Once the new keys are available, extenders can choose to handle them at their own discretion.

Copy link
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.

Looks pretty good, thanks @awharn! Left a few comments

Comment on lines 68 to 77
--job-record-length | --jrl (number)

The logical record length of the submitted JCL. Defaults to 80 if not supplied.

--job-record-format | --jrf (string)

The record format of the JCL being submitted, where V is variable, and F is
fixed. Defaults to F if not supplied.

Allowed values: F, V
Copy link
Member

Choose a reason for hiding this comment

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

Should we set defaultValue on the command option definitions for --job-record-length and --job-record-format? This would automatically show the default value in CLI help and the sentence "Defaults to ..." could be removed.

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, the defaults I listed are the z/OSMF defaults if you don't send anything. I wasn't sure if we just wanted z/OSMF to handle it, or if we want to copy their default into the CLI.

Comment on lines 96 to 105
--job-record-length | --jrl (number)

The logical record length of the submitted JCL. Defaults to 80 if not supplied.

--job-record-format | --jrf (string)

The record format of the JCL being submitted, where V is variable, and F is
fixed. Defaults to F if not supplied.

Allowed values: F, V
Copy link
Member

Choose a reason for hiding this comment

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

Same question as above for setting default values

@@ -152,6 +159,9 @@ export class SubmitJobs {
const extraHeaders = this.getSubstitutionHeaders(parms.jclSymbols);
headers.push(...extraHeaders);
}
if (parms.internalReaderFileEncoding) {
headers.push({"X-IBM-Intrdr-File-Encoding": parms.internalReaderFileEncoding});
Copy link
Member

Choose a reason for hiding this comment

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

Should we add the header name as a constant in ZosmfHeaders so we don't need to hardcode it here?

export class ZosmfHeaders {
/**
* lrecl header
* @static
* @memberof ZosmfHeaders
*/
public static readonly X_IBM_INTRDR_LRECL = "X-IBM-Intrdr-Lrecl";
/**
* recfm header
* @static
* @memberof ZosmfHeaders
*/
public static readonly X_IBM_INTRDR_RECFM = "X-IBM-Intrdr-Recfm";

Copy link
Member Author

Choose a reason for hiding this comment

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

We could, but this is the only place that we use that header.

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

LGTM, thanks @awharn!

…oding

Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
@awharn awharn merged commit eb92768 into master May 15, 2024
18 checks passed
@awharn awharn deleted the add-submit-jobs-encoding branch May 15, 2024 18:27
@awharn awharn added the release-minor Indicates a minor feature has been added label May 15, 2024
Copy link

sonarcloud bot commented May 15, 2024

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

Copy link

Release succeeded for the master branch. 🎉

The following packages have been published:

  • npm: @zowe/core-for-zowe-sdk@7.25.0
  • npm: @zowe/provisioning-for-zowe-sdk@7.25.0
  • npm: @zowe/zos-console-for-zowe-sdk@7.25.0
  • npm: @zowe/zos-files-for-zowe-sdk@7.25.0
  • npm: @zowe/zos-logs-for-zowe-sdk@7.25.0
  • npm: @zowe/zosmf-for-zowe-sdk@7.25.0
  • npm: @zowe/zos-workflows-for-zowe-sdk@7.25.0
  • npm: @zowe/zos-jobs-for-zowe-sdk@7.25.0
  • npm: @zowe/zos-tso-for-zowe-sdk@7.25.0
  • npm: @zowe/cli@7.25.0

Powered by Octorelease 🚀

@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
release-minor Indicates a minor feature has been added released
Projects
Status: Closed
5 participants