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: Zowe Explorer Development CLI #2914

Merged
merged 47 commits into from
May 28, 2024
Merged

feat: Zowe Explorer Development CLI #2914

merged 47 commits into from
May 28, 2024

Conversation

traeok
Copy link
Member

@traeok traeok commented May 14, 2024

Proposed changes

This branch proposes the introduction of a lightweight development CLI made in Rust, providing the following commands as helper utilities:

  • setup
    • checkout a Git ref (optional)
    • clean node_modules
    • install the dependencies using the correct package manager
  • pm
    • forwards commands to the package manager for the current branch
  • test - test a local VSIX or an artifact from GitHub using a Git ref
    • extracts a portable version of VS Code
    • installs the given dependencies
    • opens VS Code with ZOWE_CLI_HOME set to the sandboxed directory (so it doesn't affect your global configuration)
    • caches VS Code versions so that existing versions are not re-downloaded

Developers can leverage this utility while developing a Zowe Explorer bug fix/feature, or for testing other contributions without modifying their original environment. It's entirely optional and does not interfere with normal behavior of the repo, so developers can choose to adopt it if they find it useful.

Other ideas that I had in mind for the future of this tool:

  • secrets command
    • retrieve or delete usernames and passwords stored in the OS credential vault
  • arguments for the test command
    • cleanup argument to delete any cached data for the portable VS Code version (if it exists)
    • --integration/-i for running integration tests using WebDriverIO
      • when providing a different VS Code version than the one defined in wdio.conf.ts, the CLI could handle the change for you and then restore it after the tests are complete

Installation steps

  1. Install the requirements if they aren't yet installed - cmake, gcc, Git Bash and Rust
  2. cd into the zedc folder in the root of the repo and run the command cargo build --release.
  3. Once complete, create a folder for the zedc tool that can be added to your PATH environment variable.
  4. Add this folder's path to your PATH environment variable and open a new shell.
  5. Attempt to run the tool by running the zedc command. A help message should appear with the available commands.

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)

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: 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>
- optimize `zedc` binary for size

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

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.68%. Comparing base (6370958) to head (19b920f).

Current head 19b920f differs from pull request most recent head 4c0b248

Please upload reports for the commit 4c0b248 to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #2914   +/-   ##
=======================================
  Coverage   92.68%   92.68%           
=======================================
  Files         109      109           
  Lines       10981    10981           
  Branches     2314     2313    -1     
=======================================
  Hits        10178    10178           
  Misses        801      801           
  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 May 14, 2024 17:32
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>
@traeok
Copy link
Member Author

traeok commented May 16, 2024

Sorry to anyone that was trying to test on macOS - I needed to make some changes to fix extracting portable VS Code versions. I've ran some manual tests with the latest changes and all seems to be working as intended now 😅

@t1m0thyj t1m0thyj self-requested a review May 17, 2024 02:24
t1m0thyj
t1m0thyj previously approved these changes May 21, 2024
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! Left a few comments

zedc/Cargo.toml Outdated Show resolved Hide resolved
zedc/README.md Show resolved Hide resolved
Copy link

sonarcloud bot commented May 23, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@traeok traeok requested a review from t1m0thyj May 23, 2024 13:16
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.

Hey @traeok I don't see any instructions in the description on how to package and install the new package. I ran build and package as usual but don't see anything new included after the command. It may be good to add these steps to our dev/top-level README for contributors to also know how to use it.

@traeok
Copy link
Member Author

traeok commented May 28, 2024

Hey @traeok I don't see any instructions in the description on how to package and install the new package. I ran build and package as usual but don't see anything new included after the command. It may be good to add these steps to our dev/top-level README for contributors to also know how to use it.

Sorry about that @JillieBeanSim, I added a section in the zedc readme but forgot to add the steps in the PR description. I've updated the PR with steps on how to install 👍

@traeok traeok requested a review from JillieBeanSim May 28, 2024 14:04
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.

Once I got the setup correct this works awesome! thanks @traeok for this new dev feature!

@JillieBeanSim JillieBeanSim merged commit 8103a68 into next May 28, 2024
9 checks passed
@JillieBeanSim JillieBeanSim deleted the feat/zedc branch May 28, 2024 17:20
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.

None yet

3 participants