Skip to content

feat: ORCID deposition for codecheckers + CODECHECK form in reviewer tab (#16)#126

Open
subhanLabs wants to merge 15 commits into
mainfrom
feature/orcid-deposit
Open

feat: ORCID deposition for codecheckers + CODECHECK form in reviewer tab (#16)#126
subhanLabs wants to merge 15 commits into
mainfrom
feature/orcid-deposit

Conversation

@subhanLabs

@subhanLabs subhanLabs commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

This PR implements two major features for the CODECHECK plugin:

  1. ORCID Deposition — allows codecheckers to authorise the journal to deposit their CODECHECK peer-review activity to their ORCID profile via the ORCID Member API.
  2. CODECHECK form in reviewer tab — injects a collapsible CODECHECK documentation section into the reviewer's Download & Review tab (tab 3).

Changes

New Classes

  • classes/Orcid/OrcidApiClient.php — low-level ORCID API HTTP client
  • classes/Orcid/OrcidAuthHandler.php — handles OAuth 2.0 authorisation flow (startAuth/callback)
  • classes/Orcid/OrcidDepositService.php — builds and deposits peer-review records to ORCID
  • classes/Orcid/OrcidTokenDAO.php — manages token storage in codecheck_orcid_tokens table
  • classes/Orcid/PeerReviewPayloadBuilder.php — constructs ORCID peer-review XML payload
  • classes/Log/CodecheckLogger.php — structured logger with debug/info/error levels

Modified Files

  • CodecheckPlugin.php — ORCID hooks, reviewer data injection, publish handler
  • api/v1/CodecheckApiHandler.php — added orcid-status and orcid-deposit endpoints, reviewer role
  • api/v1/JsonResponse.php — made constructor args optional, added response() convenience method
  • classes/Constants.php — added all ORCID and GitHub constants
  • classes/migration/CodecheckSchemaMigration.php — added codecheck_orcid_tokens table
  • locale/en/locale.po — added ORCID and missing locale keys
  • registry/uiLocaleKeysBackend.json — added ORCID locale keys
  • resources/js/main.js — ORCID section in workflow, reviewer form injection via MutationObserver
  • resources/js/Components/CodecheckOrcidSection.vue — Vue component for ORCID authorisation and deposit UI

How it works

ORCID OAuth flow

  1. Editor opens the CODECHECK tab in the editorial workflow
  2. Each codechecker sees an "Authorise ORCID" button
  3. Clicking redirects to ORCID sandbox/production for consent
  4. On callback, token is stored in codecheck_orcid_tokens
  5. On publication (or manually), deposit is triggered automatically

Reviewer form

  1. When reviewer opens tab 3 (Download & Review), a MutationObserver detects the tab content loading
  2. A collapsible "CODECHECK Documentation" section is injected below the review form
  3. It mounts CodecheckMetadataForm and optionally CodecheckOrcidSection if ORCID is enabled

Notes

  • ORCID settings (client ID, secret, API type) will appear in the settings page once the settings form PR is merged
  • Sandbox API is used by default during development
  • All raw error_log() calls replaced with CodecheckLogger (debug/info/error levels)

Closes #16

…tab (#16)

- Full OAuth 2.0 flow for codechecker ORCID authorisation
- ORCID Member API peer-review deposition on publish and manually
- CODECHECK metadata form injected into reviewer tab 3 (Download & Review)
- ORCID section shown in editor workflow CODECHECK tab
- codecheck_orcid_tokens DB table for token/deposit tracking
- Reviewer role added to API handler
- All settings read from plugin configuration
@nuest

nuest commented Jun 1, 2026

Copy link
Copy Markdown
Member

Thanks!

Can you please clarify re. "Editor opens the CODECHECK tab in the editorial workflow" > the codechecker needs to be the one that opens the tab and initiates the authentication with ORCID, right?

It would be great, because this is a crucial feature, if you could add a couple of screenshots or maybe even a screencast to document the completed functionality.

nuest
nuest previously requested changes Jun 1, 2026

@nuest nuest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

General comments first, detailed line-by-line review later.

Comment thread classes/migration/CodecheckSchemaMigration.php
Comment thread classes/Orcid/OrcidApiClient.php
Comment thread classes/Orcid/OrcidApiClient.php
Comment thread classes/Orcid/PeerReviewPayloadBuilder.php
Comment thread classes/Orcid/PeerReviewPayloadBuilder.php
Comment thread resources/js/Components/CodecheckOrcidSection.vue Outdated
Comment thread changes.diff Outdated
Comment thread CodecheckPlugin.php
Comment thread CodecheckPlugin.php
Comment thread CodecheckPlugin.php Outdated
- Fix ORCID iD mismatch check to validate against all codecheckers
- Remove city as required field, only name and country needed
- Bundle ORCID icon locally instead of loading from orcid.org
- Restrict auth button to reviewer form, editors see status only
- Add Test ORCID Setup button in plugin settings
- Add ORCID settings section to settings form and template
@subhanLabs subhanLabs requested a review from nuest June 8, 2026 04:15
@nuest

nuest commented Jun 8, 2026

Copy link
Copy Markdown
Member

@subhanLabs For the sake of documentation, can you please update local docs or the README file which field mentioned in https://support.orcid.org/hc/en-us/articles/360006971333-Peer-Reviews your code sets, and what values are put in there? Thanks!

@nuest

nuest commented Jun 8, 2026

Copy link
Copy Markdown
Member

@subhanLabs For the sake of documentation, please post a screenshot of the ORCID Deposition section here.

@subhanLabs

Copy link
Copy Markdown
Member Author

Please find screenshots of the ORCID Deposition section attached, the first shows the reviewer form view where the codechecker can authorise and re-deposit, and the second shows the editorial workflow view where the editor can monitor status and trigger deposition.

image image

@subhanLabs

Copy link
Copy Markdown
Member Author

@subhanLabs For the sake of documentation, can you please update local docs or the README file which field mentioned in https://support.orcid.org/hc/en-us/articles/360006971333-Peer-Reviews your code sets, and what values are put in there? Thanks!

I have added a section to the README documenting which ORCID peer-review fields are set and what values are used: Orcid Peer Review Deposition

@subhanLabs subhanLabs force-pushed the feature/orcid-deposit branch from 06a322f to 4e7eaed Compare June 15, 2026 01:58
@nuest

nuest commented Jun 24, 2026

Copy link
Copy Markdown
Member

@subhanLabs please merge main branch, it just underwent some massive changes. When done, double check there are no merge artefacts in the code, please.

Comment thread api/v1/CodecheckApiHandler.php Outdated
Comment thread classes/Orcid/OrcidAuthHandler.php Outdated
Comment thread classes/Orcid/PeerReviewPayloadBuilder.php
@nuest nuest dismissed their stale review June 29, 2026 11:16

Outdated.

@nuest nuest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See inline comments.

Comment thread templates/settings.tpl Outdated
Comment thread classes/Orcid/OrcidDepositService.php Outdated
Comment thread classes/Orcid/OrcidAuthHandler.php
Comment thread classes/Orcid/OrcidDepositService.php Outdated
Comment thread classes/Orcid/OrcidDepositService.php Outdated
Comment thread classes/Orcid/PeerReviewPayloadBuilder.php
@subhanLabs subhanLabs requested a review from nuest July 6, 2026 03:40
@nuest

nuest commented Jul 6, 2026

Copy link
Copy Markdown
Member

@subhanLabs Please resolve the minor merge conflicts and add a reply to all conversations of #126 (review) - Thanks!

@subhanLabs

Copy link
Copy Markdown
Member Author

@subhanLabs Please resolve the minor merge conflicts and add a reply to all conversations of #126 (review) - Thanks!

All merge conflicts have been resolved and all review comments have been addressed. Please take another look when you get a chance, thanks!

@nuest

nuest commented Jul 9, 2026

Copy link
Copy Markdown
Member

@subhanLabs Please resolve all conversations with a short comment - thanks!

@nuest nuest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

pending comments lurking?

@nuest nuest self-requested a review July 13, 2026 13:09
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.

Codechecking activity is deposited in ORCID profile

2 participants