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

Added review_assignment_settings table #4580

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

taslangraham
Copy link
Contributor

@taslangraham taslangraham force-pushed the i10759-main branch 2 times, most recently from ba50c6a to c848334 Compare January 7, 2025 20:11
@taslangraham taslangraham marked this pull request as ready for review January 7, 2025 20:11
@taslangraham taslangraham force-pushed the i10759-main branch 3 times, most recently from 6f1a492 to 854f27a Compare January 24, 2025 02:45
$reviewer = $review ? Repo::user()->get($review->getReviewerId()) : null;

if ($reviewer && $reviewer->getData('orcidReviewPutCode')) {
$context = app()->get('context')->get(Repo::submission()->get($review->getSubmissionId())->getData('contextId'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for the time being it's probably best to stick with the Application::getContextDAO()->getById() way of getting a context for consistency.


if ($reviewer && $reviewer->getData('orcidReviewPutCode')) {
$context = app()->get('context')->get(Repo::submission()->get($review->getSubmissionId())->getData('contextId'));
dispatch(new ReconcileOrcidReviewPutCode($reviewer->getId(), $context->getId()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having looked at it and thought about it more, I do think we want the DepositOrcidReview job to be dependent on the ReconcileOrcidReviewPutCode job. Your initial reasoning makes sense, but I think we do not want to try and deposit any reviews if the put codes have not properly been reconciled. The adverse consequences if the reconcile job fails and therefore the deposit job fails are the editor or someone will eventually need to retry it. if the reconcile job fails but the deposit job moves forward it could potentially overwrite data.

Obviously the reconcile job failing in either case isn't great, but I'd rather everything fail than potentially overwrite or add incorrect data to someone's ORCID record.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, this does make sense. Laravel's job-chaining can be used to accomplish this.

I'll update the code.

if ($orcidAccessExpiresOn->isFuture()) {
OrcidManager::logInfo('Attempting to update put-codes for reviewer ' . $reviewer->getId());

$context = app()->get('context')->get($this->contextId);/** @var Context $context */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as comment above for method to fetch $context.


// Remove old put-code from user object
$reviewer->setData('orcidReviewPutCode', null);
Repo::user()->edit($reviewer, ['orcidReviewPutCode']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a cursory look, but it seems like this isn't actually deleting the orcidReviewPutCode from the user settings table. Could you have a look?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed this issue elsewhere and have opened a issue with PR for it. Do you mind taking a look?
pkp/pkp-lib#10868

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@taslangraham taslangraham force-pushed the i10759-main branch 2 times, most recently from c11b739 to f2b326f Compare February 3, 2025 15:41
@@ -160,6 +160,7 @@
<migration class="APP\migration\upgrade\v3_5_0\I10620_EditorialBoardMemberRole"/>
<migration class="APP\migration\upgrade\v3_5_0\I9707_WeblateUILocales"/>
<note file="docs/release-notes/README-3.5.0" />
<migration class="PKP\migration\upgrade\v3_5_0\I10759_AddReviewAssignmentSettings"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I didn't catch this before. This should go before the <note> tag, as that should be the last thing to run as part of the upgrade.

@taslangraham taslangraham merged commit 46255af into pkp:main Feb 6, 2025
8 of 9 checks passed
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.

2 participants