Skip to content
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

Allow updating Incident.metadata #807

Merged
merged 3 commits into from
May 7, 2024
Merged

Conversation

hmpf
Copy link
Contributor

@hmpf hmpf commented May 6, 2024

Possibly overengineered.

@hmpf hmpf requested a review from a team May 6, 2024 13:15
@hmpf hmpf added the API v2 Ideas for API v2, backwards incompatible OK label May 6, 2024
Copy link

github-actions bot commented May 6, 2024

Test results

       7 files     581 suites   21m 36s ⏱️
   463 tests    462 ✔️ 1 💤 0
3 241 runs  3 234 ✔️ 7 💤 0

Results for commit caca286.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@elfjes elfjes left a comment

Choose a reason for hiding this comment

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

We have no strong use case (yet) for tracking all changes to metadata for a given incident.

Having said that. I think it makes more sense if a change in metadata only results in a single ChangeEvent, one for all additions, removal and changes.

Also I expect quite some nesting in our metadata (at least more than just a flat dictionary) so most thing would fall under a metadata "change" even if we're mostly adding data (eg. to a nested array), which would warrant looking up changes recursively, but then you're even more over engineering :D

src/argus/incident/serializers.py Outdated Show resolved Hide resolved
src/argus/incident/serializers.py Outdated Show resolved Hide resolved
src/argus/incident/serializers.py Outdated Show resolved Hide resolved
@hmpf
Copy link
Contributor Author

hmpf commented May 7, 2024

Yeah I'll be treating metadata very hands off for now. I really want to add a OneToOne table depending on
Event that stores before and after (because more stuff to crunch statistics on is fun) but that can surely wait.

Noodling with metadata did allow my subconscious to come up with something uncomplicated for deletion of incidents though, as I hoped.

@hmpf
Copy link
Contributor Author

hmpf commented May 7, 2024

See also #808

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.48%. Comparing base (737371e) to head (c7eed5c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #807   +/-   ##
=======================================
  Coverage   84.48%   84.48%           
=======================================
  Files          76       76           
  Lines        3802     3803    +1     
=======================================
+ Hits         3212     3213    +1     
  Misses        590      590           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hmpf
Copy link
Contributor Author

hmpf commented May 7, 2024

I'll split this into two PR's, one for altering metadata and one for DRY-ing change events, but review this one as is anyway.

@hmpf hmpf marked this pull request as ready for review May 7, 2024 09:22
@hmpf hmpf requested review from elfjes and a team May 7, 2024 09:23
Copy link
Collaborator

@elfjes elfjes left a comment

Choose a reason for hiding this comment

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

LGTM

@hmpf hmpf force-pushed the update-metadata branch from 275ccc0 to c7eed5c Compare May 7, 2024 12:13
Copy link

sonarqubecloud bot commented May 7, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@hmpf hmpf merged commit 15e0325 into Uninett:master May 7, 2024
9 checks passed
@hmpf hmpf deleted the update-metadata branch May 7, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API v2 Ideas for API v2, backwards incompatible OK
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants