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

Add setting to change Zowe Explorer logs folder #2189

Merged
merged 22 commits into from
Apr 14, 2023

Conversation

t1m0thyj
Copy link
Member

@t1m0thyj t1m0thyj commented Mar 17, 2023

Proposed changes

Resolves #2186 by adding a setting to change logs folder similar to the already existing setting to change temp downloads folder:
image

TODO:

  • Rebase PR against main branch
  • Add unit test coverage
  • Improve error handling for read-only folders
    • Check write access to "logs" folder
    • Check write access to "tmp" folder (already implemented)

Release Notes

Milestone: 2.8.0

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

@t1m0thyj t1m0thyj added this to the v2.8.0 milestone Mar 17, 2023
@github-advanced-security
Copy link

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

@t1m0thyj t1m0thyj linked an issue Mar 17, 2023 that may be closed by this pull request
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj force-pushed the feature/logs-folder-setting branch from 0113bb2 to abe6e3a Compare March 24, 2023 17:11
@t1m0thyj t1m0thyj changed the base branch from maintenance to main March 24, 2023 17:11
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Patch coverage: 96.42% and project coverage change: +0.07 🎉

Comparison is base (6e59df7) 91.46% compared to head (5506150) 91.53%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2189      +/-   ##
==========================================
+ Coverage   91.46%   91.53%   +0.07%     
==========================================
  Files          89       89              
  Lines        8857     8864       +7     
  Branches     1828     1829       +1     
==========================================
+ Hits         8101     8114      +13     
+ Misses        755      749       -6     
  Partials        1        1              
Impacted Files Coverage Δ
packages/zowe-explorer/src/utils/ProfilesUtils.ts 87.72% <50.00%> (ø)
packages/zowe-explorer/src/globals.ts 96.37% <90.00%> (+4.52%) ⬆️
...owe-explorer-api/src/vscode/ZoweVsCodeExtension.ts 98.76% <100.00%> (+0.03%) ⬆️
...kages/zowe-explorer-ftp-extension/src/extension.ts 92.30% <100.00%> (ø)
packages/zowe-explorer/src/dataset/actions.ts 92.34% <100.00%> (ø)
packages/zowe-explorer/src/extension.ts 100.00% <100.00%> (ø)
packages/zowe-explorer/src/shared/init.ts 99.27% <100.00%> (+0.01%) ⬆️
packages/zowe-explorer/src/utils/LoggerUtils.ts 100.00% <100.00%> (ø)

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj marked this pull request as ready for review March 27, 2023 20:48
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.

Thanks @t1m0thyj this works well. I think it may need to be added to the onDidChange watcher because it didn't change and create the log in new location until I restarted VSC

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj
Copy link
Member Author

t1m0thyj commented Mar 30, 2023

Thanks @t1m0thyj this works well. I think it may need to be added to the onDidChange watcher because it didn't change and create the log in new location until I restarted VSC

Good catch, I've added code to the watcher to handle this. Also had to create a deep copy of the loggerConfig object when we initialize the logger, because previously we were modifying file paths on the original object which caused problems when initializing the logger a second time.

traeok
traeok previously approved these changes Mar 30, 2023
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.

LGTM, tested changing the path without restarting VScode and it's working as expected 👍 Thanks @t1m0thyj !

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
traeok
traeok previously approved these changes Apr 3, 2023
@JillieBeanSim JillieBeanSim mentioned this pull request Apr 4, 2023
16 tasks
JillieBeanSim
JillieBeanSim previously approved these changes Apr 5, 2023
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj dismissed stale reviews from JillieBeanSim and traeok via e8eb2cb April 5, 2023 14:13
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
@JillieBeanSim
Copy link
Contributor

Hey @t1m0thyj I have some suggestions for polish work since my last PR and this one work closely together in this draft PR into the branch. I need to fix the unit tests though.

t1m0thyj and others added 7 commits April 6, 2023 10:47
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.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: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@sonarcloud
Copy link

sonarcloud bot commented Apr 11, 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
0.0% 0.0% Duplication

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.

Sorry for the late review
LGTM! 😋

@zFernand0 zFernand0 merged commit 5f8def3 into main Apr 14, 2023
@zFernand0 zFernand0 deleted the feature/logs-folder-setting branch April 14, 2023 15:39
@anaxceron
Copy link
Contributor

Documented with PR 2810

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.

Allow logs folder to be customized in settings
5 participants