-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add event and device tracking to answers (M2-8482) #1754
Add event and device tracking to answers (M2-8482) #1754
Conversation
@egodoy-metalab @Phillipe-Bojorquez This PR adds new fields to /answers endpoint, we may need to update tests |
➡️ Preview environment failed to be destroyed |
❌ E2E tests failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work getting this out so quickly @rcmerlo. Unfortunately I forgot to call attention to the format of the event_history_id
, so we'll need a few changes
...ture/database/migrations/versions/2025_02_24_16_10-add_event_history_id_and_device_id_to_.py
Outdated
Show resolved
Hide resolved
...ase/migrations_arbitrary/versions/2025_02_24_16_10-add_event_history_id_and_device_id_to_.py
Outdated
Show resolved
Hide resolved
2473108
to
a1f763f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my previous comments @rcmerlo. I think we're very close, just a few other things I noticed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are passing with the web app PR, nice work! Just one last request.
82736c6
to
81d2964
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, pending @sultanofcardio's last change request.
d97b6ed
to
e62a913
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work
- Introduced `event_history_id` and `device_id` fields in the answer schema. - Updated services to handle new fields, including validation for event existence. - Added tests for creating answers with these new fields. - Implemented database migrations to support the new columns.
- Bumped version of `boto3` to 1.37.* - Updated `nh3` to use a wildcard version - Upgraded `ddtrace` to 2.21.* - Added new package `izulu` with version 0.5.4
- Added `device_id` as a header parameter in the API. - Integrated `UserDeviceService` to validate `device_id`. - Updated answer creation logic to include `device_id`. - Removed `device_id` from the domain model. - Enhanced tests for device ID scenarios, including invalid cases. - Fixed a bug in schedule history retrieval by correcting variable name. Enhance device and event validation logic - Updated device retrieval to check both device_id and user_id. - Enhanced event history lookup with activity or flow ID validation. - Modified test data for consistency with new logic. - Added SQLAlchemy case statement for conditional queries. Refactor device and event history checks - Updated `aio-pika` to version 9.5.5 in dependencies. - Simplified device validation by removing user ID check from the query. - Streamlined event history validation logic, removing complex query conditions. - Removed unused imports and redundant methods for cleaner codebase. - Adjusted database migration down_revision for consistency.
- Replaced `UserDeviceService` with `UserDeviceEventsHistoryCRUD` for device validation. - Added a new method `get_device` in `UserDeviceEventsHistoryCRUD`. - Updated logic to validate devices based on event history. - Modified test cases to align with the new device validation approach. - Removed unused imports and code related to the old device service.
- Added a new migration script to merge two branches. - Defined revision identifiers for Alembic. - Included empty upgrade and downgrade functions.
e62a913
to
f5b47b6
Compare
📝 Description
event_history_id
anddevice_id
fields in the answer schema.🔗 Jira Ticket M2-8482