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

feat(flags): Store options changes in the audit log #78622

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

cmanallen
Copy link
Member

@cmanallen cmanallen commented Oct 4, 2024

When an option is added, updated, or removed record that action in the audit log.

@cmanallen cmanallen requested a review from a team as a code owner October 4, 2024 17:10
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 4, 2024
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/flags/providers.py 93.10% 2 Missing ⚠️
src/sentry/flags/endpoints/hooks.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #78622       +/-   ##
===========================================
+ Coverage   52.06%   78.15%   +26.08%     
===========================================
  Files        7073     7093       +20     
  Lines      311488   312433      +945     
  Branches    50885    51036      +151     
===========================================
+ Hits       162182   244177    +81995     
+ Misses     147776    61883    -85893     
- Partials     1530     6373     +4843     

((flag, "created", {"value": v}) for flag, v in self.set_options),
((flag, "deleted", {}) for flag in self.unset_options),
((flag, "updated", {"value": v}) for flag, _, v in self.updated_options),
((flag, "updated", {}) for flag, _ in self.drifted_options),
Copy link
Member

Choose a reason for hiding this comment

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

what does a drifted option mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

Internal lingo. Basically the value was updated but the existing value in the db was unexpected.

Copy link
Member

Choose a reason for hiding this comment

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

we don't care about the new updated value in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

We still do. The value is changed in the db. Its just that the old value was not what we expected (someone manually changed it).

Copy link
Member Author

@cmanallen cmanallen Oct 4, 2024

Choose a reason for hiding this comment

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

Oh I see the tags. The drifted options don't contain the new value (just the old...) which is why it was omitted. This is a legacy event any way. I could probably remove it.

@michellewzhang michellewzhang requested a review from a team October 4, 2024 19:40
@michellewzhang michellewzhang requested a review from a team October 4, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants