-
Notifications
You must be signed in to change notification settings - Fork 7
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
1656 delete work webhook #1659
base: main
Are you sure you want to change the base?
1656 delete work webhook #1659
Conversation
I realized that I had this configuration locally, but it hadn’t been added to the sample config file.
From an initial look, here are my thoughts on some of the questions above (and the code):
I haven't quite had the time before break to dig very deep into this, but I think what you've done here:
should work. Since we don't want the callback triggered unless the last work version is being withdrawn. Also, triggering the callback after destroying a work sounds good too. You might have some unneeded callbacks sent when an unpublished draft is destroyed, though. Those are the only too ways to remove a work right now and should satisfy the requirements.
The "removed" state and "remove" event appear to be deprecated and must be a remnant of old scholarsphere, so we shouldn't need to worry about that. There aren't any work versions in production in the removed state, and as you mentioned, there's nowhere in the code to transition work versions to "removed".
Yeah, that's what will happen. I'm also assuming that's what we'd want to happen.
I see CI is failing at the bundle step. It seems to be working over here: #1658 though, so we may need to pull in those changes. Not sure if Justin is ready for that.
If a job fails it will end up in the dead queue in Sidekiq. So we can address it or rerun it from there. So I agree that it's not a big deal to fine-tune error handling just yet. |
Tests are erroring out with this not being set to a valid URL.
It was hard-coded to this value in the source previously, and there are apparently some tests that depend on it being set as such.
Dann’s gone :(
In response to @ajkiessl's comment (which I think is correct),
I took a look to see if it would be possible to only fire the webhook upon deletion of published works. The problem that I found is that a I can think of somewhat awkward workarounds for preserving information about prior published state or perhaps for determining whether or not the webhook should be triggered each time a So, I'm inclined to leave that part working as it currently is (that is, always triggering the webhook when a @Smullz622 & @jlandiseigsti, Do you agree with the above, or do you think I'm missing anything? Do you see any other issues? |
I tried to make this as simple as I could.
Since deleting/removing things in ScholarSphere seems kind of complicated (and I'm not that familiar with it), I'm not even completely sure that this satisfies the requirements for this issue. So I'd appreciate it if someone could check me on that.
A couple of things to note specifically:
withdrawn
state, work versions can also be in aremoved
state. I'm not sure what the difference is, but since I haven't seen any place in the code where work versions get transitioned into theremoved
state, I've only dealt with thewithdrawn
state.RmdClient
class. So this will need to be configured appropriately for the various deployments before release (in addition to the new shared secret for the webhook call).