-
-
Notifications
You must be signed in to change notification settings - Fork 181
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(projectHistoryLogs): project history logs for bulk actions TASK-1229 #5270
base: main
Are you sure you want to change the base?
Conversation
…tory_logs_bulk_actions
…tory_logs_bulk_actions
…tory_logs_bulk_actions
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.
Two things:
- It was super not-obvious on the task (sorry) but we only need to worry about bulk archiving and non-archiving.
- Can we stick with the pattern of adding things to the request, then going through ProjectHistoryLog.create_from_request? It is easier to reason about if the code all generally flows through one place
@@ -1,7 +1,6 @@ | |||
# coding: utf-8 | |||
import time | |||
|
|||
import constance |
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.
why did this change?
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.
this was a complain from the linter :S ... probably from some merge, that is not related to this PR
kpi/serializers/v2/asset.py
Outdated
@@ -88,6 +89,11 @@ def __init__( | |||
super().__init__(instance=instance, data=data, **kwargs) | |||
|
|||
def create(self, validated_data): | |||
ProjectHistoryLog.create_from_bulk_action( |
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.
we shouldn't create the logs until after we've completed the actions. if something fails, we don't want a log saying it succeeded.
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.
If we put the logs creation in the middleware, it will run before the rest of the request processing. So I am wondering if we can detect if it's going to fail or maybe have a hook that runs after the successful response is created
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.
Nevermind, I'm checking the middleware code and it should run after the action was executed.
…s mechanisms, fix tests
🗒️ Checklist
<type>(<scope>)<!>: <title> TASK-1234
frontend
orbackend
unless it's global📖 Description
This PR adds support for bulk actions logging.
👀 Preview steps
💭 Notes