CLARIN-DSpace v9/Port #1327 (workflow-item PATCH /license + claim-guard rework) to the v9 base - #1382
Merged
Conversation
…em, in PATCH operation (ufal#1365) (#1327) (cherry picked from commit 8320889 on dtq-dev) v9 adaptations: - WorkflowItemRestRepository.java: import conflict resolved keeping jakarta.servlet.http.HttpServletRequest + adding the commit's Jackson imports in v9 import order (com.fasterxml < jakarta < org). upload() keeps 'throws AuthorizeException' (legal: v9 DSpaceRestRepository.upload declares it). - ClarinWorkflowItemRestRepositoryIT: commit's new test code used javax.ws.rs.core.MediaType -> converted to jakarta.ws.rs.core.MediaType (7x). - TaskRestRepositoriesIT: conflict resolved to jakarta MediaType (HEAD) + isForbidden() (the commit's intended 422->403 claim-guard semantics change). - Gap fix per sync plan card step 5: patchUpdateClarinLicense extended with a bogus-workflowitem-id (999999) isNotFound() assertion covering the new 'source == null' 404 guard, which the original commit never tested. Fulfils CLARIN_V9_POST_SNAPSHOT_SYNC_ACCEPTANCE.md §5 / 8320889 (BE-4, Vlna 2).
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.
Tranža BE-4 (Vlna 2) — post-snapshot sync dtq-dev → dtq-dev-9-base
Per CLARIN_V9_POST_SNAPSHOT_SYNC_PLAN.md §4 Vlna 2 / BE-4.
8320889f2c(fork PR #1327) — workflow-item PATCH /license + 404/403 claim-guard rework — PORTExtends
PATCH /api/workflow/workflowitems/{id}to acceptreplaceon/license(applies a CLARIN license), and reworks the shared claim guard: missing item → 404 (was NPE), no claims → 422, claimed by another user → 403 (was 422).v9 adaptations:
WorkflowItemRestRepository.java: import conflict resolved keepingjakarta.servlet.http.HttpServletRequest+ adding the commit's Jackson imports in v9 order (com < jakarta < org).upload()keepsthrows AuthorizeException(v9 base declares it).ClarinWorkflowItemRestRepositoryIT:javax.ws.rs.core.MediaType→jakarta.ws.rs.core.MediaType(7×).TaskRestRepositoriesIT: conflict resolved to jakarta MediaType + the intended 422→403 assertion.patchUpdateClarinLicenseextended with a bogus-workflowitem-id (999999)isNotFound()assertion covering the newsource == null404 guard the original commit never tested.Local gates (on
949611004f, aftermvn clean install -DskipTests) — ALL GREENClarinWorkflowItemRestRepositoryIT: 5/5 (patchUpdateClarinLicense: 403 non-claimer, 404 unknown license, 200 string + wrapped, 400 empty/list/Add, + new bogus-id 404).TaskRestRepositoriesIT: 72/72 (patch-by-non-claimer now 403; upload-in-review-step still 422).SupervisionOrderRestRepositoryIT: 30/30 (pooled-item patch still 422 — 422→403 blast radius clean).isNotFoundpresent; AC6 3×OPERATION_PATH_LICENSE_RESOURCE; AC7 0 javax in the 3 files.🤖 Generated with Claude Code