1959 - send webhook to RMD when open access work is published#1973
Open
Karthik Koralla (karthikreddy-02) wants to merge 1 commit into
Open
1959 - send webhook to RMD when open access work is published#1973Karthik Koralla (karthikreddy-02) wants to merge 1 commit into
Karthik Koralla (karthikreddy-02) wants to merge 1 commit into
Conversation
Alex Kiessling (ajkiessl)
requested changes
May 18, 2026
Comment on lines
+236
to
+240
| after_commit do | ||
| if work.open_access? | ||
| WorkPublishedWebhookJob.perform_later(work.uuid) | ||
| end | ||
| end |
Collaborator
There was a problem hiding this comment.
Is this valid syntax? Did you test it? There are no specs for this.
| @@ -0,0 +1,20 @@ | |||
| # frozen_string_literal: true | |||
|
|
|||
| class WorkPublishedWebhook | |||
Collaborator
There was a problem hiding this comment.
We should modularize our webhooks services and move them into the services/webhooks directory.
| @@ -1,5 +1,7 @@ | |||
| # frozen_string_literal: true | |||
|
|
|||
| require 'shoulda/matchers' | |||
Collaborator
There was a problem hiding this comment.
Why was this added?
| self.reload_on_index = true | ||
| } | ||
| end | ||
| # rubocop:enable Metrics/BlockLength |
Collaborator
There was a problem hiding this comment.
Rather than disabling, can this be refactored? If it can't it might be better to just disable this cop for this file in the rubocop.yml.
| end | ||
| # rubocop:enable Metrics/BlockLength | ||
|
|
||
| # Fields that can contain multiple values... |
Collaborator
There was a problem hiding this comment.
Remove comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an Open Access work is published in ScholarSphere, send a webhook to RMD so it can create an OpenAccessLocation for the matching deposit.
Changes:
Add WorkPublishedWebhook service that POSTs /webhooks/scholarsphere/open_access_work_published to RMD with the work's URL path
Add WorkPublishedWebhookJob to enqueue the webhook asynchronously
Trigger the job via after_commit on the publish AASM event in WorkVersion, only when the work is open access
Depends on: psu-libraries/researcher-metadata#1232
Closes #1959