Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into y24-335-barcode-fo…
Browse files Browse the repository at this point in the history
…r-norm-plate-uat
  • Loading branch information
dasunpubudumal committed Nov 6, 2024
2 parents d8e9543 + b6cd841 commit cb6ba11
Show file tree
Hide file tree
Showing 42 changed files with 628 additions and 223 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/check_release_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ on:
pull_request:
branches:
- master
types:
# defaults
- opened
- synchronize
- reopened
# custom
- ready_for_review # required for Github-created PRs

jobs:
check:
runs-on: ubuntu-latest
# only run when PR is not draft
if: ${{ !github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Get specific changed files
id: changed-files-specific
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/create_release_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Create or update merge-to-master pull requests for production releases
# Note that by design, creating or editing a PR will not trigger a downstream `pull_request` event as this could lead to recursion
name: Release
on:
push:
branches:
- develop
jobs:
pull_request:
uses: sanger/.github/.github/workflows/create-release-pr.yml@master
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.15.1
22.11.0
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.45.0
14.48.0
122 changes: 61 additions & 61 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -34,73 +34,73 @@ GEM
specs:
aasm (5.5.0)
concurrent-ruby (~> 1.0)
actioncable (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
actioncable (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionmailbox (6.1.7.10)
actionpack (= 6.1.7.10)
activejob (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
mail (>= 2.7.1)
actionmailer (6.1.7.8)
actionpack (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionmailer (6.1.7.10)
actionpack (= 6.1.7.10)
actionview (= 6.1.7.10)
activejob (= 6.1.7.10)
activesupport (= 6.1.7.10)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.7.8)
actionview (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionpack (6.1.7.10)
actionview (= 6.1.7.10)
activesupport (= 6.1.7.10)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionpack-xml_parser (2.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
actiontext (6.1.7.8)
actionpack (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
actiontext (6.1.7.10)
actionpack (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
nokogiri (>= 1.8.5)
actionview (6.1.7.8)
activesupport (= 6.1.7.8)
actionview (6.1.7.10)
activesupport (= 6.1.7.10)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.7.8)
activesupport (= 6.1.7.8)
activejob (6.1.7.10)
activesupport (= 6.1.7.10)
globalid (>= 0.3.6)
activemodel (6.1.7.8)
activesupport (= 6.1.7.8)
activemodel (6.1.7.10)
activesupport (= 6.1.7.10)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (6.1.7.8)
activemodel (= 6.1.7.8)
activesupport (= 6.1.7.8)
activerecord (6.1.7.10)
activemodel (= 6.1.7.10)
activesupport (= 6.1.7.10)
activerecord-import (1.7.0)
activerecord (>= 4.2)
activeresource (6.1.0)
activemodel (>= 6.0)
activemodel-serializers-xml (~> 1.0)
activesupport (>= 6.0)
activestorage (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activesupport (= 6.1.7.8)
activestorage (6.1.7.10)
actionpack (= 6.1.7.10)
activejob (= 6.1.7.10)
activerecord (= 6.1.7.10)
activesupport (= 6.1.7.10)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.8)
activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -198,7 +198,7 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.3.4)
date (3.4.0)
delayed_job (4.1.11)
activesupport (>= 3.0, < 8.0)
delayed_job_active_record (4.1.8)
Expand Down Expand Up @@ -259,7 +259,7 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.1)
loofah (2.22.0)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand Down Expand Up @@ -287,7 +287,7 @@ GEM
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
mysql2 (0.5.6)
net-imap (0.4.14)
net-imap (0.5.0)
date
net-protocol
net-ldap (0.19.0)
Expand All @@ -298,7 +298,7 @@ GEM
net-smtp (0.5.0)
net-protocol
netrc (0.11.0)
nio4r (2.7.3)
nio4r (2.7.4)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
Expand All @@ -324,7 +324,7 @@ GEM
puma (6.4.3)
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.9)
rack (2.2.10)
rack-acceptable (0.1.0)
rack (>= 1.1.0)
rack-cors (2.0.2)
Expand All @@ -338,20 +338,20 @@ GEM
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.8)
actioncable (= 6.1.7.8)
actionmailbox (= 6.1.7.8)
actionmailer (= 6.1.7.8)
actionpack (= 6.1.7.8)
actiontext (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activemodel (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
rails (6.1.7.10)
actioncable (= 6.1.7.10)
actionmailbox (= 6.1.7.10)
actionmailer (= 6.1.7.10)
actionpack (= 6.1.7.10)
actiontext (= 6.1.7.10)
actionview (= 6.1.7.10)
activejob (= 6.1.7.10)
activemodel (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
bundler (>= 1.15.0)
railties (= 6.1.7.8)
railties (= 6.1.7.10)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
Expand All @@ -370,9 +370,9 @@ GEM
loofah (~> 2.21)
nokogiri (~> 1.14)
rails-perftest (0.0.7)
railties (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
railties (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand All @@ -390,7 +390,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.7)
rexml (3.3.9)
roo (2.10.1)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
Expand Down Expand Up @@ -502,7 +502,7 @@ GEM
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.5.1)
sprockets-rails (3.5.2)
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
Expand Down Expand Up @@ -562,7 +562,7 @@ GEM
ostruct
rainbow
yard
zeitwerk (2.6.18)
zeitwerk (2.7.1)

PLATFORMS
arm64-darwin
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v2/bait_library_layouts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def preview
respond_with_errors('Validation failed', e.record.errors.full_messages, :unprocessable_entity) and return
end

json = { data: { type: 'bait_library_layouts', attributes: { layout: preview.layout } } }
json = { data: { type: 'bait_library_layouts', attributes: { well_layout: preview.well_layout } } }
render json: json, status: :ok
end

Expand Down
6 changes: 5 additions & 1 deletion app/models/accessionable/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ class FieldSerializer
MISSING_DATA_AGGREEMENT_PRE2023 = 'missing: data agreement established pre-2023'
MISSING_ENDANGERED_SPECIES = 'missing: endangered species'
MISSING_HUMAN_IDENTIFIABLE = 'missing: human-identifiable'
MISSING_CONTROL_SAMPLE = 'missing: control sample'
MISSING_SAMPLE_GROUP = 'missing: sample group'

OTHER_DEFAULT_SETTINGS = [
NOT_COLLECTED,
Expand All @@ -107,7 +109,9 @@ class FieldSerializer
MISING_THIRD_PARTY_DATA,
MISSING_DATA_AGGREEMENT_PRE2023,
MISSING_ENDANGERED_SPECIES,
MISSING_HUMAN_IDENTIFIABLE
MISSING_HUMAN_IDENTIFIABLE,
MISSING_CONTROL_SAMPLE,
MISSING_SAMPLE_GROUP
].freeze

def value_for(value)
Expand Down
35 changes: 29 additions & 6 deletions app/models/cherrypick_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ class CherrypickTask < Task # rubocop:todo Metrics/ClassLength
#
# @return [CherrypickTask::ControlLocator] A generator of control locations
#
def new_control_locator(batch_id, total_wells, num_control_wells, wells_to_leave_free: DEFAULT_WELLS_TO_LEAVE_FREE)
CherrypickTask::ControlLocator.new(batch_id:, total_wells:, num_control_wells:, wells_to_leave_free:)

def new_control_locator(params)
CherrypickTask::ControlLocator.new(
batch_id: params[:batch_id],
total_wells: params[:total_wells],
num_control_wells: params[:num_control_wells],
wells_to_leave_free: params[:wells_to_leave_free] || DEFAULT_WELLS_TO_LEAVE_FREE,
control_source_plate: params[:control_source_plate],
template: params[:template]
)
end

#
Expand All @@ -38,7 +46,7 @@ def can_link_directly?
# rubocop:todo Metrics/ParameterLists
def pick_new_plate(requests, template, robot, plate_purpose, control_source_plate = nil, workflow_controller = nil)
target_type = PickTarget.for(plate_purpose)
perform_pick(requests, robot, control_source_plate, workflow_controller) do
perform_pick(requests, robot, control_source_plate, workflow_controller, template) do
target_type.new(template, plate_purpose.try(:asset_shape))
end
end
Expand All @@ -54,7 +62,7 @@ def pick_onto_partial_plate(
purpose = partial_plate.plate_purpose
target_type = PickTarget.for(purpose)

perform_pick(requests, robot, control_source_plate, workflow_controller) do
perform_pick(requests, robot, control_source_plate, workflow_controller, template) do
target_type
.new(template, purpose.try(:asset_shape), partial_plate)
.tap do
Expand All @@ -66,7 +74,7 @@ def pick_onto_partial_plate(
# rubocop:enable Metrics/ParameterLists

# rubocop:todo Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
def perform_pick(requests, robot, control_source_plate, workflow_controller) # rubocop:todo Metrics/AbcSize
def perform_pick(requests, robot, control_source_plate, workflow_controller, template) # rubocop:todo Metrics/AbcSize
max_plates = robot.max_beds
raise StandardError, 'The chosen robot has no beds!' if max_plates.zero?

Expand All @@ -80,7 +88,22 @@ def perform_pick(requests, robot, control_source_plate, workflow_controller) # r
num_plate = 0
batch = requests.first.batch
control_assets = control_source_plate.wells.joins(:samples)
control_locator = new_control_locator(batch.id, current_destination_plate.size, control_assets.count)
control_locator =
new_control_locator(
{
batch_id: batch.id,
total_wells: current_destination_plate.size,
num_control_wells: control_assets.count,
template: template,
control_source_plate: control_source_plate
}
)

if control_locator.handle_incompatible_plates
message = 'The control plate and plate template are incompatible'
workflow_controller.send(:flash)[:error] = message unless workflow_controller.nil?
workflow_controller.redirect_to action: 'stage', batch_id: batch.id, workflow_id: workflow.id
end
control_posns = control_locator.control_positions(num_plate)

# If is an incomplete plate, or a plate with a template applied, copy all the controls missing into the
Expand Down
Loading

0 comments on commit cb6ba11

Please sign in to comment.