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

Provide API for registering callback upon watcher triggered for exten… #2397

Merged
merged 11 commits into from
Aug 21, 2023

Conversation

rudyflores
Copy link
Contributor

@rudyflores rudyflores commented Jul 25, 2023

Solves #2385

Proposed changes

Added API for allowing extenders to register their own callback or set of actions to be performed upon the watcher being triggered (create, update, delete) in order to have a way to notify extenders on any real time changes made to a Zowe team config profile.

Release Notes

Milestone: 2.10.0

Changelog: Added API for registering callback function to execute upon triggering the watcher for team config profiles.

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

…ders

Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
@rudyflores rudyflores self-assigned this Jul 25, 2023
@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (fab1aa7) 92.62% compared to head (e26710d) 92.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2397      +/-   ##
==========================================
- Coverage   92.62%   92.62%   -0.01%     
==========================================
  Files          98       98              
  Lines        9414     9425      +11     
  Branches     1951     1952       +1     
==========================================
+ Hits         8720     8730      +10     
- Misses        693      694       +1     
  Partials        1        1              
Files Changed Coverage Δ
...es/zowe-explorer-api/src/profiles/ProfilesCache.ts 99.15% <100.00%> (-0.42%) ⬇️
...kages/zowe-explorer/src/ZoweExplorerApiRegister.ts 98.18% <100.00%> (+0.06%) ⬆️
packages/zowe-explorer/src/extension.ts 100.00% <100.00%> (ø)
packages/zowe-explorer/src/shared/init.ts 97.90% <100.00%> (+0.04%) ⬆️

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

Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
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.

Implementation LGTM 😅 just had a couple comments regarding choice of function type. And I think it would be best to expose EVENT_TYPES to extenders, so I mentioned that below 👍

packages/zowe-explorer/src/globals.ts Outdated Show resolved Hide resolved
packages/zowe-explorer-api/src/profiles/ZoweExplorerApi.ts Outdated Show resolved Hide resolved
packages/zowe-explorer/src/shared/init.ts Outdated Show resolved Hide resolved
Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
@rudyflores rudyflores requested a review from traeok August 10, 2023 20:22
@rudyflores
Copy link
Contributor Author

Thanks for the suggestions @traeok it should be ready for review now :)

zFernand0
zFernand0 previously approved these changes Aug 16, 2023
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.

I didn't find any issues with this behavior in the FTP extension 🥳
LGTM! 😋

packages/zowe-explorer-api/src/profiles/ZoweExplorerApi.ts Outdated Show resolved Hide resolved
Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
@rudyflores rudyflores requested a review from traeok August 21, 2023 19:28
Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
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.

@sonarcloud
Copy link

sonarcloud bot commented Aug 21, 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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

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! Verified that events are being fired from extenders that implement IApiRegisterClient. Thanks for this enhancement and for updating to use vscode.Event @rudyflores 😁

@zFernand0 zFernand0 merged commit b625c21 into main Aug 21, 2023
34 checks passed
@zFernand0 zFernand0 deleted the callback-for-extenders branch August 21, 2023 20:28
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.

Notify extenders when a change has been made to team config profiles
4 participants