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

feat: Introduce integrated terminal #3079

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open

feat: Introduce integrated terminal #3079

wants to merge 49 commits into from

Conversation

zFernand0
Copy link
Member

@zFernand0 zFernand0 commented Aug 29, 2024

Proposed changes

Introduces the MVS, TSO, and Unix command handlers as integrated terminals

Release Notes

Milestone: 3.1.0

Changelog: Introduces the MVS, TSO, and Unix command handlers as integrated terminals

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds or improves functionality)
  • Breaking change (a change that would cause existing functionality to not work as expected)
  • Documentation (Markdown, README updates)
  • Other (please specify above in "Proposed changes" section)

Checklist

General

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • All PR dependencies have been merged and published (if applicable)
  • A GIF or screenshot is included in the PR for visual changes
  • The pre-publish command has been executed:
    • v2 and below: yarn workspace vscode-extension-for-zowe vscode:prepublish
    • v3: pnpm --filter vscode-extension-for-zowe vscode:prepublish

Code coverage

  • There is coverage for the code that I have added
  • I have added new test cases and they are passing
  • I have manually tested the changes

Deployment

  • I have added developer documentation (if applicable)
  • Documentation should be added to Zowe Docs
    • If you're an outside contributor, please post in the #zowe-doc Slack channel to coordinate documentation.
    • Otherwise, please check with the rest of the squad about any needed documentation before merging.
  • These changes may need ported to the appropriate branches (list here):

Further comments

Merged and published:

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 91.68766% with 33 lines in your changes missing coverage. Please review.

Project coverage is 92.99%. Comparing base (e07e839) to head (172cfe5).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...s/zowe-explorer/src/commands/UnixCommandHandler.ts 87.50% 10 Missing ⚠️
...es/zowe-explorer/src/commands/TsoCommandHandler.ts 75.00% 8 Missing ⚠️
...es/zowe-explorer/src/commands/MvsCommandHandler.ts 81.48% 5 Missing ⚠️
.../zowe-explorer/src/commands/ZoweCommandProvider.ts 96.61% 4 Missing ⚠️
...-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts 62.50% 3 Missing ⚠️
packages/zowe-explorer/src/tools/ZoweTerminal.ts 98.07% 2 Missing ⚠️
...ckages/zowe-explorer/src/configuration/Profiles.ts 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3079   +/-   ##
=======================================
  Coverage   92.99%   92.99%           
=======================================
  Files         116      117    +1     
  Lines       12008    12026   +18     
  Branches     2753     2691   -62     
=======================================
+ Hits        11167    11184   +17     
- Misses        839      840    +1     
  Partials        2        2           

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

@zFernand0 zFernand0 self-assigned this Aug 29, 2024
@adam-wolfe adam-wolfe added this to the v3.1.0 milestone Sep 3, 2024
@zFernand0 zFernand0 mentioned this pull request Sep 5, 2024
15 tasks
Copy link

sonarcloud bot commented Sep 16, 2024

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

Signed-off-by: Fernando Rijo Cedeno <[email protected]>
…nto feat/int-term

Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

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

Thanks @zFernand0 for this awesome enhancement! A few questions:

  • I was a bit surprised to still see a quickpick when I try to issue MVS/TSO/USS command, as I expected to be taken straight to a terminal. I assume this behavior is intended because we want to avoid too much of a breaking change in UX. Curious if it would make sense to include an item in the quickpick to "Open MVS/TSO/USS terminal" in case someone prefers to go directly to there?
  • Should we "gray out" placeholder text like the first line Welcome to the integrated terminal... to make it easier to distinguish from command output?
  • For SSH commands, should we strip off $ from the front of the response? It may look a bit weird and cause alignment issues for output of some commands like ls -la:
$ ibmuser.p12             ibmuser-crt.pem         test2.txt
a.out                   ibmuser-crt2.pem        test23
bash                    start.sh                testHex.txt

@adam-wolfe

This comment was marked as outdated.

Signed-off-by: Fernando Rijo Cedeno <[email protected]>
- fix: remember ssh directory after running initial command
- feat: added command history to every issued command withing the iTerm

Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
dependencies:
- disposablestack 1.1.5
+ disposablestack 1.1.6

devDependencies:
- @types/jest 29.5.12
+ @types/jest 29.5.14
- @types/mocha 10.0.6
+ @types/mocha 10.0.9
- @types/node 18.19.33
+ @types/node 18.19.64 (22.9.0 is available)
- @types/vscode 1.89.0
+ @types/vscode 1.95.0
- @vscode/vsce 3.1.0
+ @vscode/vsce 3.2.1
- esbuild-loader 4.1.0
+ esbuild-loader 4.2.2
- eslint 8.57.0
+ eslint 8.57.1 (9.14.0 is available) deprecated
- jest-stare 2.5.1
+ jest-stare 2.5.2
- mocha 10.4.0
+ mocha 10.8.2
- ts-jest 29.1.2
+ ts-jest 29.2.5
- tsx 4.10.4
+ tsx 4.19.2
- typescript 5.4.5
+ typescript 5.6.3
- webpack 5.94.0
+ webpack 5.96.1

Signed-off-by: Fernando Rijo Cedeno <[email protected]>
…nto feat/int-term

Signed-off-by: Fernando Rijo Cedeno <[email protected]>
…nto feat/int-term

Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
@zFernand0
Copy link
Member Author

