-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
Audit logging #1328
Comments
I did some audit log work for the RubyGems.org admin site in rubygems/rubygems.org#3426, if that helps at all with inspiration! |
That's interesting work you're doing there with the Was it difficult to navigate the codebase and understand how actions work? |
Not too difficult, though I did spend a bunch of time reading through the code (instead of being able to use the docs 100%). Overall I'd say it was easy to figure out what I needed in order to do my hackery :) |
Yeah, we don't have a lot of internals documented. I'd like to do that after we have the API more stable. |
Thanks for sharing! |
Just to inform your thinking on this a little bit: We're using PaperTrail, and heavily customizing how the That said, anything you do here is in nice-to-have territory now that we've established a pattern of using a carefully tailored Resource, and a |
Hey @MrJoy thanks for sharing! We are exploring an adapter pattern that could work with both gems, PaperTrail and Audited. Would be the preferred path to follow but we can't promise anything until we have a working POC |
We have also been using PaperTrail but have been having trouble tracking records' Action Text rich text attributes on the one hand and plain text Mobility-translated attributes on the other hand, which are stored in their own tables using polymorphic associations (we have actually been serving both needs with this gem I built). PaperTrail indicates that it does not offer proper association tracking out of the box.
So I was going to try paper_trail-association_tracking but its own README recommends against its use, in favor of active_snapshot. PT-AT README:
ActiveSnapshot README:
So basically PaperTrail declares that it is missing a feature, redirects to using an alternative gem, which itself redirects to yet another one, which presents itself as a solution completely replacing PaperTrail. So what do you think of ActiveSnapshot? Might it offer a more durable solution when modifying attributes stored in associated tables? |
I did some tests of compatibility between 3 audit gems and translated and/or rich-text attributes. These are my current conclusions:
(1) These gems seem to only track changes to columns on the model's table. I also did not find an API to add attributes/associations to be tracked. For instance (2) Active Snapshot needs to be configured with a (3) Stores the changes with the name of the underlying (4) Using Mobility Action Text. |
Also see the new Hoardable gem that looks interesting but Postgresql-only (didn't try it).
It supports Action Text out of the box. It also explains how it compares with other gems. |
The way this feature is evolving (still experimental) is to adapt to the gem (audited or paper_trail and maybe others on the future) that parent app already uses or wants to use. We'll consider your research and feedback! Thanks for sharing it! We're also exploring the possibility to have a custom table where we store Avo related audits like actions (who run it, on what records, params, etc...) . |
Paper Trail seems to be the most popular so it makes sense for Avo to support it. At the same time, it would be great for Avo to support other more recent/modern solutions as they emerge. After some playing around, Hoardable and Active Snapshot look promising. Good luck! |
What a great article @rafafloresta! We will use a combination of those. We add |
Note
Enterprise feature - https://github.com/avo-hq/avo-audit_logging
Feature
Know who did what in Avo.
Approach
This feature should:
Related
Gems to test out:
Related
We could use the same thing in #1322
"We’ve seen some particularities that make Audited mostly used to “Active Record User Stamping”, (checking the actions taken by a particular user), while Paper Trail is referenced as being in the “Active Record Versioning Area” (getting a timeline of changes in a record due to the larger set of options that Paper Trail offers in terms of functions and methods)."
https://revs.runtime-revolution.com/the-battle-for-auditing-and-versioning-in-rails-audited-vs-paper-trail-17ad0011ecd9
The text was updated successfully, but these errors were encountered: