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

only showing command output in stdout for zowe uss issue cmd #1776

Closed
wants to merge 58 commits into from

Conversation

ATorrise
Copy link
Contributor

@ATorrise ATorrise commented Aug 4, 2023

What It Does
Fixes Issue #1724

How to Test
Run any command with zowe uss issue cmd "chosenCommand" --rfj and verify that $chosenCommand isn't present in the stdout of the json response.

Review Checklist
I certify that I have:

Additional Comments
Newline padding removal has been left out of this fix. This is because line endings appear to vary across systems and commands and rather than attempt to remove these endings and cause some unintended break, it seems easier to have the end user remove this information if they choose.

Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.05% 🎉

Comparison is base (067402c) 92.82% compared to head (5a06541) 92.88%.
Report is 11 commits behind head on master.

❗ Current head 5a06541 differs from pull request most recent head 81d7dab. Consider uploading reports for the commit 81d7dab to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1776      +/-   ##
==========================================
+ Coverage   92.82%   92.88%   +0.05%     
==========================================
  Files         423      423              
  Lines        7191     7193       +2     
  Branches     1319     1320       +1     
==========================================
+ Hits         6675     6681       +6     
+ Misses        515      511       -4     
  Partials        1        1              
Files Changed Coverage Δ
packages/zosuss/src/Shell.ts 95.60% <100.00%> (+4.59%) ⬆️

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

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.

left a few comments,
Not sure what to do about the $ since I can't seem to find how to change it on my USS session.

packages/zosuss/src/Shell.ts Outdated Show resolved Hide resolved
packages/zosuss/src/Shell.ts Outdated Show resolved Hide resolved
packages/zosuss/src/Shell.ts Outdated Show resolved Hide resolved
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Copy link
Contributor

@adam-wolfe adam-wolfe left a comment

Choose a reason for hiding this comment

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

When I build and install this branch I am not seeing any output from issuing ssh commands.

With this branch:

PS C:\Users\me\GitRepos\zowe-cli\packages\cli> npm install -g

removed 278 packages, changed 1 package, and audited 3 packages in 5s

found 0 vulnerabilities
PS C:\Users\me\GitRepos\zowe-cli\packages\cli> zowe ssh issue cmd "echo hello;echo hello"

PS C:\Users\me\GitRepos\zowe-cli\packages\cli> zowe ssh issue cmd "echo hello;echo hello" --rfj
{
  "success": true,
  "exitCode": 0,
  "message": "",
  "stdout": "\n",
  "stderr": "",
  "data": {}
}

With latest from npmjs:

PS C:\Users\me\GitRepos\zowe-cli\packages\cli> npm install -g @zowe/cli

added 278 packages, changed 1 package, and audited 280 packages in 23s

13 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
PS C:\Users\me\GitRepos\zowe-cli\packages\cli> zowe ssh issue cmd "echo hello;echo hello"

$ hello
hello
PS C:\Users\me\GitRepos\zowe-cli\packages\cli> zowe ssh issue cmd "echo hello;echo hello" --rfj
{
  "success": true,
  "exitCode": 0,
  "message": "",
  "stdout": "\r\n$ hello\r\nhello\n",
  "stderr": "",
  "data": {}
}

Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
traeok and others added 24 commits August 24, 2023 10:33
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
…age.json

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
@sonarcloud
Copy link

sonarcloud bot commented Aug 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

100.0% 100.0% Coverage
0.0% 0.0% Duplication

author Amber Torrise <amber.torrise@broadcom.com> 1692649904 -0400
committer Amber Torrise <amber.torrise@broadcom.com> 1692887847 -0400

Increasing code coverage

Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
@ATorrise ATorrise closed this Aug 24, 2023
@ATorrise ATorrise deleted the removeCmdFromStdout branch August 24, 2023 15:17
@ATorrise ATorrise restored the removeCmdFromStdout branch August 24, 2023 15:18
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.

zos-ssh command returns even the prompt and issuing command in stdout
6 participants