Details
-
Story
-
Status: Closed (View Workflow)
-
P3
-
Resolution: Done
-
None
-
None
-
-
ACQ Sprint 59
-
3
-
Thunderjet
Description
In a recent discussion we've decided to pursue a different approach to loading sample data which involves overriding the default implementation of the tenant interface (POST _/tenant). This API is called by OKAPI when the module is enabled for a tenant.
Basic approach:
- Execute the standard/default logic
- Look for one or more request parameters indicating whether or not to load sample and/or reference data. These parameters are specified in the tenantAttribute data.
- Conditionally read in data (from somewhere) and make appropriate API calls to insert the data
- The case of upgrades should be handled appropriately, e.g. if an upgrade and the data already exists, perform a PUT, otherwise, a POST will suffice.
This basic approach has been implemented for orders storage. See https://issues.folio.org/browse/MODORDSTOR-48. Much of this implementation can likely be borrowed.
Special sauce:
- Define system properties or module arguments which would be specified at runtime indicating whether or not to load sample and reference data. This would dictate the default behavior in the case where the aforementioned flags aren't specified by OKAPI when calling the tenant API. Note that these would be applied to ALL tenants, whereas the params provided by OKAPI would be tenant specific.
See related stories for additional details.
Additional context:
https://github.com/folio-org/okapi/blob/master/doc/guide.md#install-operation-example
https://github.com/folio-org/okapi/blob/master/doc/guide.md#tenant-parameters
Testing steps:
- Run attached script to get all vendor records from folio-snapshot
- At least 13 vendor records will be returned
TestRail: Results
Attachments
Issue Links
- blocks
-
FOLIO-1739 PR build pipeline for platform-complete releases
-
- Closed
-
- has to be finished together with
-
FOLIO-1887 folio-ansible: remove sample data loading for mod-vendors
-
- Closed
-
- is duplicated by
-
MODVEND-92 use loadSample/loadReference to load sample and reference data
-
- Closed
-
- relates to
-
FOLIO-1519 Automatic loading of sample and reference data
-
- Closed
-
-
MODINVSTOR-216 load reference data as part of the tenant init call
-
- Closed
-
-
MODORDSTOR-48 Rework how sample data is loaded
-
- Closed
-
-
MODORGSTOR-14 Schema Updates
-
- Closed
-
-
UXPROD-1815 support for upgrading schemas without complete reload of data (DB migrations) - PoC + devops guide
-
- Closed
-
-
UXPROD-2120 support for upgrading schemas without complete reload of data (DB migrations) - rollout + devops
-
- Closed
-
-
MODORDERS-170 Prevent ordering from Inactive vendors/access provider
-
- Closed
-
-
MODORDERS-192 API Tests for vendor/access provider status validation
-
- Closed
-
-
MODORGSTOR-3 Sample and Reference Data
-
- Closed
-