Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Create finished audit log for privacy requests #1040

Merged
merged 13 commits into from
Aug 9, 2022

Conversation

TheAndrewJackson
Copy link
Contributor

@TheAndrewJackson TheAndrewJackson commented Aug 5, 2022

Purpose

Add AuditLog for finished requests so users can easily see when they're done.

Changes

  • Update fideslib and fix small issue with with a case change. ENCODING -> encoding
  • New migration adding another enum option to support the updated AuditLogAction
  • Create AuditLog when a subject request finishes

Checklist

  • Update CHANGELOG.md file
    • Merge in main so the most recent CHANGELOG.md file is being appended to
    • Add description within the Unreleased section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.
    • Add a link to this PR at the end of the description with the PR number as the text. example: #1
  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #1022

@TheAndrewJackson TheAndrewJackson changed the title 1022 create finished audit log for privacy requests Create finished audit log for privacy requests Aug 8, 2022
@TheAndrewJackson TheAndrewJackson marked this pull request as ready for review August 8, 2022 13:27
@seanpreston seanpreston self-assigned this Aug 8, 2022
@TheAndrewJackson TheAndrewJackson added the run unsafe ci checks Triggers running of unsafe CI checks label Aug 8, 2022
@TheAndrewJackson TheAndrewJackson added run unsafe ci checks Triggers running of unsafe CI checks and removed run unsafe ci checks Triggers running of unsafe CI checks labels Aug 8, 2022
@TheAndrewJackson TheAndrewJackson added run unsafe ci checks Triggers running of unsafe CI checks and removed run unsafe ci checks Triggers running of unsafe CI checks labels Aug 8, 2022
@TheAndrewJackson TheAndrewJackson added run unsafe ci checks Triggers running of unsafe CI checks and removed run unsafe ci checks Triggers running of unsafe CI checks labels Aug 8, 2022
@TheAndrewJackson TheAndrewJackson added run unsafe ci checks Triggers running of unsafe CI checks and removed run unsafe ci checks Triggers running of unsafe CI checks labels Aug 8, 2022
@TheAndrewJackson TheAndrewJackson added run unsafe ci checks Triggers running of unsafe CI checks and removed run unsafe ci checks Triggers running of unsafe CI checks labels Aug 8, 2022
@sanders41 sanders41 mentioned this pull request Aug 8, 2022
10 tasks
"action": AuditLogAction.finished,
"message": "",
},
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Something that would be nice here is to wrap this new AuditLog creation into a transaction with privacy_request.save(...) — if one of these operations fails without the other we'd end up with an incomplete state, so it's better to commit them both at once.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good find. That is a potential issue when approved/denied are created as well. All of the audit logs should probably be updated at the same time when this is done.

Would you like this to be addressed in this PR or a follow up?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's do it as a follow-up

@seanpreston seanpreston merged commit 0871f69 into main Aug 9, 2022
@seanpreston seanpreston deleted the 1022_create_finished_audit_log_for_privacy_requests branch August 9, 2022 16:06
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
* Add finished AuditLog

* Bump fideslib

* Update test

* Fix format lints

* Lowercase encoding

* Update changelog

* Fix issue with migration downgrade

* Sort lists in test data tests

* format file
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
run unsafe ci checks Triggers running of unsafe CI checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create AuditLog event when requests finish processing
2 participants