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

Fixes for 4270 y24 245 remove fake cherry picks #4365

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 5 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.0)
logger (1.6.1)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -320,7 +320,7 @@ GEM
pry (>= 0.13.0)
psych (3.3.4)
public_suffix (6.0.0)
puma (6.4.2)
puma (6.4.3)
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.9)
Expand Down Expand Up @@ -389,8 +389,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.6)
strscan
rexml (3.3.7)
roo (2.10.1)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
Expand Down Expand Up @@ -471,7 +470,7 @@ GEM
sanitize (6.1.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
selenium-webdriver (4.22.0)
selenium-webdriver (4.25.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
Expand Down Expand Up @@ -507,7 +506,6 @@ GEM
activesupport (>= 6.1)
sprockets (>= 3.0.0)
ssrf_filter (1.1.2)
strscan (3.1.0)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
syntax_tree-haml (4.0.3)
Expand Down Expand Up @@ -544,7 +542,7 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket (1.2.10)
websocket (1.2.11)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down
1 change: 1 addition & 0 deletions app/frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
parserOptions: {
parser: "babel-eslint",
sourceType: "module",
ecmaVersion: 2018,
},
rules: {
"no-unused-vars": [
Expand Down
14 changes: 7 additions & 7 deletions features/api/tag_layout_templates.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
And the UUID for the plate "Testing the API" is "11111111-2222-3333-4444-000000000002"
And all wells on the plate "Testing the API" have unique samples

Given a "Stock plate" plate called "Testing the tagging" exists
Given a "Stock plate" input plate called "Testing the tagging" exists
And the UUID for the plate "Testing the tagging" is "11111111-2222-3333-4444-000000000001"
And the wells for the plate "Testing the API" have been pooled in columns to the plate "Testing the tagging"

Expand Down Expand Up @@ -290,7 +290,7 @@
And the UUID for the plate "Testing the API" is "11111111-2222-3333-4444-000000000002"
And all wells on the plate "Testing the API" have unique samples

Given a "Stock plate" plate called "Testing the tagging" exists
Given a "Stock plate" input plate called "Testing the tagging" exists
And the UUID for the plate "Testing the tagging" is "11111111-2222-3333-4444-000000000001"
And the wells for the plate "Testing the API" have been pooled to the plate "Testing the tagging" according to the pooling strategy 96
And "F11-F12" of the plate "Testing the tagging" have been failed
Expand Down Expand Up @@ -460,7 +460,7 @@
And the UUID for the plate "Testing the API" is "11111111-2222-3333-4444-000000000002"
And all wells on the plate "Testing the API" have unique samples

Given a "Stock plate" plate called "Testing the tagging" exists
Given a "Stock plate" input plate called "Testing the tagging" exists
And the UUID for the plate "Testing the tagging" is "11111111-2222-3333-4444-000000000001"
And the wells for the plate "Testing the API" have been pooled in columns to the plate "Testing the tagging"

Expand Down Expand Up @@ -550,7 +550,7 @@
And the UUID for the plate "Testing the API" is "11111111-2222-3333-4444-000000000002"
And all wells on the plate "Testing the API" have unique samples

Given a "Stock plate" plate called "Testing the tagging" exists
Given a "Stock plate" input plate called "Testing the tagging" exists
And the UUID for the plate "Testing the tagging" is "11111111-2222-3333-4444-000000000001"
And the wells for the plate "Testing the API" have been pooled to the plate "Testing the tagging" according to the pooling strategy 8, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 4

Expand Down Expand Up @@ -597,7 +597,7 @@
}
"""

Then the tag layout on the plate "Testing the tagging" should be:

Check failure on line 600 in features/api/tag_layout_templates.feature

View workflow job for this annotation

GitHub Actions / cucumber_tests (2, 1)

Creating a tag layout where the pools are factors of the number of rows on the plate failed: Tag assignment appears to be invalid

Check failure on line 600 in features/api/tag_layout_templates.feature

View workflow job for this annotation

GitHub Actions / cucumber_tests (2, 0)

Creating a tag layout where the pools are factors of the number of rows on the plate failed: Tag assignment appears to be invalid
| AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA |
| CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC |
| TTTT | TTTT | TTTT | TTTT | TTTT | TTTT | TTTT | TTTT | TTTT | TTTT | TTTT | TTTT |
Expand Down Expand Up @@ -633,7 +633,7 @@
And the UUID for the plate "Testing the API" is "11111111-2222-3333-4444-000000000002"
And all wells on the plate "Testing the API" have unique samples

Given a "Stock plate" plate called "Testing the tagging" exists
Given a "Stock plate" input plate called "Testing the tagging" exists
And the UUID for the plate "Testing the tagging" is "11111111-2222-3333-4444-000000000001"
And the wells for the plate "Testing the API" have been pooled to the plate "Testing the tagging" according to the pooling strategy 8, 2, 10, 4, 8, 2, 10, 4, 8, 2, 10, 4, 8, 8, 8

Expand Down Expand Up @@ -681,7 +681,7 @@
}
"""

Then the tag layout on the plate "Testing the tagging" should be:

Check failure on line 684 in features/api/tag_layout_templates.feature

View workflow job for this annotation

GitHub Actions / cucumber_tests (2, 1)

Creating a tag layout where the pools are awkwardly sized and cause overlaps failed: Tag assignment appears to be invalid

Check failure on line 684 in features/api/tag_layout_templates.feature

View workflow job for this annotation

GitHub Actions / cucumber_tests (2, 0)

Creating a tag layout where the pools are awkwardly sized and cause overlaps failed: Tag assignment appears to be invalid
| AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA | AAAA |
| CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC | CCCC |
| TTTT | TTTT | GAGA | TTTT | TTTT | GAGA | TTTT | TTTT | GAGA | TTTT | TTTT | TTTT |
Expand All @@ -706,7 +706,7 @@
And the UUID for the plate "Testing the API" is "11111111-2222-3333-4444-000000000002"
And all wells on the plate "Testing the API" have unique samples

Given a "Stock plate" plate called "Testing the tagging" exists
Given a "Stock plate" input plate called "Testing the tagging" exists
And the UUID for the plate "Testing the tagging" is "11111111-2222-3333-4444-000000000001"
And the wells for the plate "Testing the API" have been pooled to the plate "Testing the tagging" according to the pooling strategy 96

Expand Down Expand Up @@ -747,7 +747,7 @@
And all wells on the plate "Testing the API" have unique samples
And H12 on the plate "Testing the API" is empty

Given a "Stock plate" plate called "Testing the tagging" exists
Given a "Stock plate" input plate called "Testing the tagging" exists
And the UUID for the plate "Testing the tagging" is "11111111-2222-3333-4444-000000000001"
And the wells for the plate "Testing the API" have been pooled to the plate "Testing the tagging" according to the pooling strategy 95

Expand Down
81 changes: 81 additions & 0 deletions features/api/tag_layouts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,46 @@
}
"""

@tag_layout @create @barcode-service
Scenario: Creating a tag layout of an entire plate using 96 tags by pools
Given the Baracoda barcode service returns "SQPD-1000001"
Given the Baracoda barcode service returns "SQPD-1000002"
Given the tag group "Example Tag Group" exists
And the UUID for the tag group "Example Tag Group" is "00000000-1111-2222-3333-444444444444"
And the tag group "Example Tag Group" has 20 tags

Given a "Stock plate" plate called "Testing the API" exists
And the UUID for the plate "Testing the API" is "11111111-2222-3333-4444-000000000002"
And all wells on the plate "Testing the API" have unique samples

Given a "Stock plate" plate called "Testing the tagging" exists
And the UUID for the plate "Testing the tagging" is "11111111-2222-3333-4444-000000000001"
And the wells for the plate "Testing the API" have been pooled to the plate "Testing the tagging" according to the pooling strategy 12, 8, 20, 12, 8, 20, 16

When I make an authorised POST with the following JSON to the API path "/tag_layouts":
"""
{
"tag_layout": {
"plate": "11111111-2222-3333-4444-000000000001",
"user": "99999999-8888-7777-6666-555555555555",
"tag_group": "00000000-1111-2222-3333-444444444444",
"direction": "column",
"walking_by": "manual by pool",
"initial_tag": 0
}
}
"""
Then the HTTP response should be "201 Created"

Then the tag layout on the plate "Testing the tagging" should be:

Check failure on line 89 in features/api/tag_layouts.feature

View workflow job for this annotation

GitHub Actions / cucumber_tests (2, 1)

Creating a tag layout of an entire plate using 96 tags by pools failed: Tag assignment appears to be invalid

Check failure on line 89 in features/api/tag_layouts.feature

View workflow job for this annotation

GitHub Actions / cucumber_tests (2, 0)

Creating a tag layout of an entire plate using 96 tags by pools failed: Tag assignment appears to be invalid
| TAG1 | TAG9 | TAG5 | TAG5 | TAG13 | TAG1 | TAG9 | TAG5 | TAG5 | TAG13 | TAG1 | TAG9 |
| TAG2 | TAG10 | TAG6 | TAG6 | TAG14 | TAG2 | TAG10 | TAG6 | TAG6 | TAG14 | TAG2 | TAG10 |
| TAG3 | TAG11 | TAG7 | TAG7 | TAG15 | TAG3 | TAG11 | TAG7 | TAG7 | TAG15 | TAG3 | TAG11 |
| TAG4 | TAG12 | TAG8 | TAG8 | TAG16 | TAG4 | TAG12 | TAG8 | TAG8 | TAG16 | TAG4 | TAG12 |
| TAG5 | TAG1 | TAG1 | TAG9 | TAG17 | TAG5 | TAG1 | TAG1 | TAG9 | TAG17 | TAG5 | TAG13 |
| TAG6 | TAG2 | TAG2 | TAG10 | TAG18 | TAG6 | TAG2 | TAG2 | TAG10 | TAG18 | TAG6 | TAG14 |
| TAG7 | TAG3 | TAG3 | TAG11 | TAG19 | TAG7 | TAG3 | TAG3 | TAG11 | TAG19 | TAG7 | TAG15 |
| TAG8 | TAG4 | TAG4 | TAG12 | TAG20 | TAG8 | TAG4 | TAG4 | TAG12 | TAG20 | TAG8 | TAG16 |

@tag_layout @create @barcode-service
Scenario: Creating a tag layout of an entire plate using 96 tags by pools
Expand Down Expand Up @@ -139,6 +179,47 @@
| TAG8 | TAG16 | TAG24 | TAG32 | TAG40 | TAG47 | TAG55 | TAG63 | TAG71 | TAG79 | TAG87 | TAG95 |


@tag_layout @create @barcode-service
Scenario: Creating a tag layout of an entire plate using 96 tags by pools with an offset
Given the Baracoda barcode service returns "SQPD-1000001"
Given the Baracoda barcode service returns "SQPD-1000002"
Given the tag group "Example Tag Group" exists
And the UUID for the tag group "Example Tag Group" is "00000000-1111-2222-3333-444444444444"
And the tag group "Example Tag Group" has 30 tags

Given a "Stock plate" plate called "Testing the API" exists
And the UUID for the plate "Testing the API" is "11111111-2222-3333-4444-000000000002"
And all wells on the plate "Testing the API" have unique samples

Given a "Stock plate" plate called "Testing the tagging" exists
And the UUID for the plate "Testing the tagging" is "11111111-2222-3333-4444-000000000001"
And the wells for the plate "Testing the API" have been pooled to the plate "Testing the tagging" according to the pooling strategy 12, 8, 20, 12, 8, 20, 16

When I make an authorised POST with the following JSON to the API path "/tag_layouts":
"""
{
"tag_layout": {
"plate": "11111111-2222-3333-4444-000000000001",
"user": "99999999-8888-7777-6666-555555555555",
"tag_group": "00000000-1111-2222-3333-444444444444",
"direction": "column",
"walking_by": "manual by pool",
"initial_tag": 10
}
}
"""
Then the HTTP response should be "201 Created"

Then the tag layout on the plate "Testing the tagging" should be:

Check failure on line 213 in features/api/tag_layouts.feature

View workflow job for this annotation

GitHub Actions / cucumber_tests (2, 1)

Creating a tag layout of an entire plate using 96 tags by pools with an offset failed: Tag assignment appears to be invalid

Check failure on line 213 in features/api/tag_layouts.feature

View workflow job for this annotation

GitHub Actions / cucumber_tests (2, 0)

Creating a tag layout of an entire plate using 96 tags by pools with an offset failed: Tag assignment appears to be invalid
| TAG11 | TAG19 | TAG15 | TAG15 | TAG23 | TAG11 | TAG19 | TAG15 | TAG15 | TAG23 | TAG11 | TAG19 |
| TAG12 | TAG20 | TAG16 | TAG16 | TAG24 | TAG12 | TAG20 | TAG16 | TAG16 | TAG24 | TAG12 | TAG20 |
| TAG13 | TAG21 | TAG17 | TAG17 | TAG25 | TAG13 | TAG21 | TAG17 | TAG17 | TAG25 | TAG13 | TAG21 |
| TAG14 | TAG22 | TAG18 | TAG18 | TAG26 | TAG14 | TAG22 | TAG18 | TAG18 | TAG26 | TAG14 | TAG22 |
| TAG15 | TAG11 | TAG11 | TAG19 | TAG27 | TAG15 | TAG11 | TAG11 | TAG19 | TAG27 | TAG15 | TAG23 |
| TAG16 | TAG12 | TAG12 | TAG20 | TAG28 | TAG16 | TAG12 | TAG12 | TAG20 | TAG28 | TAG16 | TAG24 |
| TAG17 | TAG13 | TAG13 | TAG21 | TAG29 | TAG17 | TAG13 | TAG13 | TAG21 | TAG29 | TAG17 | TAG25 |
| TAG18 | TAG14 | TAG14 | TAG22 | TAG30 | TAG18 | TAG14 | TAG14 | TAG22 | TAG30 | TAG18 | TAG26 |

@tag_layout @create @barcode-service
Scenario: Creating a tag layout of an entire plate using 96 tags by pools with an offset
Given the Baracoda barcode service returns "SQPD-1000001"
Expand Down
6 changes: 6 additions & 0 deletions features/support/step_definitions/plate_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@
plate_purpose.create!(name: plate_name)
end

Given /^a "([^"]+)" input plate called "([^"]+)" exists$/ do |name, plate_name|
plate_purpose = PlatePurpose.find_by!(name: name)
# binding.pry
plate_purpose.create!(name: plate_name)
end

Given(/^a plate called "([^"]*)" exists with purpose "([^"]*)"$/) do |name, purpose_name|
purpose = Purpose.find_by(name: purpose_name) || FactoryBot.create(:plate_purpose, name: purpose_name)
FactoryBot.create(:plate, name: name, purpose: purpose, well_count: 8)
Expand Down
28 changes: 27 additions & 1 deletion features/support/step_definitions/tag_layout_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,27 +112,53 @@ def check_tag2_layout(name, well_range, expected_wells_to_oligos) # rubocop:todo
set_uuid_for(TagLayout.find(id).plate, uuid_value)
end

# Pooling from source plate ("Testing the API") to destination plate ("Testing the tagging") with a specified pooling
# strategy
#
# rubocop:todo Metrics/MethodLength
def pool_by_strategy(source, destination, pooling_strategy) # rubocop:todo Metrics/AbcSize
unless pooling_strategy.sum == source.size
Rails.logger.info("Pooling strategy does not fit plate size #{source.size}: #{pooling_strategy.inspect}")
end

# Column major: reads columns from left to right, top to bottom
# Row major: reads rows from top to bottom, left to right
# For example, a 96-well plate would be read as: A1, B1, C1, D1, E1, F1, G1, H1, A2, B2, C2, D2, E2, F2, G2, H2, ...
source_wells = source.wells.in_column_major_order.to_a
destination_wells = destination.wells.in_column_major_order.to_a

pooling_strategy.each_with_index do |pool, _old_submission_id|
submission_id = Submission.create!(user: User.first || User.create!(login: 'a')).id
# This will generate a new submission for each pool. So the number of submissions will be equal to the number of
# pools. For example, for a pooling strategy of [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], there will be 12 submissions.
submission = Submission.create!(user: User.first || User.create!(login: 'a'))
submission_id = submission.id
# Slice operation cuts the array in place (i.e., removes the elements cut from the well array),
# so we need to assign the result to a new variable
wells_for_source, wells_for_destination = source_wells.slice!(0, pool), destination_wells.slice!(0, pool)
wells_for_source
.zip(wells_for_destination)
.each do |w|
# Because of the way we use zip w.first would be the source, w.last would be the destination
# This is the transfer request that would be created by the API.
# Note that transfer request behavior not used for input plates. For input plates, it is overridden
# to use requests (see app/models/well.rb:120).
# Creating TransferRequests invokes a callback that transfers aliquots from source to destination wells.
TransferRequest.create!(asset: w.first, target_asset: w.last, submission_id: submission_id)
# This request is for the source plate.
FactoryBot.create :request_without_submission,
asset: w.first,
target_asset: w.last,
submission_id: submission_id
end
end

# Create a request for each well in the destination plate
# This is required for input plates
if destination.purpose.is_a?(PlatePurpose::Input)
destination.wells.each do |well|
FactoryBot.create(:customer_request, asset: well, sti_type: 'Request::LibraryCreation', state: 'pending')
end
end
end
# rubocop:enable Metrics/MethodLength
# This fakes out the transfers so that they look like they came from different submissions, effectively meaning
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"jest": "^26.6.3",
"miragejs": "^0.1.48",
"prettier": "^3.3.2",
"vite": "^5.3.2",
"vite": "^5.3.6",
"vite-plugin-ruby": "^5.0.0",
"vite-plugin-vue2": "^1.9.3",
"vue-jest": "^3.0.7"
Expand Down
5 changes: 4 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { createVuePlugin } from "vite-plugin-vue2";
import legacy from "@vitejs/plugin-legacy";

export default defineConfig({
build: { emptyOutDir: true },
build: {
emptyOutDir: true,
target: ["chrome65", "es2019"],
},
plugins: [RubyPlugin(), createVuePlugin(), legacy({ targets: ["defaults"] })],
resolve: {
alias: {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7281,10 +7281,10 @@ vite-plugin-vue2@^1.9.3:
source-map "^0.7.3"
vue-template-es2015-compiler "^1.9.1"

vite@^5.3.2:
version "5.3.3"
resolved "https://registry.yarnpkg.com/vite/-/vite-5.3.3.tgz#5265b1f0a825b3b6564c2d07524777c83e3c04c2"
integrity sha512-NPQdeCU0Dv2z5fu+ULotpuq5yfCS1BzKUIPhNbP3YBfAMGJXbt2nS+sbTFu+qchaqWTD+H3JK++nRwr6XIcp6A==
vite@^5.3.6:
version "5.3.6"
resolved "https://registry.yarnpkg.com/vite/-/vite-5.3.6.tgz#e097c0a7b79adb2e60bec9ef7907354f09d027bd"
integrity sha512-es78AlrylO8mTVBygC0gTC0FENv0C6T496vvd33ydbjF/mIi9q3XQ9A3NWo5qLGFKywvz10J26813OkLvcQleA==
dependencies:
esbuild "^0.21.3"
postcss "^8.4.39"
Expand Down
Loading