Thanks @zFernand0 for this awesome enhancement! A few questions:

  • I was a bit surprised to still see a quickpick when I try to issue MVS/TSO/USS command, as I expected to be taken straight to a terminal. I assume this behavior is intended because we want to avoid too much of a breaking change in UX. Curious if it would make sense to include an item in the quickpick to "Open MVS/TSO/USS terminal" in case someone prefers to go directly to there?
  • Still need to take care of this item
  • Should we "gray out" placeholder text like the first line Welcome to the integrated terminal... to make it easier to distinguish from command output?
  • For SSH commands, should we strip off $ from the front of the response? It may look a bit weird and cause alignment issues for output of some commands like ls -la:
$ ibmuser.p12             ibmuser-crt.pem         test2.txt
a.out                   ibmuser-crt2.pem        test23
bash                    start.sh                testHex.txt

@zFernand0
Copy link
Member Author

This is looking so awesome @zFernand0! thanks for working on this huge addition/transformation of issuing commands.

I do see one thing with extenders and issue unix commands, I was prompted for an ssh profile when it's not needed with the extender's profile (not seen on marketplace). May have missed the check for ssh profile needed that was in place with ZE APIs. The prompt for TSO account worked correctly and didn't prompt if not needed by extender type but did when needed, ie. with zosmf profiles.

  • Still need to test this, but I believe it should not prompt for extenders that do not require SSH profiles.

Copy link

Reminder: This pull request has a merge-by date coming up within the next 24 hours. Please review this PR as soon as possible.

@t1m0thyj @JillieBeanSim @awharn @rudyflores @traeok @adam-wolfe @SanthoshiBoyina1 @likhithanimma1

Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

Thanks Fernando for all your work on this, this looks awesome! I had a couple requests about moving the history settings for these terminals as well as a question about the TypeScript error in #3298

"typescript": "^5.3.3",
"webpack": "^5.94.0",
"ts-jest": "^29.2.5",
"tsx": "^4.19.2",
"typescript": "^5.6.3",
Copy link
Member

Choose a reason for hiding this comment

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

Comparing the outputs from CI in this PR and another recent PR, I think the update from [email protected] -> [email protected] is causing the issue described in #3298. I'm wondering if we should hold off on the TypeScript update until the cause is identified/resolved 🤔

packages/zowe-explorer-api/CHANGELOG.md Outdated Show resolved Hide resolved
Comment on lines +503 to +512
/**
* Issues a TSO Command without the need for account information
*
* @param {string} command
* @param {zostso.IStartTsoParms} parms
* @returns {Promise<zostso.IIssueResponse>}
* @memberof ICommand
*/
issueTsoCmdWithParms?(command: string, parms?: zostso.IStartTsoParms): Promise<zostso.IIssueResponse>;

Copy link
Member

@traeok traeok Nov 11, 2024

Choose a reason for hiding this comment

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

Question for my own edification: Was this added to prevent overwriting the behavior that's in place for existing issueTsoCommandWithParms implementations? I noticed that the function signatures are the same for both in this interface.

Comment on lines +19 to +21
MvsCommands = "zowe.commands.mvs.history",
TsoCommands = "zowe.commands.tso.history",
UssCommands = "zowe.commands.uss.history",
Copy link
Member

Choose a reason for hiding this comment

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

I can add these as readable/writable keys for local storage access in #3299 once they're available in main 😋

packages/zowe-explorer-ftp-extension/CHANGELOG.md Outdated Show resolved Hide resolved
packages/zowe-explorer/CHANGELOG.md Outdated Show resolved Hide resolved
Comment on lines +1728 to +1736
"zowe.commands.mvs.history": {
"default": {
"persistence": true,
"history": []
},
"description": "%zowe.commands.mvs.history%",
"scope": "application"
},
"zowe.commands.tso.history": {
Copy link
Member

@traeok traeok Nov 11, 2024

Choose a reason for hiding this comment

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

We currently keep history for Data Sets, USS and Jobs in local storage. Should these be moved into local storage to keep all the "history settings" in one place? If these are moved, I believe the logic would need updated to grab these from local storage.

Comment on lines +159 to +160
ZoweLogger.info(this.operationCancelled);
return;
Copy link
Member

Choose a reason for hiding this comment

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

Is this log message needed? If so, can we make it more specific to point out exactly what operation was cancelled? From the perspective of a user reading the output channel, all that would be printed is [INFO] Operation cancelled.

Comment on lines +170 to +171
const noProfAvailable = vscode.l10n.t("No profiles available");
ZoweLogger.info(noProfAvailable);
Copy link
Member

Choose a reason for hiding this comment

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

Similar request to the operation cancelled log message - if we want to log a message here, additional context could help surface an issue if no profiles are available.

Signed-off-by: Fernando Rijo Cedeno <[email protected]>
@adam-wolfe
Copy link
Contributor

adam-wolfe commented Nov 18, 2024

Two things I've run into with issuing TSO commands:

  • If I issue commands (hit enter) before the previous command's output is displayed, I get back an error like: Unable to perform this operation due to the following problem. Expect Error: IZUG1126E: z/OSMF cannot correlate the request for key "ADAM-249-aadcaakf" with an active z/OS application session. - Would it make sense/be possible to disable the terminal while waiting for a response?
  • The delete key causes strange behavior, e.g.:
> LISTCATe
IKJ56621I INVALID COMMAND NAME SYNTAX 
READY
// I try to delete the 'e' using delete key, which does not delete the 'e', then try backspace
> LISTCAT
IKJ56621I INVALID COMMAND NAME SYNTAX 
READY
// Then I retype LISTCAT and everything works normally
> LISTCAT
IN CATALOG:...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Review/QA
Development

Successfully merging this pull request may close these issues.

5 participants