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

fix to disallow invalid characters in filenames #142

Merged
merged 9 commits into from
Oct 30, 2023
Merged

Conversation

ATorrise
Copy link
Contributor

@ATorrise ATorrise commented Oct 19, 2023

What It Does
Provides a fix for issue143 by throwing an error when using invalid filenames so the progress bar doesn't loop indefinitely from the unhandled case of emojis and other invalid characters in dataset names. Depends on zowe-cli PR 1831 - unit tests will fail until this PR is merged in.

How to Test
Tested with the following launch.json configurations


    {
        "type": "node",
        "request": "launch",
        "name": "ftp download ds",
        "program": "${workspaceFolder}/packages/cli/lib/main.js",
        "console": "integratedTerminal",
        "args": ["zos-ftp", "download", "data-set", <realTestingDataSetName>, "-f", "testing.txt^B", "--secure-ftp", "false"],
        "outputCapture": "std",
        "resolveSourceMapLocations": null
    }

Expected response: Data set downloaded successfully. testing.txt^B


        "args": ["zos-ftp", "download", "data-set", <realTestingDataSetName>, "-f", "testing.txt☻", "--secure-ftp", "false"],

Expected response: Command Error: Invalid file name. Please check the file name for typos.


        "args": ["zos-ftp", "download", "data-set", <realTestingDataSetName>, "-f", "testing.txt", "--secure-ftp", "false"],

Expected response: Data set downloaded successfully. testing.txt

Review Checklist
I certify that I have:

@ATorrise ATorrise self-assigned this Oct 19, 2023
@ATorrise ATorrise marked this pull request as draft October 19, 2023 19:18
@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Files Coverage Δ
src/cli/download/data-set/DataSet.Handler.ts 100.00% <100.00%> (+5.26%) ⬆️
src/cli/Utilities.ts 87.50% <87.50%> (ø)

📢 Thoughts on this report? Let us know!.

Copy link
Collaborator

@std4lqi std4lqi left a comment

Choose a reason for hiding this comment

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

Only one minor comments. Thanks!

src/cli/Utilities.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@std4lqi std4lqi left a comment

Choose a reason for hiding this comment

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

A minor comment. Thanks, @ATorrise !

src/cli/download/data-set/DataSet.Handler.ts Outdated Show resolved Hide resolved
Signed-off-by: Amber Torrise <[email protected]>
@ATorrise ATorrise marked this pull request as ready for review October 24, 2023 19:40
@sonarcloud
Copy link

sonarcloud bot commented Oct 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

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

@zowe/cli version update required
waiting for this workflow run to complete and for a new version out of this PR


Now we only need to update the CLI version: @zowe/[email protected]

@zFernand0 zFernand0 merged commit 575e6e1 into master Oct 30, 2023
18 checks passed
@zFernand0 zFernand0 deleted the typoLoop_Fix branch October 30, 2023 19:49
@zFernand0 zFernand0 added the release-patch Indicates a patch to existing code has been applied label Oct 30, 2023
Copy link

Release succeeded for the master branch. 🎉

The following packages have been published:

Powered by Octorelease 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-patch Indicates a patch to existing code has been applied released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

indefinite progress bar when name typo in zowe zos-ftp download data-set
4 participants