Skip to content
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

chore(audit-logs): migrate audit logs to v5 #20251

Open
wants to merge 12 commits into
base: v5/main
Choose a base branch
from

Conversation

markkaylor
Copy link
Contributor

@markkaylor markkaylor commented May 2, 2024

What does it do?

  • Migrate audit-logs to v5
  • Replaces auditLog contentType with a model

How to test it?

Test audit logs are created for the following events

  • Create entry
  • Update entry
  • Delete entry
  • Publish entry
  • Unpublish entry
  • Admin login
  • Create media
  • Update media
  • Delete media
  • Create media folder
  • Update media folder
  • Delete media folder
  • Create user
  • Update user
  • Delete user
  • Admin logout
  • Create content type
  • Update content type
  • Delete content type
  • Create component
  • Update component
  • Delete component
  • Create role
  • Update role
  • Delete role
  • Create permission
  • Update permission
  • Delete permission

@markkaylor markkaylor self-assigned this May 2, 2024
@markkaylor markkaylor added source: core:admin Source is core/admin package pr: chore This PR contains chore tasks (cleanups, configs, tooling...) labels May 2, 2024
@markkaylor markkaylor marked this pull request as ready for review May 2, 2024 15:18
Copy link

vercel bot commented May 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
contributor-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 4:02pm

required: true,
},
// @ts-expect-error database model is not yet updated to support useJoinTable
user: {
Copy link
Contributor

Choose a reason for hiding this comment

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

if this schema is different from v4, we need to create a migration to keep v4 data. I believe all audit-log data will be transfered except the users in this situation.

Comment on lines 99 to 100
const ignoredUids = ['plugin::upload.file', 'plugin::upload.folder'];
if (ignoredUids.includes(args[0]?.uid)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Feranchz do you have any idea what this about? As far as I can tell there isn't anything to ignore from the upload plugin 🤔.

@markkaylor
Copy link
Contributor Author

markkaylor commented May 13, 2024

Updates:

  • Separate the services in two (audit-logs and lifecycle)
  • Revert the model back to a contentType (waiting for a response from Alex to see if existing features should go ahead and migrate to models or not), for now I'd rather have the thing that can be merged in place. Otherwise we can swap back in the model and write the migration script.
  • Remove the provider
  • Add API tests

I think it's ready for another review / QA. You may need to drop your database now that the contentType is back and the model is gone.

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: chore This PR contains chore tasks (cleanups, configs, tooling...) source: core:admin Source is core/admin package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants