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

Treat special chars and more #3728

Merged
merged 14 commits into from
Feb 20, 2024
Merged

Treat special chars and more #3728

merged 14 commits into from
Feb 20, 2024

Conversation

Martin-Zeithaml
Copy link
Contributor

@Martin-Zeithaml Martin-Zeithaml commented Feb 6, 2024

Please check if your PR fulfills the following requirements. This is simply a reminder of what we are going to look for before merging your PR. If you don't know all of this information when you create this PR, don't worry. You can edit this template as you're working on it.

  • DCO signoffs have been added to all commits, including this PR

PR type

What type of changes does your PR introduce to Zowe? Put an x in the box that applies to this PR. If you're unsure about any of them, don't hesitate to ask.

  • Bugfix

Relevant issues

Fixes #3648

Changes proposed in this PR

  • New string functions to escape special chars
  • Configmgr stripMemberName can handle special chars now
  • Various zos-dataset functions can handle dollar sign
  • tsoCommand will finally work due to proper syntax
  • TypeScript only
Bonus (for free)
  • apf command will work!
  • Message ZWEL0134E will be displayed correctly!
  • changeTag is changing the tag!

Does this PR introduce a breaking change?

  • No

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

Better experience.

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Feb 6, 2024

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

Copy link

github-actions bot commented Feb 6, 2024

Test workflow 3898 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4471-20240206143517.pax
Running on machine: zzow07
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7801355161

@Martin-Zeithaml Martin-Zeithaml changed the title Treat special chars Treat special chars [DO NOT MERGE] Feb 6, 2024
Copy link

github-actions bot commented Feb 6, 2024

Test workflow 3899 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4471-20240206143517.pax
Running on machine: zzow06
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7801656709

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Feb 6, 2024

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

Copy link

github-actions bot commented Feb 6, 2024

Test workflow 3900 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4472-20240206151501.pax
Running on machine: zzow08
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7801900825

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Feb 6, 2024

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

Copy link

github-actions bot commented Feb 6, 2024

Test workflow 3902 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4473-20240206153624.pax
Running on machine: zzow07
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7802204447

Copy link

github-actions bot commented Feb 6, 2024

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

Copy link

github-actions bot commented Feb 6, 2024

Test workflow 3903 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4475-20240206162553.pax
Running on machine: zzow07
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7802873590

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Feb 7, 2024

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

@Martin-Zeithaml Martin-Zeithaml changed the title Treat special chars [DO NOT MERGE] Treat special chars and more Feb 7, 2024
Copy link

github-actions bot commented Feb 7, 2024

Test workflow 3910 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4481-20240207080408.pax
Running on machine: zzow08
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7811677218

Copy link

github-actions bot commented Feb 7, 2024

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

Copy link

github-actions bot commented Feb 7, 2024

Test workflow 3913 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4483-20240207153920.pax
Running on machine: zzow06
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7817330966

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Feb 8, 2024

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

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Feb 9, 2024

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

Copy link

github-actions bot commented Feb 9, 2024

Test workflow 3931 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4503-20240209154927.pax
Running on machine: zzow07
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7846364735

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Feb 12, 2024

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

Copy link

github-actions bot commented Feb 12, 2024

Test workflow 3944 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4516-20240212103412.pax
Running on machine: zzow07
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7870452997

@Martin-Zeithaml Martin-Zeithaml changed the title Treat special chars and more [WIP] Treat special chars and more Feb 12, 2024
export function escapeDollar(str: string): string | undefined {
if (str === null || str === undefined)
return undefined;
return str.replace(/[$]/g, '\\$&');
Copy link
Member

Choose a reason for hiding this comment

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

can you explain what the ampersand '&' does here?
I'm not familiar with it and a quick search didnt tell me why it is here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Explanation here.

$& = inserts the matched substring.

It is better to show on the second replacement:
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');: any character from [] found, replace by backslash and that character.

The first replace is just for one char, but the replacement is in general form. It can be changed to str.replace(/[$]/g, '\\$'); if it makes the code better to read. This or that, it will work the same.

Copy link
Member

Choose a reason for hiding this comment

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

okay now i understand. i thought $& was a shell thing, i didn't realize it was a javascript thing.

Copy link

github-actions bot commented Feb 14, 2024

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

Copy link

github-actions bot commented Feb 14, 2024

Test workflow 3972 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4542-20240214214241.pax
Running on machine: zzow06
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7907763162

@Martin-Zeithaml Martin-Zeithaml changed the title Treat special chars and more Treat special chars and more [DO NOT MERGE] Feb 15, 2024
Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Feb 15, 2024

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

@Martin-Zeithaml
Copy link
Contributor Author

This commit is changing the behavior of copyMvsToUss to strictly use input parameters as text. I think, this was original intention. If we want to be able to use/expand variables, it should be done in another function with name or parameters suggesting that the special chars will be exapanded.

@Martin-Zeithaml Martin-Zeithaml changed the title Treat special chars and more [DO NOT MERGE] Treat special chars and more Feb 15, 2024
Copy link

github-actions bot commented Feb 15, 2024

Test workflow 3981 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4551-20240215151504.pax
Running on machine: zzow07
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7918134713

@@ -109,7 +109,7 @@ export function ensureFileEncoding(file: string, expectedSample: string, expecte
}
}
common.printTrace(`- Remove encoding tag of ${file}.`);
zos.changeTag(file, 0);
Copy link
Member

Choose a reason for hiding this comment

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

Will this cause any change in zwe performance?

Copy link

github-actions bot commented Feb 15, 2024

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

Copy link

github-actions bot commented Feb 15, 2024

Test workflow 3982 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/2.15.0-PR-3728/zowe-2.15.0-pr-3728-4552-20240215211327.pax
Running on machine: zzow08
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/7922369831

@MarkAckert MarkAckert merged commit f4f61a7 into v2.x/staging Feb 20, 2024
9 checks passed
@MarkAckert MarkAckert deleted the v2.x/bugfix/Dollar branch February 20, 2024 17:43
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.

bin/libs/zos-dataset.ts: tsoCommand and dollar sign in dataset name
4 participants