Skip to content

Y26 031 labware location report by retention instructions#5637

Open
wendyyang wants to merge 30 commits intodevelopfrom
Y26-031---labware-location-report-by-retention-instructions
Open

Y26 031 labware location report by retention instructions#5637
wendyyang wants to merge 30 commits intodevelopfrom
Y26-031---labware-location-report-by-retention-instructions

Conversation

@wendyyang
Copy link
Copy Markdown
Contributor

@wendyyang wendyyang commented Mar 23, 2026

Closes #

Changes proposed in this pull request

add retention instruction column in location report table
add filter by retention instruction on the return record

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

@wendyyang wendyyang linked an issue Mar 23, 2026 that may be closed by this pull request
3 tasks
@wendyyang wendyyang marked this pull request as ready for review March 27, 2026 09:08
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.30%. Comparing base (b24be70) to head (4d1e8fb).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5637      +/-   ##
===========================================
- Coverage    87.34%   87.30%   -0.04%     
===========================================
  Files         1477     1477              
  Lines        33526    33532       +6     
  Branches      3550     3552       +2     
===========================================
- Hits         29284    29276       -8     
- Misses        4221     4235      +14     
  Partials        21       21              
Flag Coverage Δ
javascript 50.00% <ø> (ø)
ruby 87.32% <100.00%> (-0.04%) ⬇️

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds retention-instruction support to Location Reports so users can filter returned labware by retention instruction, while persisting the selected instructions on the report record.

Changes:

  • Add retention_instructions (serialized array) to LocationReport and persist it via a new DB column.
  • Extend the selection form + controller strong params to allow multi-select retention instructions.
  • Filter selected labware by retention instruction and add an RSpec scenario for it.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
spec/models/location_report_spec.rb Adds coverage for filtering by retention instruction.
db/schema.rb Updates schema with the new location_reports.retention_instructions column.
db/migrate/20260325134057_add_retention_instructions_to_lcation_reports.rb Introduces the migration adding the new column.
app/views/location_reports/_location_labware_selection_form.html.erb Adds a multi-select retention instruction filter UI.
app/models/location_report/location_report_form.rb Passes retention_instructions from the form into the model.
app/models/location_report.rb Serializes retention_instructions and filters labware results accordingly.
app/controllers/location_reports_controller.rb Permits retention_instructions as an array param.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/models/location_report.rb Outdated
Comment thread db/migrate/20260325134057_add_retention_instructions_to_lcation_reports.rb Outdated
Comment thread app/controllers/location_reports_controller.rb Outdated
Comment thread app/models/location_report.rb Outdated
@wendyyang wendyyang requested a review from KatyTaylor March 27, 2026 14:00
Copy link
Copy Markdown
Contributor

@BenTopping BenTopping left a comment

Choose a reason for hiding this comment

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

Couple questions about whether we need to support multiple retention_instructions.

N.B. Haven't tested locally.

Comment thread app/models/location_report.rb Outdated
Comment thread db/migrate/20260325134057_add_retention_instructions_to_location_reports.rb Outdated
Comment thread spec/models/location_report_spec.rb
Copy link
Copy Markdown
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.

Looks good in general, but a couple comments and questions.

In the specs, why has plate_1_custom_metadatum changed to plate_1_retention_instruction?

Comment thread app/controllers/location_reports_controller.rb
Comment thread spec/models/location_report_spec.rb
@wendyyang
Copy link
Copy Markdown
Contributor Author

Looks good in general, but a couple comments and questions.

In the specs, why has plate_1_custom_metadatum changed to plate_1_retention_instruction?

Because the retention instruction used to live in custom_metadata table, but now move to labware table. so the custom_metadata no longer needed.

@wendyyang wendyyang requested a review from StephenHulme May 7, 2026 20:54
@StephenHulme
Copy link
Copy Markdown
Contributor

Looks good in general, but a couple comments and questions.
In the specs, why has plate_1_custom_metadatum changed to plate_1_retention_instruction?

Because the retention instruction used to live in custom_metadata table, but now move to labware table. so the custom_metadata no longer needed.

Was the old column deleted? If so, how did this test pass before the change was made? Or was the column move made in an earlier PR and these tests were not updated?

@wendyyang
Copy link
Copy Markdown
Contributor Author

Looks good in general, but a couple comments and questions.
In the specs, why has plate_1_custom_metadatum changed to plate_1_retention_instruction?

Because the retention instruction used to live in custom_metadata table, but now move to labware table. so the custom_metadata no longer needed.

Was the old column deleted? If so, how did this test pass before the change was made? Or was the column move made in an earlier PR and these tests were not updated?

It wasn't a column, it is a table called 'custom_metadata' , the table has 'key' & 'value' column, so can store different type of data, the retention instruction was stored there using key 'retention_instruction'. Since the table 'custom_metadata' schema/columns not changed, so the test still works, just not returning any data, I think.

@StephenHulme
Copy link
Copy Markdown
Contributor

Ah that makes a lot more sense, thanks - I'd forgotton that that table used a key-value architecture.

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.

Y26-031 - Labware Location Report by Retention Instructions

4 participants