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

zwe init typescript edition #3135

Closed
wants to merge 58 commits into from

Conversation

1000TurquoisePogs
Copy link
Member

  • Tests for the changes have been added (for bug fixes / features)
  • DCO signoffs have been added to all commits, including this PR

PR type

  • Feature

Changes proposed in this PR

  • This adds all zwe init commands into configmgr editions except for zwe init certificate because it requires a whole lot more code.

Does this PR introduce a breaking change?

  • No

Does this PR do something the person installing Zowe should know about?

This is quite a bit of code and the tmp files it writes out are very important to check for correctness, so do not merge this yet, it is still being tested and then test cases will be stated.

Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
@1000TurquoisePogs 1000TurquoisePogs changed the base branch from v2.x/master to v2.x/staging October 31, 2022 19:40
@github-actions
Copy link

github-actions bot commented Oct 31, 2022

PAX build 2246 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/3364233819

Signed-off-by: 1000TurquoisePogs <[email protected]>
@github-actions
Copy link

github-actions bot commented Nov 1, 2022

PAX build 2249 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/3371811829

Signed-off-by: 1000TurquoisePogs <[email protected]>
@github-actions
Copy link

github-actions bot commented Nov 1, 2022

PAX build 2250 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/3372541060

Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

PAX build 2272 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/3419586377

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

Test workflow 1831 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.5.0-PR-3135/zowe-2.5.0-pr-3135-2272-20221108130328.pax
Running on machine: zzow02
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/3419640426

…-packaging into feature/v2/zwe-init-ts

Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

PAX build 2274 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/3421013087

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

Test workflow 1833 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.5.0-PR-3135/zowe-2.5.0-pr-3135-2274-20221108155839.pax
Running on machine: zzow02
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/3421066040

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

PAX build 2275 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/3422500515

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

Test workflow 1834 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.5.0-PR-3135/zowe-2.5.0-pr-3135-2275-20221108192517.pax
Running on machine: zzow04
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/3422543198

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

github-actions bot commented Nov 3, 2023

Test workflow 3476 is started.
Running install test: Keyring
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.13.0-PR-3135/zowe-2.13.0-pr-3135-3974-20231102075046.pax
Running on machine: zzow04
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/6734552588

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

github-actions bot commented Nov 3, 2023

PAX build 3981 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/6745455143

Copy link

github-actions bot commented Nov 3, 2023

Test workflow 3482 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.13.0-PR-3135/zowe-2.13.0-pr-3135-3981-20231103130317.pax
Running on machine: zzow03
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/6745542706

Copy link

github-actions bot commented Nov 3, 2023

Test workflow 3483 is started.
Running install test: Keyring
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.13.0-PR-3135/zowe-2.13.0-pr-3135-3981-20231103130317.pax
Running on machine: zzow04
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/6746509003

Copy link

github-actions bot commented Nov 6, 2023

PAX build 3988 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/6770371294

Copy link

github-actions bot commented Nov 6, 2023

Test workflow 3490 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.13.0-PR-3135/zowe-2.13.0-pr-3135-3988-20231106120259.pax
Running on machine: zzow04
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/6770437096

Copy link

github-actions bot commented Nov 6, 2023

Test workflow 3493 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.13.0-PR-3135/zowe-2.13.0-pr-3135-3988-20231106120259.pax
Running on machine: zzow02
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/6770937611

Copy link

github-actions bot commented Nov 6, 2023

Test workflow 3493 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.13.0-PR-3135/zowe-2.13.0-pr-3135-3988-20231106120259.pax
Running on machine: zzow02
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/6770937611

@Martin-Zeithaml
Copy link
Contributor

certificate.sh (used by zwe init certificate) is working for fine for "good" input, but... not for my crazy testing scenarios 😄
No doubt, following examples are unrealistic, but legal (there is no schema limitation):

zowe.setup.certificate.keyring.name = "'"
zowe.setup.certificate.keyring.name = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
zowe.setup.certificate.keyring.name = "&SYSUID"
zowe.setup.certificate.keyring.name = "USER/MYRING"

The result is:

  • Unescaped single apostrophe breaks the JCL strings
  • Too long name causes the write error
  • & confuse sed and produces // SET ZOWERING='// SET ZOWERING='ZoweKeyring'SYSUID'
  • Slash confuse sed more and result is empty JCL

There is no useful schema validation for key ring name (doc I have found):

  • ACF2
    • 237 characters
    • Mixed-cased characters and special characters: (!&*¬-%_?:=.)
    • Forbidden: space
  • TSS
    • 237 characters
  • RACF
    • 237 characters
    • Forbidden: &*%
      Based on this we can only limit keyring name to 237 chars, otherwise we need to consider any char as valid.

Similar situation for the rest of the fields used in certificate.sh, like CN, OU, O, L, ...

Conclusion

  • It is working fine for "normal" input
  • I am not volunteer for fixing this in shell 😄
  • Let's do it better (some day) in Typescript

Copy link

github-actions bot commented Nov 27, 2023

PAX build 4093 FAILED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7006647798

Copy link

github-actions bot commented Dec 5, 2023

PAX build 4173 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7101876218

Copy link

github-actions bot commented Dec 5, 2023

Test workflow 3646 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.13.0-PR-3135/zowe-2.13.0-pr-3135-4173-20231205141405.pax
Running on machine: zzow03
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7101977371

@Martin-Zeithaml
Copy link
Contributor

There is a related problem to 3140:

/zowe/bin/zwe init certificate scenario4.yaml --allow-overwrite
Warning ZWEL0300W: Keyring "safkeyring:////ZWESVUSR/TESTZoweKeyring1234" will be overwritten during configuration.
Error ZWEL0106E: ca-alias parameter is required
Try --help to get information about how to use this command.
  • User gets the error message:
    • Error ZWEL0106E: ca-alias parameter is required
  • And suggestion to see help:
    • Try --help to get information about how to use this command.
  • Command executed by user is zwe init certificate, but the failing command is zwe certificate keyring-jcl clean
  • User will probably try help for zwe init certificate
    • zwe init certificate --help | grep -i 'ca-alias' -> nothing

This commit enhances:

  • the tracing to include details about executed command
  • error message

Shell tracing

- zwecli_inline_execute_command
  * certificate keyring-jcl clean --dataset-prefix ZOWE.ZWEINIT --jcllib ZOWE.ZWEINIT.JCLLIB --keyring-owner ZWESVUSR --keyring-name TESTZoweKeyring1234 --alias localhost --ca-alias  --security-product TSS
Error ZWEL0106E: ca-alias parameter is required

JavaScript tracing

- execZweSync
  * certificate keyring-jcl clean --dataset-prefix "ZOWE.ZWEINIT" --jcllib "ZOWE.ZWEINIT.JCLLIB" --keyring-owner "ZWESVUSR" --keyring-name "TESTZoweKeyring1234" --alias "localhost" --ca-alias "" --security-product "TSS"
Error ZWEL0106E: ca-alias parameter is required

JavaScript error message

  • Before: ERROR: Error ZWEL0305E: Failed to call certificate command, rc=106.
  • Now: ERROR: Error ZWEL0305E: Failed to call "certificate keyring-jcl clean" command, rc=106.

1000TurquoisePogs added a commit that referenced this pull request Feb 9, 2024
1000TurquoisePogs added a commit that referenced this pull request Feb 21, 2024
MarkAckert pushed a commit that referenced this pull request Dec 11, 2024
MarkAckert pushed a commit that referenced this pull request Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants