vscode-extension-for-zowe icon indicating copy to clipboard operation
vscode-extension-for-zowe copied to clipboard

Group Common Methods in `Zowe Explorer` Package

Open rudyflores opened this issue 10 months ago • 4 comments

Proposed changes

Grouped most of our common methods in the zowe-explorer similarly to the work done in a previous PR for zowe-explorer-api. These changes introduce the following benefits for our project:

  • Code consistency for imports accross project, allows for simpler importing as well.
  • Many loose functions are now grouped into methods using the Singleton pattern.
  • Allow better consistency for our code accross project where before there was different coding styles.
  • Descriptive directories where now the relevant classes belong to relevant directories.
  • Simplified our Icons codebase where several functions where in separate files, allowing easier maintenance

Release Notes

Milestone: v3-pre-releases

Changelog: Grouped common methods in zowe-explorer package into singleton classes.

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)
  • [x] 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

  • [x] I have read the CONTRIBUTOR GUIDANCE wiki
  • [x] PR title follows Conventional Commits Guidelines
  • [x] PR Description is included
  • [ ] gif or screenshot is included if visual changes are made
  • [x] yarn workspace vscode-extension-for-zowe vscode:prepublish has been executed
  • [x] All checks have passed (DCO, Jenkins and Code Coverage)
  • [x] I have added unit test and it is passing
  • [ ] I have added integration test and it is passing
  • [x] There is coverage for the code that I have added
  • [x] 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

rudyflores avatar Apr 10 '24 18:04 rudyflores

Codecov Report

Attention: Patch coverage is 92.71523% with 44 lines in your changes are missing coverage. Please review.

Project coverage is 92.67%. Comparing base (8af02b9) to head (5816db1).

:exclamation: Current head 5816db1 differs from pull request most recent head c969a16

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

Files Patch % Lines
...kages/zowe-explorer/src/configuration/Workspace.ts 83.58% 11 Missing :warning:
...s/zowe-explorer/src/management/FilterManagement.ts 50.00% 10 Missing :warning:
...ckages/zowe-explorer/src/configuration/Profiles.ts 85.10% 7 Missing :warning:
...ages/zowe-explorer/src/configuration/TempFolder.ts 88.33% 7 Missing :warning:
.../zowe-explorer-api/src/fs/utils/FsAbstractUtils.ts 80.00% 5 Missing :warning:
...owe-explorer/src/extending/ZoweExplorerExtender.ts 60.00% 2 Missing :warning:
...ages/zowe-explorer-api/src/fs/utils/FsJobsUtils.ts 88.88% 1 Missing :warning:
...s/zowe-explorer/src/commands/UnixCommandHandler.ts 94.11% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2833      +/-   ##
==========================================
- Coverage   93.40%   92.67%   -0.73%     
==========================================
  Files         121      109      -12     
  Lines       10835    10981     +146     
  Branches     2228     2343     +115     
==========================================
+ Hits        10120    10177      +57     
- Misses        713      802      +89     
  Partials        2        2              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 10 '24 18:04 codecov[bot]

Sonarcloud failing comes from existing tests just being modified for this PR, maybe in the future we can look into also simplifying our codebase on tests to allow new contributors (or existing) to modify/create tests in a more intuitive way.

rudyflores avatar Apr 10 '24 19:04 rudyflores

@traeok We can hold on reviewing this PR to solve conflicts after file system provider work is merged!

For the time being feel free to check out this branch locally and give suggestions on what you all think about the new file structure!

rudyflores avatar Apr 10 '24 19:04 rudyflores

Quality Gate Failed Quality Gate failed

Failed conditions
5 Security Hotspots
11.4% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

sonarqubecloud[bot] avatar Apr 12 '24 15:04 sonarqubecloud[bot]

Fixing some broken unit tests! Will start addressing feedback soon!

rudyflores avatar May 14 '24 14:05 rudyflores

@traeok @t1m0thyj @zFernand0 @JillieBeanSim merge conflicts are fully resolved! working on the feedback from this thread now and we should be good to go!

rudyflores avatar May 14 '24 19:05 rudyflores

Feedback addressed! Ready for review!!!

rudyflores avatar May 15 '24 16:05 rudyflores

Quality Gate Failed Quality Gate failed

Failed conditions 55 Security Hotspots 12.7% Duplication on New Code (required ≤ 3%) C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Reminder we are planning to address this as a separate issue since this is more related to existing code smells and duplicate across our code from tests file and some other stuff from v2 we plan to remove!

rudyflores avatar May 15 '24 16:05 rudyflores

Quality Gate Failed Quality Gate failed

Failed conditions
55 Security Hotspots
14.1% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

sonarqubecloud[bot] avatar May 17 '24 17:05 sonarqubecloud[bot]

Sorry for the confusion regarding this bug:

I'm working on steps to reproduce, but sometimes when I try to copy and paste lines in an editor unrelated to ZE, a couple errors show related to pasting data sets:

Turns out that this issue exists in both v2 and v3 so its unrelated to any work done in this PR. I've filed https://github.com/zowe/zowe-explorer-vscode/issues/2923 to track this issue

traeok avatar May 20 '24 19:05 traeok