Skip to content

Y25-483 - Show Lot information using the v2 API#652

Open
borhara wants to merge 8 commits intodevelopfrom
y25-483-show-v2-lot-info
Open

Y25-483 - Show Lot information using the v2 API#652
borhara wants to merge 8 commits intodevelopfrom
y25-483-show-v2-lot-info

Conversation

@borhara
Copy link
Member

@borhara borhara commented Feb 20, 2026

Closes #563

Changes proposed in this pull request

  • Modified logic for finding lots to use the SS V2

Instructions for Reviewers

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 57.74648% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.68%. Comparing base (b024bb4) to head (007e05d).
⚠️ Report is 15 commits behind head on develop.

Files with missing lines Patch % Lines
app/models/presenter/lot.rb 23.52% 13 Missing ⚠️
app/models/presenter/qcable.rb 62.96% 10 Missing ⚠️
app/models/presenter/qc_asset.rb 66.66% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #652      +/-   ##
===========================================
- Coverage    80.31%   78.68%   -1.64%     
===========================================
  Files           74       75       +1     
  Lines         1128     1201      +73     
===========================================
+ Hits           906      945      +39     
- Misses         222      256      +34     
Flag Coverage Δ
pull_request 78.68% <57.74%> (-1.64%) ⬇️
push 78.72% <57.74%> (-1.60%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

# Provides a V1-compatible barcode interface wrapping the V2 labware_barcode hash.
# The V2 API returns labware_barcode as { 'human_barcode' => 'DN1S', ... } whereas
# the V1 API returned barcode as an object with .prefix and .number accessors.
# This method bridges the gap so that Presenter::Qcable (and Presenter::Lot#prefix)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its slightly more work but I think we can get rid of the prefix method and use human_readable for label printing. I came across this in another gatekeeper story and think that should fix #582 too. It means we wont need this barcode/prefix/number workaround.

StephenHulme
StephenHulme previously approved these changes Feb 23, 2026
Copy link
Contributor

@StephenHulme StephenHulme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change :)

Copy link
Contributor

@StephenHulme StephenHulme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrote the review, but forgot to submit it 🙈 - looks good but a couple questions.

Comment on lines +49 to +51
labware_prefix(qcable) ||
barcode_prefix(qcable) ||
''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: could this be on one line?

Comment on lines +138 to +141
lb = qcable.labware_barcode
return unless lb

(lb['human_barcode'] || lb[:human_barcode])&.to_s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: I see this is old code, but I think the intent could be better indicated using symbolize_keys?

Suggest something like:

lb = qcable.labware_barcode&.symbolize_keys
return unless lb

lb[:human_barcode].to_s


prefix = barcode['prefix'] || barcode[:prefix]
number = barcode['number'] || barcode[:number]
return unless prefix || number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: possibly use symbolize_keys here too

lb = @qcable.labware_barcode
return unless lb.is_a?(Hash)

(lb['human_barcode'] || lb[:human_barcode])&.to_s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: possibly use symbolize_keys here too

bc = @qcable.barcode

if bc.is_a?(Hash)
machine = bc['machine'] || bc[:machine]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: possibly use symbolize_keys here too

def barcode_prefix_number
return unless @qcable.respond_to?(:barcode)

bc = @qcable.barcode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: possibly use symbolize_keys here too

Comment on lines -137 to +177
assert_select '#pending_plate_7 > .plate_barcode', 'DN8'
assert_select '#pending_plate_7 > .plate_barcode', 'DN8C'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting change, what happened to the C?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Y25-483 - Show Lot information using the v2 API

3 participants