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

Implemented unix command #2515

Merged
merged 30 commits into from
Dec 1, 2023
Merged

Conversation

likhithanimma1
Copy link
Contributor

Proposed changes

Implemented "Issue Unix Command" feature in Zowe Explorer

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

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Updates to Documentation or Tests (if none of the other choices 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

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • PR title follows Conventional Commits Guidelines
  • PR Description is included
  • gif or screenshot is included if visual changes are made
  • yarn workspace vscode-extension-for-zowe vscode:prepublish has been executed
  • All checks have passed (DCO, Jenkins and Code Coverage)
  • I have added unit test and it is passing
  • I have added integration test and it is passing
  • There is coverage for the code that I have added
  • I have tested it manually and there are no regressions found
  • I have added necessary documentation (if appropriate)
  • Any PR dependencies have been merged and published (if appropriate)

Further comments

@JillieBeanSim
Copy link
Contributor

@likhithanimma1 shouldn't this point to the zowe:next branch?

@likhithanimma1
Copy link
Contributor Author

@likhithanimma1 shouldn't this point to the zowe:next branch?

Yes

@likhithanimma1 likhithanimma1 changed the base branch from main to next October 17, 2023 12:42
await Profiles.getInstance().checkCurrentProfile(profile);
}
if (Profiles.getInstance().validProfile !== ValidProfileEnum.INVALID) {
session = ZoweExplorerApiRegister.getUssApi(profile).getSession();

Check warning

Code scanning / CodeQL

Useless assignment to local variable

The value assigned to session here is unused.
failNotFound: false,
};

