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

Make Zowe Explorer independent of Zowe CLI installation #1993

Merged
merged 21 commits into from
Nov 10, 2022

Conversation

JillieBeanSim
Copy link
Contributor

@JillieBeanSim JillieBeanSim commented Oct 27, 2022

Signed-off-by: Billie Simmons 49491949+JillieBeanSim@users.noreply.github.com

Proposed changes

This PR will

  1. check for and create if needed the .zowe/settings/imperative.json file making Zowe Explorer independent of the Zowe CLI installation.
  2. fixes the watcher of the Secure Credentials Enabled setting, to update file when checked or unchecked.
  3. will read and parse the file if existing and changing the CredentialManager value then write back. This is done just incase imperative, zowe cli, or an extender/plugin decide to introduce more values to this file.

Release Notes

Milestone: 2.4.1

Changelog:

  • Added independence from Zowe CLI installation by creating the ~/.zowe/settings/imperative.json file during activation if it doesn't already exist. This file is for Zowe Explorer to know the Security Credential Manager used for secure profile information.
  • Fixed the Secure Credentials Enabled setting to update the ~/.zowe/settings/imperative.json file upon change of the setting without overwriting other data in the file.

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

Screen.Recording.2022-10-28.at.3.38.01.PM.mov
Screen.Recording.2022-10-28.at.4.21.10.PM.mov

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
@JillieBeanSim JillieBeanSim added this to the 2.5.0 milestone Oct 27, 2022
@JillieBeanSim JillieBeanSim linked an issue Oct 27, 2022 that may be closed by this pull request
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Oct 28, 2022

Codecov Report

Base: 74.29% // Head: 74.44% // Increases project coverage by +0.14% 🎉

Coverage data is based on head (09ed1a9) compared to base (5fa7001).
Patch coverage: 85.10% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1993      +/-   ##
==========================================
+ Coverage   74.29%   74.44%   +0.14%     
==========================================
  Files          63       63              
  Lines        7108     7129      +21     
  Branches     1538     1543       +5     
==========================================
+ Hits         5281     5307      +26     
+ Misses       1820     1815       -5     
  Partials        7        7              
Impacted Files Coverage Δ
packages/zowe-explorer/src/extension.ts 38.38% <40.00%> (-0.53%) ⬇️
packages/zowe-explorer/src/globals.ts 93.00% <50.00%> (-3.74%) ⬇️
packages/zowe-explorer/src/Profiles.ts 36.09% <100.00%> (+0.22%) ⬆️
packages/zowe-explorer/src/utils/ProfilesUtils.ts 68.06% <100.00%> (+5.48%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
@JillieBeanSim JillieBeanSim marked this pull request as ready for review October 28, 2022 23:55
@JillieBeanSim JillieBeanSim marked this pull request as draft October 29, 2022 00:04
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
@JillieBeanSim JillieBeanSim marked this pull request as ready for review October 31, 2022 15:02
@JillieBeanSim
Copy link
Contributor Author

The code smell is about the comment with TODO in it, which I think can stay until the issue mentioned is solved and we consume and use the changes.

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
@JTonda JTonda requested a review from t1m0thyj November 8, 2022 16:07
@JillieBeanSim JillieBeanSim modified the milestones: 2.5.0, 2.4.1 Nov 8, 2022
zFernand0
zFernand0 previously approved these changes Nov 8, 2022
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! 😋

Comment on lines 472 to +473
// tslint:disable-next-line: no-magic-numbers
expect(globalMocks.mockMkdirSync.mock.calls.length).toBe(4);
expect(globalMocks.mockMkdirSync.mock.calls.length).toBe(6);
Copy link
Member

Choose a reason for hiding this comment

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

we should probably remove tslint in favor of eslint.
and for these kind of tests, we could have the eslint configuration for tests exclude the magic-number rules 😋
Example: https://github.com/zowe/zowe-cli/blob/master/.eslintrc.js#L14-L36

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it doesn't look like Zowe Explorer has changed over to eslint, only ZE API & FTP

Copy link
Member

Choose a reason for hiding this comment

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

🤦 you are right
the first step is to migrate to eslint 😋

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 8, 2022

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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@JillieBeanSim JillieBeanSim merged commit 720e8e0 into main Nov 10, 2022
@JillieBeanSim JillieBeanSim deleted the create-settings-file branch November 10, 2022 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ZE: create all .zowe subfolders needed (e.g. ~/.zowe/settings)
3 participants