Skip to content

refactor(device): preparations for merge_device_status#1128

Merged
Annopaolo merged 2 commits intoastarte-platform:release-1.2from
noaccOS:refactor/preparation-for-merge_device_status
Mar 11, 2025
Merged

refactor(device): preparations for merge_device_status#1128
Annopaolo merged 2 commits intoastarte-platform:release-1.2from
noaccOS:refactor/preparation-for-merge_device_status

Conversation

@noaccOS
Copy link
Copy Markdown
Collaborator

@noaccOS noaccOS commented Mar 7, 2025

Preparation commits for #1057.

  • add a function to device queries to return the device to then build the status. This is needed to be able to build the device_status struct in a second moment.
  • Have DeviceStatus.from_db_row trim the timestamps to millisecond precision, like the version in the Queries module. This also restores a test from before the refactors done lately.

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?
  • Yes
  • No

Additional documentation e.g. usage docs, diagrams, etc.:


noaccOS added 2 commits March 7, 2025 14:43
split the retrieve_device_status functions into two, so that it can
also return the device itself, which can be later used to generate
the status

Signed-off-by: Francesco Noacco <francesco.noacco@secomind.com>
the changes in b27c5a4 made some calls
return the device status where the timestmaps have nanosecond precision.

this commit restores the behvavior before this commit, truncating
the timestamps to millisecond

Signed-off-by: Francesco Noacco <francesco.noacco@secomind.com>
@noaccOS noaccOS changed the title refactor(device): add query to retrieve the device itself refactor(device): preparations for merge_device_status Mar 7, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.76%. Comparing base (57d2b5b) to head (032dd31).
Report is 5 commits behind head on release-1.2.

Additional details and impacted files
@@               Coverage Diff               @@
##           release-1.2    #1128      +/-   ##
===============================================
- Coverage        68.76%   68.76%   -0.01%     
===============================================
  Files              327      327              
  Lines             7504     7513       +9     
===============================================
+ Hits              5160     5166       +6     
- Misses            2344     2347       +3     

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

@Annopaolo Annopaolo merged commit ef92d76 into astarte-platform:release-1.2 Mar 11, 2025
55 of 56 checks passed
@noaccOS noaccOS deleted the refactor/preparation-for-merge_device_status branch March 11, 2025 10:53
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.

3 participants