F1 (Java) Story 22 [Storage]: Implement copying record references between namespaces
Description
Implement copying records between namespaces in OSDU Storage service. See ADR - Project & Workflow Services - Core Services Integration - Copy Record references between namespaces for details
Acceptance criteria
Storage service has API and service implemented for copying record references between namespaces
Out of scope
- How conflicts will be handled when the destination namespace has a newer version that already exists.
- How collaborations will act on this or control this behavior or even what a collaboration entity looks like
- hard delete API update is out of scope.
Testing scenarios
- copy record reference from one SOR to custom NS
- copy record reference from one custom NS1 to NS2
- copy record reference from one custom NS to SOR
Technical notes
- Add new Collaboration API here https://community.opengroup.org/osdu/platform/system/storage/-/tree/master/storage-core/src/main/java/org/opengroup/osdu/storage/api
- Should be supplemented with swagger docs.
- Add new Collaboration service here https://community.opengroup.org/osdu/platform/system/storage/-/tree/master/storage-core/src/main/java/org/opengroup/osdu/storage/service
- Copy from SOR to WIP,
- Validate that the source records are present by calling
getMultipleRecords
- Validate that the target records are absent by calling the same method but with the provided Collaboration Context, which should be taken from the request body.
- Push record copies to the
createUpdateRecords
with collab context provided, which should be taken from the request body.
- Validate that the source records are present by calling
- Copy from WIP to WIP.
- Validate that the source records are present by calling
getMultipleRecords
with the provided Collaboration Context, should be taken from header. - Validate that the target records are absent by calling the same method but with the provided Collaboration Context, which should be taken from the request body.
- Push record copies to the
createUpdateRecords
with collab context provided, which should be taken from the request body.
- Validate that the source records are present by calling
- Copy from WIP to SOR
- Validate that the source records are present by calling
getMultipleRecords
with the provided Collaboration Context, should be taken from header. - Should we validate that the initial versions of SOR records are present?
- Push record copies to the
createUpdateRecords
without collab context provided, adjust record ID if necessary.
- Validate that the source records are present by calling
- Copy from SOR to WIP,
3.In order to comply with the requirement from ADR, We need to update the hard deletion method in :RecordServiceImpl
, but that might require adding a dependency on the PWS service since we do not have any other means to verify that the record exists in WIP.
The hard delete API in storage service needs to add extra validation that the data blob being deleted from storage is not referenced in a different context.
-
Messaging for collaboration context is not implemented in the AWS module. We may use Azure
MessageBusImpl
andServiceBusPublisher
as a samples.From a high-level perspective, it appears that Azure does not utilize separate topics; instead, it enhances event messages with collaboration context if it is available.Azure message publisher uses 2 separate topics but AWS uses only 1, we will have to collaborate with AWS team, to get 2d topic provisioned in dev environment. -
Add new test cases to the IT core module https://community.opengroup.org/osdu/platform/system/storage/-/tree/master/testing/storage-test-core/src/main/java/org/opengroup/osdu/storage/records
I should be able to copy existing in the SOR record to the custom WIP Context
I should be able to copy existing in the WIP Context record to the SOR
I should be able to copy existing in the WIP Context record to another WIP Context
I shouldn't be able to copy existing in the SOR record to the custom WIP Context if it exists in WIP
I shouldn't be able to copy not existing records
-
Update static openapi docs in the repo.
-
Update tutorials with newly added API. https://community.opengroup.org/osdu/platform/system/storage/-/tree/master/docs/docs?ref_type=heads