pyro-api icon indicating copy to clipboard operation
pyro-api copied to clipboard

feat: fields and methods to set event type (wildfire or something else)

Open blenzi opened this issue 2 years ago • 2 comments

This PR adds the possibility to set an event type, different than wildfire. This event assessment is currently done via pyro-platform but this information is only stored locally (in the machine running it).

  • add options to EventType enum: domestic fire, chimney, cloud, other, undefined (default)
  • add type_set_by and type_set_ts to events table
  • add PUT /events/{event_id}/type endpoint and set_event_type method to client

blenzi avatar Oct 09 '23 21:10 blenzi

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.43%. Comparing base (5f735c3) to head (3abe13c). Report is 57 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
+ Coverage   95.35%   95.43%   +0.07%     
==========================================
  Files          66       66              
  Lines        1571     1598      +27     
==========================================
+ Hits         1498     1525      +27     
  Misses         73       73              
Flag Coverage Δ
client 100.00% <100.00%> (ø)
unittests 95.20% <100.00%> (+0.08%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 09 '23 21:10 codecov[bot]

Thanks for the PR! I'm aligned with everything apart from the "set_by" and "set_ts". I think we're mixing the role of APM (being able to access logs / interactions) vs. what needs to be recorded in the DB. My suggestion:

  • simply removing the set columns
  • I can come up with a PR to add a cool APM I've been using (posthog) where we can explore events like those

Here is a screenshot once it's set: image

frgfm avatar Oct 18 '23 21:10 frgfm

Closing as this was for the legacy data model, feel free to reopen if I missed something!

frgfm avatar Jan 09 '25 12:01 frgfm