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: open Zowe Explorer resources using VSCode URLs #3271

Merged
merged 13 commits into from
Oct 30, 2024
Merged

Conversation

traeok
Copy link
Member

@traeok traeok commented Oct 22, 2024

Proposed changes

Enables users to click VSCode URLs directed at our extension. We can parse and handle these URIs to open given resource paths or execute commands (depending on the contents).
For now, I've only added the vscode.open functionality. In the future, we can expose and execute commands if desired.

Example:

  • vscode://Zowe.vscode-extension-for-zowe?zowe-ds:/lpar.zosmf/CUSTOMER.PUBLIC.REXX/SAYHELLO
  • vscode://Zowe.vscode-extension-for-zowe?zowe-uss:/lpar.zosmf/u/path/to/customer/homedir

Adjust the URLs above to match a Data Set or USS resource under one of your profiles. Then paste the link in your browser to open it within VS Code. Ensure that either:

  • this PR is packaged & installed into your copy of VS Code
  • you have Dev Host opened w/ this PR and it is the last focused VS Code window

Release Notes

Milestone: 3.1.0

Changelog:

  • Added the ability to open VS Code URLs that point to Zowe Resources. #3271
    • Example: vscode://Zowe.vscode-extension-for-zowe?zowe-ds:/lpar.zosmf/TEST.PDS/MEMB will open the MEMB PDS member under the TEST.PDS using the lpar.zosmf profile.

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):

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@pull-request-size pull-request-size bot added size/L and removed size/S labels Oct 23, 2024
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.07%. Comparing base (95320f8) to head (4d41743).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...kages/zowe-explorer/src/trees/shared/SharedInit.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3271   +/-   ##
=======================================
  Coverage   93.07%   93.07%           
=======================================
  Files         113      114    +1     
  Lines       11763    11784   +21     
  Branches     2656     2660    +4     
=======================================
+ Hits        10948    10968   +20     
- Misses        813      814    +1     
  Partials        2        2           

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

@traeok traeok marked this pull request as ready for review October 23, 2024 18:25
Copy link

📅 Suggested merge-by date: 11/6/2024

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.

haven't tested it yet, but the changes LGTM! 😋

@zFernand0 zFernand0 self-requested a review October 23, 2024 20:26
@traeok traeok added this to the v3.1.0 milestone Oct 25, 2024
zFernand0
zFernand0 previously approved these changes Oct 28, 2024
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.

LGTM! 😋

I think this will be very useful for sharing links with other people 🙏

Curious if we can add a Copy Full URI Path to the context menus, or on the file tab itself?

image image

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
zFernand0
zFernand0 previously approved these changes Oct 28, 2024
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.

Thanks for quickly adding the external link option. 🙏

Another question...
Should the search-filter be adjusted (if you click an external link) if there is no search-filter set?

image

Note: I approved it as-is because I believe it can be merged and these items can be handled in a future PR/issue

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@traeok
Copy link
Member Author

traeok commented Oct 28, 2024

Thanks for quickly adding the external link option. 🙏

No problem 😁

Another question... Should the search-filter be adjusted (if you click an external link) if there is no search-filter set?

This seems to be an unrelated issue as these links do not interact with the tree view. Maybe we're setting a description for the profile node at some point during initialization?

Sorry @zFernand0, I misunderstood your question. I think it shouldn't adjust the search filter as an external link is considered a direct lookup of a Zowe resource - it works independently of the tree views and only leverages the FileSystemProvider.

zFernand0
zFernand0 previously approved these changes Oct 28, 2024
@zFernand0
Copy link
Member

zFernand0 commented Oct 28, 2024

Thanks for adding the license headers too 🙏

Copy link
Contributor

@anaxceron anaxceron left a comment

Choose a reason for hiding this comment

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

Made a suggestion for edits to the changelog

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>
@traeok traeok requested review from anaxceron and zFernand0 October 30, 2024 18:40
anaxceron
anaxceron previously approved these changes Oct 30, 2024
Copy link
Contributor

@anaxceron anaxceron left a comment

Choose a reason for hiding this comment

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

good changelog @traeok!

We're not in a place to easily support directories and PDS right now.
We can add support for this in the future once its easy to
access the profile node and execute a search on it programatically.

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
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.

LGTM, thanks @traeok!

@traeok traeok merged commit 1786fe3 into main Oct 30, 2024
24 of 25 checks passed
@traeok traeok deleted the exp/open-uri branch October 30, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

5 participants