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

Y24-190 - Move Sequencescape API v1 calls over to API v2 #1772

Open
2 tasks
sdjmchattie opened this issue Jul 9, 2024 · 2 comments
Open
2 tasks

Y24-190 - Move Sequencescape API v1 calls over to API v2 #1772

sdjmchattie opened this issue Jul 9, 2024 · 2 comments
Assignees
Labels
EPIC An EPIC task with sub-tasks

Comments

@sdjmchattie
Copy link
Contributor

sdjmchattie commented Jul 9, 2024

User story

Sequencescape API v1 will be shut down in the near future and has been deprecated for the past 5 years. We should switch usage of the API over to v2 by installing and making use of the json_api_client gem.

Who are the primary contacts for this story

Stuart McHattie

Who is the nominated tester for UAT

PSD

Acceptance criteria

To be considered successful the solution must allow:

  • No more API v1 calls are made to Sequencescape
  • All traces of sequencescape-client-api and its config have been removed.

Dependencies

Any new endpoints required in Sequencescape will have to be created as they are discovered to be missing. A new story should be created under that repository if there are indeed endpoints to create.

Child Stories

The following are stories included in develop-Y24-190 branches to be released together when the EPIC is complete.

Milestones

Additional context

The calls made during the last two week period are as below, with counts for each endpoint:

  • GET - /api/1/: 9236

  • GET - /api/1/barcode_printers: 3701

  • GET - /api/1/order_templates: 2

  • GET - /api/1/order_templates/2: 2

  • GET - /api/1/order_templates/3: 2

  • GET - /api/1/order_templates/4: 2

  • GET - /api/1/searches: 2

  • GET - /api/1/tag_layout_templates: 58

  • GET - /api/1/tag_layout_templates/2: 58

  • GET - /api/1/transfer_templates: 2

  • GET - /api/1/{uuid}: 2740

  • GET - /api/1/{uuid}/children: 67

  • GET - /api/1/{uuid}/creation_transfers: 3

  • GET - /api/1/{uuid}/qc_files: 40

  • GET - /api/1/{uuid}/submission_pools: 115

  • GET - /api/1/{uuid}/wells: 204

  • POST - /api/1/bait_library_layouts: 7

  • POST - /api/1/bait_library_layouts/preview: 7

  • POST - /api/1/bulk_transfers: 6

  • POST - /api/1/custom_metadatum_collections: 284

  • POST - /api/1/plate_conversions: 57

  • POST - /api/1/plate_creations: 206

  • POST - /api/1/pooled_plate_creations: 63

  • POST - /api/1/specific_tube_creations: 67

  • POST - /api/1/state_changes: 796

  • POST - /api/1/submissions: 10

  • POST - /api/1/tag_layouts: 18

  • POST - /api/1/transfer_request_collections: 295

  • POST - /api/1/tube_from_tube_creations: 67

  • POST - /api/1/work_completions: 101

  • POST - /api/1/{uuid}: 301

  • POST - /api/1/{uuid}/all: 34

  • POST - /api/1/{uuid}/first: 978

  • POST - /api/1/{uuid}/orders: 10

  • POST - /api/1/{uuid}/qc_files: 32

  • POST - /api/1/{uuid}/submit: 10

  • PUT - /api/1/{uuid}: 93

@sdjmchattie sdjmchattie self-assigned this Jul 9, 2024
@psd-issuer psd-issuer bot changed the title Move Sequencescape API v1 calls over to API v2 Y24-190 - Move Sequencescape API v1 calls over to API v2 Jul 9, 2024
@sdjmchattie
Copy link
Contributor Author

Review of V1 Usage

V1 API is accessed via the sequencescape-client-api gem which is loaded across the app as a variable called api.
Some usage of this variable name is also present for the V2 API which has been used in places.
One prominent place of V2 usage is the JavaScript (Vue.js) applications, so those can be disregarded.

Implemented V1 Calls

This list is parsed by looking at the usage of the api variable across Limber.
Examples that are clearly using V2 are excluded.
It may miss some use cases, but gives us a reasonable idea of the scope of the work needed both in Limber and in Sequencescape.
Entries in this list are in the format of V1 api calls with duplicates removed.

  • api.bait_library_layout.create!
  • api.bait_library_layout.preview! preview! seems to be an alias for create! but it's unclear.
  • api.barcode_printer.all
  • api.bulk_transfer.create!
  • api.custom_metadatum_collection.create!
  • api.multiplexed_library_tube.find(params["limber_multiplexed_library_tube_id"])
  • api.order_template.find({uuid})
  • api.plate_conversion.create!
  • api.plate_creation.create!
  • api.plate.find({uuid})
  • api.plate.find(params["limber_plate_id"])
  • api.pooled_plate_creation.create!
  • api.qc_file.find(params[:id])
  • api.qcable.find(params[:id])
  • api.search.all to add all searches to a hash in the config.
  • api.search.find(Settings.searches.fetch('Find plates')) to find plates with given search parameters.
  • api.search.find(Settings.searches.fetch('Find tubes')) to find tubes with given search parameters.
  • api.search.find(Settings.searches['Find assets by barcode'])
  • api.search.find(Settings.searches['Find plates']) fairly certain this is equivalent to earlier.
  • api.search.find(Settings.searches['Find qcable by barcode']).first(barcode: barcode)
  • api.submission.create!
  • api.state_change.create!
  • api.tag_layout.create!
  • api.tag_layout_template.all.map(&:coerce) coerce extends the class methods with classes defined in Limber.
  • api.transfer_request_collection.create!
  • api.transfer_template.find({uuid})
  • api.tube_from_tube_creation.create!
  • api.tube_purpose.create!
  • api.tube_rack.find(params["limber_tube_rack_id"])
  • api.tube.find({uuid})
  • api.tube.find(params[:limber_tube_id])
  • api.work_completion.create!

@sdjmchattie
Copy link
Contributor Author

V2 Calls that will need implementing in Sequencescape

The list above is everything being called in the V1 API.
The list below is which of those currently have no endpoint created under V2 in Sequencescape.
This does not mean they cannot be converted, it's just that we will need to add these to Sequencescape first.
Searches shouldn't be needed since JSONAPI (as used in V2) lets you filter on attributes without needing a search function.

  • api.bait_library_layout.create!
  • api.bait_library_layout.preview!
  • api.barcode_printer.all
  • api.bulk_transfer.create!
  • api.multiplexed_library_tube.find(params["limber_multiplexed_library_tube_id"])
  • api.order_template.find({uuid}) should be directed at submission templates when implemented.
  • api.plate_conversion.create!
  • api.plate_creation.create!
  • api.pooled_plate_creation.create!
  • api.qc_file.find(params[:id])
  • api.submission.create! the endpoint exists but is immutable right now
  • api.state_change.create! the endpoint exists but is immutable right now
  • api.tag_layout.create!
  • api.transfer_request_collection.create!
  • api.transfer_template.find({uuid})
  • api.tube_from_tube_creation.create!
  • api.tube_purpose.create!
  • api.tube.find({uuid}) the endpoint exists but is lacking the UUID
  • api.tube.find(params[:limber_tube_id]) the endpoint exists but is lacking the Limber tube ID field
  • api.work_completion.create!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EPIC An EPIC task with sub-tasks
Projects
None yet
Development

No branches or pull requests

2 participants