Ensure audits for user add-on assignments on association deletion
What does this MR do and why?
Ensure audits for user add-on assignments on association deletion. As PaperTrail creates only audits, when user add-on assignments are deleted directly, we need to adapt the audit creation process for deletion via associations (user, add-on purchases, etc.)
From now on we audit every destroy of user add-on assignments. We still don't track, when an engineer is using delete or delete_all on user add-on assignments.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- Resolves #514313 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Create a group
- Go to Settings -> Billing
- Apply for an Ultimate + Duo Enterprise Trial
- Assign a Duo Enterprise seat to the owner of the group
- Check on the Rails console that there is a new
GitlabSubscriptions::UserAddOnAssignmentVersionfor the eventcreate - Delete the group
- Check on the Rails console that there is a new
GitlabSubscriptions::UserAddOnAssignmentVersionfor the eventdestroy