const profileTwo: imperative.IProfileLoaded = {

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused variable profileTwo.
@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

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

Comparison is base (14b3734) 92.95% compared to head (d195934) 92.91%.
Report is 2 commits behind head on next.

Files Patch % Lines
...es/zowe-explorer/src/command/UnixCommandHandler.ts 89.82% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2515      +/-   ##
==========================================
- Coverage   92.95%   92.91%   -0.04%     
==========================================
  Files         108      109       +1     
  Lines        9898    10083     +185     
  Branches     2053     2107      +54     
==========================================
+ Hits         9201     9369     +168     
- Misses        696      713      +17     
  Partials        1        1              

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

@JillieBeanSim JillieBeanSim added this to the v3 pre-release 2 milestone Oct 17, 2023
@likhithanimma1 likhithanimma1 marked this pull request as draft October 17, 2023 17:42
Signed-off-by: Likhitha Nimma <[email protected]>
@likhithanimma1 likhithanimma1 marked this pull request as ready for review October 18, 2023 09:53
Signed-off-by: Likhitha Nimma <[email protected]>
Signed-off-by: Likhitha Nimma <[email protected]>
@adam-wolfe adam-wolfe dismissed their stale review October 20, 2023 18:49

Requested changes have been addressed

Signed-off-by: Likhitha Nimma <[email protected]>
Signed-off-by: Likhitha Nimma <[email protected]>
Signed-off-by: Likhitha Nimma <[email protected]>
Signed-off-by: Likhitha Nimma <[email protected]>
Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

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

Leaving some comments here after looking over the code, still planning to test functionality.

I wonder if we should begin registering ssh profiles since it would be required to do UNIX cmds via zosmf profiles, as well as zftp profiles if we choose to add the functionality there too. This addition may be out of scope for this PR though.

CodeCov warnings that can be addressed should be, like the unused variable notifications.

Should we have a limit on stored commands, some items stored in history use the global values for save limit. Also, should we make the different types of commands have their own history so we don't see MVS & TSO commands from history show with the UNIX commands?
This could also be handled in a separate PR but wanted to bring it up for discussion.

packages/zowe-explorer-api/src/extend/interfaces.ts Outdated Show resolved Hide resolved
packages/zowe-explorer-api/CHANGELOG.md Outdated Show resolved Hide resolved
packages/zowe-explorer/CHANGELOG.md Outdated Show resolved Hide resolved
JillieBeanSim and others added 3 commits October 30, 2023 08:06
Signed-off-by: Likhitha Nimma <[email protected]>
Signed-off-by: Likhitha Nimma <[email protected]>
Signed-off-by: Likhitha Nimma <[email protected]>
JillieBeanSim
JillieBeanSim previously approved these changes Nov 20, 2023
Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

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

This LGTM! thanks @likhithanimma1 for adding this awesome feature for v3 and thanks for addressing all our concerns and requests

Signed-off-by: Likhitha Nimma <[email protected]>

## TBD Release

- Added the Issue UNIX Commands feature. [#1326](https://github.com/zowe/vscode-extension-for-zowe/issues/1326)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we get this changelog moved to top of file please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes moved to the top

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 for addressing the missing ssh profiles from the quick pick @likhithanimma1! I'm now seeing the ssh profiles in that list as expected.

However, after selecting my SSH profile and entering a path, an error dialog appears saying that Zowe Explorer tried to call a non-existing Common API:

image

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.

@likhithanimma1 Thanks for implementing this new feature 🙂

A few comments:

@zFernand0
Copy link
Member

In the quickpick I would expect z/OSMF profiles to be excluded from the list

I agree with that. Maybe we can add those back whenever we leverage the z/OSMF APIs for dealing with z/OS Unix commands

Copy link

sonarcloud bot commented Nov 30, 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
No Duplication information No Duplication information

Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @likhithanimma1 for this new functionality and for addressing all of the feedback

@adam-wolfe
Copy link
Contributor

adam-wolfe commented Nov 30, 2023

All I see are zosmf profiles in the quick pick despite having a team config that contains ssh profiles:
image
If I select one of the zosmf profiles, I am still able to issue Unix commands.

@JillieBeanSim
Copy link
Contributor

JillieBeanSim commented Nov 30, 2023

All I see are zosmf profiles in the quick pick despite having a team config that contains ssh profiles: image If I select one of the zosmf profiles, I am still able to issue Unix commands.

The Profile seen in the list when going through the command palette are profiles registered with the UNIX files tree view that the action is driven from. The functionality here uses the default ssh profile, which is a good starting point and can be expanded in separate PRs to bring in capability to support a choice from multiple ssh profiles if available.

Extenders may not require the ssh profile, and why this includes an additional API for profile types that do require the assistance of the ssh profile to complete the action. This is the logic behind the choice of profile registered with the tree similar to issuing a TSO command that zosmf requires the TSO profile.

@traeok
Copy link
Member

traeok commented Dec 1, 2023

The Profile seen in the list when going through the command palette are profiles registered with the UNIX files tree view that the action is driven from. The functionality here uses the default ssh profile, which is a good starting point and can be expanded in separate PRs to bring in capability to support a choice from multiple ssh profiles if available.

I think it makes sense to offer the profile selection as a future enhancement - since the current logic selects the default SSH profile regardless of what a user chooses in this quick pick, can we hide/comment this out until profile selection is supported? The quick pick might inspire confusion from end users if it doesn't respect their selection.

@JillieBeanSim
Copy link
Contributor

JillieBeanSim commented Dec 1, 2023

The Profile seen in the list when going through the command palette are profiles registered with the UNIX files tree view that the action is driven from. The functionality here uses the default ssh profile, which is a good starting point and can be expanded in separate PRs to bring in capability to support a choice from multiple ssh profiles if available.

I think it makes sense to offer the profile selection as a future enhancement - since the current logic selects the default SSH profile regardless of what a user chooses in this quick pick, can we hide/comment this out until profile selection is supported? The quick pick might inspire confusion from end users if it doesn't respect their selection.

@traeok this profile quick pick is offered when the user chooses to issue command from the command palette. Yes if only using zosmf profiles it seems redundant but if using an extender profile, the extender may not have the api yet or the extender doesn't require ssh connection to issue unix command. There are a lot of variables when looking at it from an extender's pov. Also, the procedure follows other issue command procedures from the command palette like TSO & MVS.

This PR has the basic functionality with extender's in mind and can be built upon in future, progress over perfection especially with the v3 work. With future PRs we can add checks and handling of multiple ssh profiles, we can even update the procedure to check for extender types and if only zosmf profiles or all types require ssh profile then proceed with default or offer ssh profile option. There are many ways to build on top of this work, but it's good to go ahead and get basic functionality in.

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.

@JillieBeanSim Thank you for clarifying on extenders, I did not fully realize the scenario for extenders that do not require SSH for Unix commands.

Since a default SSH profile would be a pre-requisite for profile types that don't support UNIX commands out of the box, we might want to mention this behavior in Zowe Docs for awareness. Otherwise users might try to execute Unix commands through a z/OSMF profile without having a default SSH profile set in their config.

I also realize that there is still a good bit of time before v3 GA, so the behavior or UX may change in the future.

@anaxceron tagging for reference regarding v3 readiness/feature doc 😅


Thanks @likhithanimma1 for this feature & addressing the feedback! Tested and working as expected, this is an awesome addition for v3 😋 LGTM

@JillieBeanSim JillieBeanSim merged commit 8571be2 into zowe:next Dec 1, 2023
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

6 participants