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

feat(pub-period-migration): publication period migration on big dataset. #1100

Merged
merged 16 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Migrate "publicationPeriod" data to the Dates object and remove it from the Instance schema ([MODINVSTOR-1232](https://folio-org.atlassian.net/browse/MODINVSTOR-1232))

### New APIs versions
* Provides `instance-storage 11.0`
* Provides `instance-storage-batch 3.0`
* Provides `instance-storage 11.1`
* Provides `instance-storage-batch 3.1`
* Provides `instance-storage-batch-sync 3.0`
* Provides `instance-storage-batch-sync-unsafe 3.0`
* Provides `inventory-view 3.0`
Expand All @@ -16,6 +16,7 @@

### Features
* Add module descriptor validator plugin and fix the permission names ([MODINVSTOR-1247](https://folio-org.atlassian.net/browse/MODINVSTOR-1247))
* Implement publication period migration on big dataset, create new InstanceWithoutPubPeriod schema only for input request ([MODINVSTOR-1271](https://folio-org.atlassian.net/browse/MODINVSTOR-1271))

### Tech Dept
* Upgrade localstack from 0.11.3 to s3-latest (=3.8.0) ([MODINVSTOR-1272](https://folio-org.atlassian.net/browse/MODINVSTOR-1272))
Expand Down
4 changes: 2 additions & 2 deletions descriptors/ModuleDescriptor-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
},
{
"id": "instance-storage",
"version": "11.0",
"version": "11.1",
"handlers": [
{
"methods": ["GET"],
Expand Down Expand Up @@ -274,7 +274,7 @@
},
{
"id": "instance-storage-batch",
"version": "3.0",
"version": "3.1",
"handlers": [
{
"methods": ["POST"],
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<commons-lang3.version>3.17.0</commons-lang3.version>
<log4j.version>2.24.1</log4j.version>
<folio-s3-client.version>2.2.0-SNAPSHOT</folio-s3-client.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>

<okapi-testing.version>6.0.3</okapi-testing.version>
<junit.version>5.11.2</junit.version>
Expand Down Expand Up @@ -138,6 +139,11 @@
<artifactId>folio-s3-client</artifactId>
<version>${folio-s3-client.version}</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
</dependency>

<!-- Test Dependencies -->
<dependency>
Expand Down
4 changes: 4 additions & 0 deletions ramls/examples/instance_get.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"value": "1"
}
],
"publicationPeriod": {
"start": 1999,
"end": 2001
},
"instanceTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2c",
"tags" : {
"tagList" : [
Expand Down
4 changes: 4 additions & 0 deletions ramls/examples/instances_get.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"value": "1"
}
],
"publicationPeriod": {
"start": 1999,
"end": 2001
},
"instanceTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2c",
"tags" : {
"tagList" : [
Expand Down
56 changes: 56 additions & 0 deletions ramls/examples/instanceswithoutpubperiod_get.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"instances": [
{
"id": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
"title": "ADVANCING LIBRARY EDUCATION: TECHNOLOGICAL INNOVATION AND INSTRUCTIONAL DESIGN",
"source": "Local: MARC",
"contributors": [
{
"name": "Sigal, Ari",
"contributorNameTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2a",
"primary": true
}
],
"identifiers": [
{
"identifierTypeId": "2e48e713-17f3-4c13-a9f8-23845bb210af",
"value": "9781466636897"
},
{
"identifierTypeId": "6051f95c-028e-4c6a-8a9e-ee689dd51453",
"value": "1"
}
],
"instanceTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2c",
"tags" : {
"tagList" : [
"important"
]
}
},
{
"id": "f31a36de-fcf8-44f9-87ef-a55d06ad21ae",
"title": "ADVANCING RESEARCH METHODS WITH NEW TECHNOLOGIES.",
"source": "Local: MARC",
"contributors": [
{
"name": "Sappleton, Natalie",
"contributorNameTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2a",
"primary": true
}
],
"identifiers": [
{
"identifierTypeId": "2e48e713-17f3-4c13-a9f8-23845bb210af",
"value": "9781466639195"
},
{
"identifierTypeId": "6051f95c-028e-4c6a-8a9e-ee689dd51453",
"value": "2"
}
],
"instanceTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2c"
}
],
"totalRecords": 2
}
28 changes: 28 additions & 0 deletions ramls/examples/instancewithoutpubperiod_get.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"id": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
"source": "Local: MARC",
"title": "ADVANCING LIBRARY EDUCATION: TECHNOLOGICAL INNOVATION AND INSTRUCTIONAL DESIGN",
"contributors": [
{
"name": "Sigal, Ari",
"contributorNameTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2a",
"primary": true
}
],
"identifiers": [
{
"identifierTypeId": "2e48e713-17f3-4c13-a9f8-23845bb210af",
"value": "9781466636897"
},
{
"identifierTypeId": "6051f95c-028e-4c6a-8a9e-ee689dd51453",
"value": "1"
}
],
"instanceTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2c",
"tags" : {
"tagList" : [
"important"
]
}
}
5 changes: 4 additions & 1 deletion ramls/instance-storage-batch.raml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ documentation:
types:
errors: !include raml-util/schemas/errors.schema
instances: !include instances.json
instancesWithoutPubPeriod: !include instances-without-pub-period.json
instancesBatchResponse: !include instances-batch-response.json

/instance-storage/batch/instances:
Expand All @@ -19,7 +20,9 @@ types:
description: "Create collection of instances in one request - deprecated, use /instance-storage/sync instead"
body:
application/json:
type: instances
type: instancesWithoutPubPeriod
example:
value: !include examples/instanceswithoutpubperiod_get.json
responses:
201:
description: "At least one Instance from the list was created"
Expand Down
24 changes: 18 additions & 6 deletions ramls/instance-storage.raml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ documentation:
content: <b>Storage for instances in the inventory</b>

types:
instanceWithoutPubPeriod: !include instance-without-pub-period.json
instancesWithoutPubPeriod: !include instances-without-pub-period.json
instance: !include instance.json
instances: !include instances.json
marcJson: !include marc.json
Expand Down Expand Up @@ -60,16 +62,26 @@ resourceTypes:
displayName: Instances
type:
collection:
exampleCollection: !include examples/instances_get.json
schemaCollection: instances
schemaItem: instance
exampleItem: !include examples/instance_get.json
exampleCollection: !include examples/instanceswithoutpubperiod_get.json
schemaCollection: instancesWithoutPubPeriod
schemaItem: instanceWithoutPubPeriod
exampleItem: !include examples/instancewithoutpubperiod_get.json
get:
is: [pageable,
searchable: {description: "by title (using CQL)",
example: "title=\"*uproot*\""},
]
responses:
200:
body:
application/json:
type: instances
post:
responses:
200:
body:
application/json:
type: instance
psmagin marked this conversation as resolved.
Show resolved Hide resolved
delete:
is: [searchable: { description: "CQL to select instances to delete, use cql.allRecords=1 to delete all. Deletes connected marc source records.",
example: "hrid==\"in123-0*\"" } ]
Expand All @@ -89,8 +101,8 @@ resourceTypes:
/{instanceId}:
type:
collection-item:
exampleItem: !include examples/instance_get.json
schema: instance
exampleItem: !include examples/instancewithoutpubperiod_get.json
schema: instanceWithoutPubPeriod
get:
responses:
200:
Expand Down
Loading
Loading