Skip to content

add labware updated_at value and return the latest one#5780

Open
wendyyang wants to merge 8 commits into
developfrom
Y26-149-labware_location_bug
Open

add labware updated_at value and return the latest one#5780
wendyyang wants to merge 8 commits into
developfrom
Y26-149-labware_location_bug

Conversation

@wendyyang
Copy link
Copy Markdown
Contributor

Closes #

Changes proposed in this pull request

add labware updated_at in API return and return the latest location

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
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.31%. Comparing base (a754e6f) to head (92ac84d).

Files with missing lines Patch % Lines
app/models/labware.rb 93.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5780      +/-   ##
===========================================
+ Coverage    84.06%   87.31%   +3.24%     
===========================================
  Files         1422     1479      +57     
  Lines        32730    33594     +864     
  Branches      3502     3557      +55     
===========================================
+ Hits         27513    29331    +1818     
+ Misses        5195     4242     -953     
+ Partials        22       21       -1     
Flag Coverage Δ
javascript 72.72% <ø> (ø)
ruby 87.32% <95.00%> (+3.25%) ⬆️

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

@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.

Some comments and suggestions : )

Comment thread app/models/labware.rb Outdated
Comment on lines +381 to +391
return 'Not found - There is a problem with Labwhere'
return { error: true }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we maybe return a message as well? I don't think true provides enough feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added error messages in return

Comment thread app/models/labware.rb
end

nil
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be possible to reduce the complexity of this function (possibly by pulling out some private methods)?

It's difficult to understand exactly what the new code does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

refactored.

Comment thread spec/lib/lab_where_client_spec.rb Outdated
labware = described_class.new(params)

expect(labware.updated_at).to eq('Wednesday May 6 2026 10:46')
expect(labware.location.updated_at).to eq('Tuesday June 6 2023 16:26')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This date format is nice for humans, but non-standard and difficult for computers to parse. May I suggest that the updated_at fields are always represented as ISO 8601 standard strings?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated.

Comment thread spec/models/location_report_spec.rb Outdated
Comment on lines +203 to +205
before do
allow(LabWhereClient::Labware).to receive(:find_by_barcode).and_return(nil)
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this mocking out the actual code we are testing? Or is it not important to this test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

re-write to include human barcode

@wendyyang wendyyang requested a review from StephenHulme May 15, 2026 12:07
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.

2 participants