-
Notifications
You must be signed in to change notification settings - Fork 15
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 event trigger to deleteUser resolver #126
Add event trigger to deleteUser resolver #126
Conversation
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
Beep boop 🤖 I noticed you didn't make any changes at the
In order to keep track, I'll create an issue if you decide now is not a good time
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just wondering if we should add such events to other actions as well (e.g. deleteCostCenter).
Just out of curiosity, what does your script do when an user is deleted @rafael-marques ?
Hey @enzomerca thanks for that. I believe applying that to other actions would be helpful. |
I agree that it can be useful, but let's avoid adding more events unless they're already necessary, ok? Otherwise we'll later be in trouble if we ever need to remove the events, afraid that someone might be using them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, lgtm! Can you just rebase to fix conflicts with the master
branch?
@mairatma looks like it's already up to date with master. Where are the conflicts? |
Nvm, I've found it in the CHANGELOG and fixed it. Can you review again? |
@polishq I always get this kind of problem on external PRs, where one of the checks fails complaining of the missing |
Kudos, SonarCloud Quality Gate passed! 0 Bugs 0.0% Coverage The version of Java (11.0.17) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
@mairatma I believe it's behaving as intended. Adding the label triggers the actions to switch to the "pull_request_target" workflow (specifically for external contributions) instead of the normal "pull_request" workflow, and the label is automatically removed as part of that flow. That first security check is intended to remain "Failed" in this scenario, but the PR is still mergeable since it's not a required check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Your PR has been merged! App is being published. 🚀 After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:
After that your app will be updated on all accounts. For more information on the deployment process check the docs. 📖 |
What problem is this solving?
Using Master Data V2, we don't have a trigger to run on "delete event" like in V1. This way we can't run scripts when deleting a user. Only on adding or updating. My motivation for this is to add the ability to run scripts after a delete action.
This modification will trigger an event sending a payload containing the is and email of the deleted user.
With this, we can add an event listener and run scripts needed for that scenario
How to test it?
To test, link this branch to a workspace. Then from another app, listen to an event called
b2b-organizations-graphql.removeUser
Like this:
service.json
Screenshots or example usage: