Suggestions activity log #366
No reviewers
Labels
No labels
automation
backend
bug
contributor experience
data
deployment
documentation
duplicate
good first issue
help wanted
nice to have
notifications
package maintainer
performance
skin
tech debt
user story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-community/nix-security-tracker#366
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/activity-log-suggestions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The activity log is implemented with the package 'django-pghistory', which uses PostgreSQL triggers.
.all().iterator()
should be preferred for iterationthe business logic of this should be moved to SQL I think, this may require a more complicated SQL query but it's fine
this is inefficient, you should have
get_suggestion_activity_logs(<list of object>)
and returns a map of{pk: logs}
and then interleave them there.For clarification, my guess is that you are referring to making it part of the ORM expression and not a RAW SQL call, right?
@RaitoBezarius I'm still massaging the data for the view. I'll take into account these query feedback on the last refactors before taking this PR out of draft.
Tested, looking good! 🎉
A few things currently on my mind:
TimeStampMixin
<summary>
TimeStampMixin
, but the needs to be overridden to keep only the state changes, because IIUC it's not doing anything right now for suggestionsHappy to be able to look at it now! I'd keep design feedback until it's marked as ready for review.
Just one hint: With https://github.com/Nix-Security-WG/nix-security-tracker/pull/374 a color palette was introduced, that could be used for the coloring of state change activities.
From https://github.com/Nix-Security-WG/nix-security-tracker/pull/366#issuecomment-2487949573
@fricklerhandwerk Is this the case? Because in that case I'd skip this optimization, since it's the current logic is already tailored to "gather the activity log of this suggestion".
Implemented in https://github.com/Nix-Security-WG/nix-security-tracker/pull/366/commits/f11423ac1ddcbd944cbe4f9bbc60b02714c6728b
Implemented in https://github.com/Nix-Security-WG/nix-security-tracker/pull/366/commits/323d3f3318e8dd33aebec67c89ec19ebdab1c4d6
I suppose this supersedes #126 and #101?
Last thing to fix is the merge conflict, other than that it seems to work in manual testing. 🚀
@fricklerhandwerk True, they should be closed and #126 can be used as reference whenever there's a decision to have an activity log for issues.