Skip to content

Add active boolean field to Pose model#564

Open
MateoLostanlen wants to merge 6 commits intomainfrom
active_poses
Open

Add active boolean field to Pose model#564
MateoLostanlen wants to merge 6 commits intomainfrom
active_poses

Conversation

@MateoLostanlen
Copy link
Copy Markdown
Member

Poses represent camera orientations that can change over time. Previously, all poses (including outdated ones)
were returned when fetching cameras, which cluttered the frontend with stale data. We still need to keep old
poses in the database for historical consistency (linked detections, sequences, etc.), so rather than deleting
them, we introduce an active boolean flag to soft-filter them.

  • Add active boolean field to the Pose model (defaults to True)
  • Camera endpoints (GET /cameras/{id} and GET /cameras/) now only return active poses
  • Alembic migration sets server_default=true so all existing poses remain active
  • Python client updated to support active in create_pose and update_pose

Camera endpoints now only return active poses when listing camera details.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.20%. Comparing base (b71cc17) to head (0e7fd36).

Files with missing lines Patch % Lines
client/pyroclient/client.py 85.71% 1 Missing ⚠️
src/app/api/api_v1/endpoints/detections.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #564      +/-   ##
==========================================
+ Coverage   88.07%   88.20%   +0.13%     
==========================================
  Files          51       51              
  Lines        2147     2154       +7     
==========================================
+ Hits         1891     1900       +9     
+ Misses        256      254       -2     
Flag Coverage Δ
backend 88.07% <85.71%> (-0.02%) ⬇️
client 90.40% <85.71%> (+2.59%) ⬆️

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.

…n inactive poses

- poses.py: list_current_poses now filters active=True (consistent with camera endpoints)
- detections.py: reject detection creation on inactive poses with 422
- client test: update expected ValueError message after update_pose signature change
- poses.py: filter active=True in list_current_poses (camera token path)
- detections.py: reject detection creation on inactive poses (422)
- client test: update expected ValueError message after signature change
- migration: guard add_column with table/column existence checks for fresh DB
@MateoLostanlen MateoLostanlen requested a review from fe51 April 14, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant