-
Notifications
You must be signed in to change notification settings - Fork 12
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 audit backend #1886
Add audit backend #1886
Conversation
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.
Some points where I'm looking for specific feedback in my "self-review". Otherwise:
- @mvandenburgh, I thought about cutting the
Asset.previous
field out in this PR, but that is technically out of scope now that I think about it. Once we capture a DB snapshot and put this into production, you can remove that field in your GC work. Does that sound right? - I'm deliberately deferring frontend support to a future PR. I am leaning towards creating a new branch named
audit
and basing this PR to that branch so that the frontend work can land there as well, enabling us to merge a feature complete branch into production when we're ready. Looking for feedback on this idea. - I'd also like to add tests, but not sure how. I'd love to work with someone (@jjnesbitt?) to figure that out. I read this article but did not fully grok it.
- I tested this PR manually by carrying out each significant action and then observing the creation of
AuditRecord
s in the admin console. Everything seems to work but of course I am not confident I tested every edge and corner case.
- I tested this PR manually by carrying out each significant action and then observing the creation of
- What to do about these lint errors? I think both represent essential complexity, so I just put an ignore on them. Thoughts?
-
dandiapi/api/services/asset/init.py:108:5: PLR0913 Too many arguments in function definition (6 > 5)
-
dandiapi/api/views/dandiset.py:375:9: C901
users
is too complex (11 > 10)
-
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.
A few suggestions but otherwise I like this implementation a lot! It seems fairly lightweight, and I like the specific attention to ensuring the audit records are created in the same transaction as the objects they are tracking.
I agree, I think removing the
I agree frontend should be a future PR. I don't have any strong feelings towards the feature branch idea. An alternative approach could be just merging both of them piecemeal into
I kind of agree with ruff that the The |
🚀 PR was released in |
29 similar comments
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
🚀 PR was released in |
This PR implements the backend portion of the audit design doc with the following changes:
AuditRecord
, that captures audit event information in a general, extensible wayAuditRecord
that construct several audit record typesThis PR should not be merged outside of the operations plan described in the design doc, so this will be a draft PR until we're ready to carry out that plan.
edit by @yarikoptic: Closes #61