zowe / zowe-explorer-vscode

Visual Studio Code Extension for Zowe, which lets users interact with z/OS Data Sets, Unix System Services, and Jobs on a remote mainframe instance. Powered by Zowe SDKs.
Eclipse Public License 2.0
159 stars 89 forks source link

Issue Unix Command API changes #2866

Closed likhithanimma1 closed 2 months ago

likhithanimma1 commented 2 months ago

Proposed changes

Making the sshSession parameter optional for issueUnixCommand Api so that profiles that doesn't require ssh can also have it.

Release Notes

Milestone:

Changelog:

Types of changes

What types of changes does your code introduce to Zowe Explorer? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the reviewer

Further comments

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 91.00000% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 93.47%. Comparing base (505e6c4) to head (8fa0582).

Files Patch % Lines
...es/zowe-explorer/src/command/UnixCommandHandler.ts 90.72% 9 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## next #2866 +/- ## ========================================== - Coverage 93.51% 93.47% -0.05% ========================================== Files 121 121 Lines 10732 10740 +8 Branches 2246 2249 +3 ========================================== + Hits 10036 10039 +3 - Misses 695 700 +5 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 2 months ago

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

zFernand0 commented 2 months ago

Apologies in advance for bringing up (again) the conversation about the sshSession being optional. For context, Trae (https://github.com/zowe/zowe-explorer-vscode/pull/2830#discussion_r1567767722) and I (https://github.com/zowe/zowe-explorer-vscode/pull/2830#pullrequestreview-1995169674) left a comment on the previous PR.

Since an extender can call the API directly, I'm curious as to why we made sshSession optional without providing a suitable replacement. Here are some examples:

There may be other ways to provide such functionality without requiring an SSH session 😋

Could someone help me understand this a bit better? 😋

JillieBeanSim commented 2 months ago

Hey @zFernand0 if there are other ways to issue a unix command using the zosmf profile we can add that, but when this was first discussed as a new functionality using the ssh profile with zosmf was the path forward. Since some extenders don't require the ssh profile to issue unix commands, similar to TSO commands with check of TSO profile for account number, the passing of the session is an optional parameter. I don't believe there would be a replacement value sent for extenders that don't need it since they can grab this.session like other APIs for the service session information on demand.

zFernand0 commented 2 months ago

Thanks for providing more details. I see, I guess I never considered the possibility to call the ZoweExplorerZosmfApi.issueUnixCommand without a session since it may fail with an ugly cannot read property of undefined 😋