Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4a02604
Update mocha to version 3.0.1
depfu[bot] Dec 22, 2025
bff935f
Update Ruby to version 3.4.8
depfu[bot] Dec 25, 2025
b52a085
Update rubocop to version 1.82.1
depfu[bot] Dec 25, 2025
8b28e89
Update listen to version 3.10.0
depfu[bot] Jan 23, 2026
f83bf21
Merge pull request #636 from sanger/depfu/update/listen-3.10.0
depfu[bot] Jan 23, 2026
025ed2c
Update selenium-webdriver to version 4.40.0
depfu[bot] Jan 26, 2026
989c555
Merge pull request #638 from sanger/depfu/update/selenium-webdriver-4…
depfu[bot] Jan 26, 2026
2bd8509
feat(barcode-printing): removes v1 api barcode printing, updates qcab…
BenTopping Jan 28, 2026
0db4c0f
style: apply fixes for indentation consistency cop
BenTopping Jan 28, 2026
57aae87
Merge pull request #628 from sanger/depfu/update/rubocop-1.82.1
depfu[bot] Jan 28, 2026
9ada89d
Merge pull request #639 from sanger/Y25-482-print-using-v2
BenTopping Jan 28, 2026
3eed4c2
Update rubocop-rails to version 2.34.3
depfu[bot] Jan 28, 2026
79acce7
Update puma to version 7.2.0
depfu[bot] Jan 28, 2026
4877019
Merge pull request #640 from sanger/depfu/update/puma-7.2.0
depfu[bot] Jan 28, 2026
7a061f6
feat(barcode-printer): removes sequencescape v1 references for barcod…
BenTopping Jan 29, 2026
7be732a
Merge pull request #641 from sanger/Y25-482-print-using-v2
BenTopping Feb 3, 2026
6e0af66
style: corrects Layout/IndentationConsistency and Layout/IndentationW…
BenTopping Feb 3, 2026
1423243
Merge pull request #632 from sanger/depfu/update/rubocop-rails-2.34.3
depfu[bot] Feb 3, 2026
79d5c5d
Merge pull request #627 from sanger/depfu/engine/ruby-3.4.8
BenTopping Feb 3, 2026
644844b
tests: corrects method stub expectations for stamps_controller
BenTopping Feb 3, 2026
fab88cf
Merge pull request #626 from sanger/depfu/update/mocha-3.0.1
BenTopping Feb 3, 2026
cfdf172
Update rubocop to version 1.84.1
depfu[bot] Feb 3, 2026
62e663d
Update syslog to version 0.4.0
depfu[bot] Feb 5, 2026
6e45ea4
Merge pull request #643 from sanger/depfu/update/syslog-0.4.0
StephenHulme Feb 6, 2026
4ce89fb
style: lint
StephenHulme Feb 6, 2026
17afaf5
Merge pull request #642 from sanger/depfu/update/rubocop-1.84.1
depfu[bot] Feb 6, 2026
646d8e1
misc: bumps release version
BenTopping Feb 9, 2026
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
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.18.0
1.18.1
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.4
3.4.8
43 changes: 24 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ GEM
execjs (~> 2)
base64 (0.3.0)
benchmark (0.5.0)
bigdecimal (3.3.1)
bigdecimal (4.0.1)
bootsnap (1.21.1)
msgpack (~> 1.2)
bootstrap-datepicker-rails (1.10.0.1)
Expand Down Expand Up @@ -155,18 +155,20 @@ GEM
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
ffi (1.16.3)
ffi (1.17.3-arm64-darwin)
ffi (1.17.3-x86_64-darwin)
ffi (1.17.3-x86_64-linux-gnu)
globalid (1.3.0)
activesupport (>= 6.1)
hashie (5.1.0)
logger
i18n (1.14.7)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
jquery-rails (4.6.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.16.0)
json (2.18.1)
json_api_client (1.21.0)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
Expand All @@ -180,7 +182,8 @@ GEM
childprocess (~> 5.0)
logger (~> 1.6)
lint_roller (1.1.0)
listen (3.9.0)
listen (3.10.0)
logger
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.7.0)
Expand All @@ -204,7 +207,7 @@ GEM
minitest-rails-capybara (0.0.2)
capybara
minitest-rails
mocha (2.8.2)
mocha (3.0.1)
ruby2_keywords (>= 0.0.5)
msgpack (1.8.0)
multi_json (1.15.0)
Expand All @@ -219,7 +222,7 @@ GEM
timeout
net-smtp (0.5.1)
net-protocol
nio4r (2.7.4)
nio4r (2.7.5)
nokogiri (1.18.10-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.10-x86_64-darwin)
Expand All @@ -231,17 +234,17 @@ GEM
ostruct (>= 0.2)
ostruct (0.6.3)
parallel (1.27.0)
parser (3.3.10.0)
parser (3.3.10.1)
ast (~> 2.4.1)
racc
prism (1.6.0)
prism (1.9.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-rails (0.3.11)
pry (>= 0.13.0)
public_suffix (6.0.1)
puma (7.1.0)
puma (7.2.0)
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.21)
Expand Down Expand Up @@ -282,28 +285,28 @@ GEM
rainbow (3.1.1)
rake (13.3.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
rb-inotify (0.11.1)
ffi (~> 1.0)
regexp_parser (2.11.3)
rexml (3.4.4)
roo (2.8.3)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
rubocop (1.81.7)
rubocop (1.84.1)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.48.0)
rubocop-ast (1.49.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-rails (2.34.0)
prism (~> 1.7)
rubocop-rails (2.34.3)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
Expand All @@ -321,7 +324,7 @@ GEM
sprockets-rails
tilt
securerandom (0.4.1)
selenium-webdriver (4.39.0)
selenium-webdriver (4.40.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
Expand All @@ -347,7 +350,8 @@ GEM
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
syslog (0.2.0)
syslog (0.4.0)
logger
thor (1.4.0)
tilt (2.1.0)
timecop (0.9.10)
Expand All @@ -358,7 +362,7 @@ GEM
execjs (>= 0.3.0, < 3)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
unicode-emoji (4.2.0)
websocket (1.2.11)
websocket-driver (0.8.0)
base64
Expand All @@ -373,6 +377,7 @@ PLATFORMS
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
arm64-darwin-25
x86_64-darwin-21
x86_64-linux

Expand Down
6 changes: 1 addition & 5 deletions app/controllers/concerns/barcode_printing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
# Include to provide barcode printing functionality to a controller
module BarcodePrinting
def find_printer
@printer = api.barcode_printer.find(params[:barcode_printer])
end

def find_printer_v2
@printer_v2 = Sequencescape::Api::V2::BarcodePrinter.where(uuid: params[:barcode_printer]).first
@printer = Sequencescape::Api::V2::BarcodePrinter.where(uuid: params[:barcode_printer]).first
end
end
4 changes: 2 additions & 2 deletions app/controllers/qcables_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class QcablesController < ApplicationController
include BarcodePrinting

before_action :find_user, :find_lot
before_action :find_printer_v2, only: [:create]
before_action :find_printer, only: [:create]

##
# This action should generally get called through the nested
Expand Down Expand Up @@ -87,7 +87,7 @@ def print_labels(qc_creator)
end

begin
BarcodeSheet.new(@printer_v2, labels).print!
BarcodeSheet.new(@printer, labels).print!
rescue BarcodeSheet::PrintError => e
flash[:danger] = "There was a problem printing your barcodes. Your #{qcable_name.pluralize} have still been created. #{e.message}"
rescue Errno::ECONNREFUSED
Expand Down
4 changes: 2 additions & 2 deletions app/models/qc_asset_creator/multiple_tag2_conversion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def tag2_qcables
@tag2_qcables ||= api.search.find(Settings.searches['Find qcable by barcode'])
.all(Gatekeeper::Qcable, barcode: tag2_tubes_barcodes.values)
.inject({}) do |hash, qcable|
hash[qcable.barcode.ean13] = qcable
hash
hash[qcable.barcode.ean13] = qcable
hash
end
end

Expand Down
11 changes: 2 additions & 9 deletions lib/tasks/config.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ namespace :config do
task generate: :environment do
api = Sequencescape::Api.new(Gatekeeper::Application.config.api_connection_options)

barcode_printer_uuid = lambda do |printers|
->(printer_name) {
printers.detect { |prt| prt.name == printer_name }.try(:uuid) ||
raise("Printer #{printer_name}: not found!")
}
end.(api.barcode_printer.all)

# Build the configuration file based on the server we are connected to.
CONFIG = {}.tap do |configuration|
configuration[:searches] = {}.tap do |searches|
Expand All @@ -25,8 +18,8 @@ namespace :config do
configuration[:printers] = Hash.new { |h, i| h[i] = Array.new }.tap do |printers|
approved_printers = Gatekeeper::Application.config.approved_printers
puts 'Preparing printers ...'
selected = api.barcode_printer.all.select { |printer| printer.active && (approved_printers == :all || approved_printers.include?(printer.name)) }
selected.each { |printer| printers[printer.type.name] << { name: printer.name, uuid: printer.uuid } }
selected = Sequencescape::Api::V2::BarcodePrinter.all.select { |printer| printer.active && (approved_printers == :all || approved_printers.include?(printer.name)) }
selected.each { |printer| printers[printer.barcode_type] << { name: printer.name, uuid: printer.uuid } }
end

# Might want to switch this out for something more dynamic, but seeing as we'll almost certainly be working with a filtered set
Expand Down
11 changes: 9 additions & 2 deletions test/controllers/barcode_labels_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ class BarcodeLabelsControllerTest < ActionController::TestCase

setup do
mock_api
printer = api.barcode_printer.find('baac0dea-0000-0000-0000-000000000000')
printer.stubs(:print_service).returns('PMB')
@params = {
prefix: 'ABC',
study: 'Study1',
Expand All @@ -19,6 +17,9 @@ class BarcodeLabelsControllerTest < ActionController::TestCase
end

test 'should print barcodes and return success' do
Sequencescape::Api::V2::BarcodePrinter.expects(:where).returns([Sequencescape::Api::V2::BarcodePrinter.new(
print_service: 'PMB', name: 'Test Printer', barcode_type: 'something'
)])
mock_barcode_sheet = mock('printer')
mock_barcode_sheet.expects(:print!).returns(true)
BarcodeSheet.expects(:new).returns(mock_barcode_sheet)
Expand All @@ -31,6 +32,9 @@ class BarcodeLabelsControllerTest < ActionController::TestCase
end

test 'should handle BarcodeSheet::PrintError' do
Sequencescape::Api::V2::BarcodePrinter.expects(:where).returns([Sequencescape::Api::V2::BarcodePrinter.new(
print_service: 'PMB', name: 'Test Printer', barcode_type: 'something'
)])
mock_barcode_sheet = mock('printer')
mock_barcode_sheet.expects(:print!).raises(BarcodeSheet::PrintError.new('Printer jammed'))
BarcodeSheet.expects(:new).returns(mock_barcode_sheet)
Expand All @@ -44,6 +48,9 @@ class BarcodeLabelsControllerTest < ActionController::TestCase
end

test 'should handle connection refused error' do
Sequencescape::Api::V2::BarcodePrinter.expects(:where).returns([Sequencescape::Api::V2::BarcodePrinter.new(
print_service: 'PMB', name: 'Test Printer', barcode_type: 'something'
)])
mock_barcode_sheet = mock('printer')
mock_barcode_sheet.expects(:print!).raises(Errno::ECONNREFUSED)
BarcodeSheet.expects(:new).returns(mock_barcode_sheet)
Expand Down
23 changes: 11 additions & 12 deletions test/controllers/stamps_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class StampsControllerTest < ActionController::TestCase

@robot.expects(:valid?)
.with('58000000180', @lot,
'58000000281' => @plate_a,
'58000000382' => @plate_b)
{ '58000000281' => @plate_a,
'58000000382' => @plate_b })
.returns([true, 'Okay'])
@request.headers['Accept'] = 'application/json'
post :validation, params: {
Expand Down Expand Up @@ -147,8 +147,8 @@ class StampsControllerTest < ActionController::TestCase

@robot.expects(:valid?)
.with('58000000180', @lot,
'58000000281' => @plate_a,
'58000000382' => @plate_c)
{ '58000000281' => @plate_a,
'58000000382' => @plate_c })
.returns([false, 'Not okay'])

@request.headers['Accept'] = 'application/json'
Expand Down Expand Up @@ -242,13 +242,12 @@ class StampsControllerTest < ActionController::TestCase

@robot.expects(:valid?)
.with('58000000180', @lot,
'58000000281' => @plate_a,
'58000000382' => @plate_b)
{ '58000000281' => @plate_a, '58000000382' => @plate_b })
.returns([true, 'Okay'])

@robot.expects(:beds_for).with(
'58000000281' => @plate_a,
'58000000382' => @plate_b
{ '58000000281' => @plate_a,
'58000000382' => @plate_b }
)
.returns([
{ bed: '2', order: 1, qcable: '11111111-2222-3333-4444-100000000001' },
Expand Down Expand Up @@ -303,13 +302,13 @@ class StampsControllerTest < ActionController::TestCase

@robot.expects(:valid?)
.with('58000000180', @lot,
'58000000281' => @plate_a,
'58000000382' => @plate_b)
{ '58000000281' => @plate_a,
'58000000382' => @plate_b })
.returns([true, 'Okay'])

@robot.expects(:beds_for).with(
'58000000281' => @plate_a,
'58000000382' => @plate_b
{ '58000000281' => @plate_a,
'58000000382' => @plate_b }
)
.returns([
{ bed: '2', order: 1, qcable: '11111111-2222-3333-4444-100000000001' },
Expand Down
23 changes: 12 additions & 11 deletions test/models/barcode_sheet_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ class BarcodeSheetTest < ActiveSupport::TestCase

test '#initialise' do
received_labels = [BarcodeSheet::Label.new(barcode: 'DN1S', prefix: 'DN', number: '1', lot: 'lot_number', template: 'tag_set')]
printer = api.barcode_printer.find('baac0dea-0000-0000-0000-000000000000')
printer.stubs(:print_service).returns('PMB')
printer = Sequencescape::Api::V2::BarcodePrinter.new(
print_service: 'PMB', name: @printer_name, barcode_type: '96 Well Plate'
)

barcode_sheet = BarcodeSheet.new(printer, received_labels)
assert_equal barcode_sheet.printer.name, @printer_name
Expand All @@ -44,9 +45,9 @@ class BarcodeSheetTest < ActiveSupport::TestCase
barcode: 'DN1S'
}]

printer = api.barcode_printer.find('baac0dea-0000-0000-0000-000000000000')

printer.stubs(:print_service).returns('PMB')
printer = Sequencescape::Api::V2::BarcodePrinter.new(
print_service: 'PMB', name: @printer_name, barcode_type: '96 Well Plate'
)

PMB::TestSuiteStubs.get(@label_template_url) do |_env|
[
Expand Down Expand Up @@ -74,9 +75,9 @@ class BarcodeSheetTest < ActiveSupport::TestCase
Timecop.freeze(Date.parse('02-02-2019')) do
received_labels = [BarcodeSheet::Label.new(barcode: 'DN1S', prefix: 'DN', number: '1', lot: 'lot_number', template: 'tag_set')]

printer = api.barcode_printer.find('baac0dea-0000-0000-0000-000000000000')

printer.stubs(:print_service).returns('SPrint')
printer = Sequencescape::Api::V2::BarcodePrinter.new(
print_service: 'SPrint', name: @printer_name, barcode_type: '96 Well Plate'
)

response = mock('response')
response.stubs(:code).returns('200')
Expand All @@ -91,9 +92,9 @@ class BarcodeSheetTest < ActiveSupport::TestCase
Timecop.freeze(Date.parse('02-02-2019')) do
received_labels = [BarcodeSheet::Label.new(barcode: 'DN1S', prefix: 'DN', number: '1', lot: 'lot_number', template: 'tag_set')]

printer = api.barcode_printer.find('baac0dea-0000-0000-0000-000000000000')

printer.stubs(:print_service).returns('SPrint')
printer = Sequencescape::Api::V2::BarcodePrinter.new(
print_service: 'SPrint', name: @printer_name, barcode_type: '96 Well Plate'
)

response = mock('response')
response.stubs(:code).returns('422')
Expand Down
Loading