Conversation
Test results 13 files 13 suites 24m 57s ⏱️ Results for commit fd79ad9. ♻️ This comment has been updated with latest results. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3776 +/- ##
==========================================
+ Coverage 63.83% 63.89% +0.06%
==========================================
Files 624 625 +1
Lines 46174 46260 +86
Branches 43 43
==========================================
+ Hits 29476 29559 +83
- Misses 16688 16691 +3
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
56f4174 to
0d458cb
Compare
d4445f6 to
3837d41
Compare
3837d41 to
878e419
Compare
878e419 to
35e0dc7
Compare
|
|
This potentially replaces #3705 |
Just to have some real-world data: I checked customer installs, and the biggest audit log table I could find was about ~64k rows. |
lunkwill42
left a comment
There was a problem hiding this comment.
Seems pretty good (apart from the obvious table bloat, but that's a tradeoff we'll have to live with).
The merge conflict / migration script names has to be fixed - I assume we can get this in 5.18 :-)
35e0dc7 to
867db61
Compare
Add actor_sortkey, object_sortkey, and target_sortkey columns to the auditlog_logentry table. These store the human-readable display name at write time, enabling efficient database-level sorting and searching, and preserving display names after referenced objects are deleted.
fd79ad9 to
04d1731
Compare
|



Scope and purpose
Resolves #3757
Adds sortable display name columns (
actor_sortkey,object_sortkey,target_sortkey) to auditlog entries. This enables sorting and searching on these columns, and allows showing entity links when the referenced objects still exist.Key decisions:
API v2 added: New
/api/2/auditlog/endpoint returnsactor,object, andtargetas objects with{name, url}for entity linking. The existing/api/1/auditlog/endpoint continues to return plain strings and remains unchanged. The web UI now uses v2.Migration note: The backfill operation may take some time on deployments with millions of log entries.
Testing backfill and entity links
Filter by
verb=edit-account-add-org,verb=disable-interface,verb=create-netbox,verb=delete-netbox, orverb=create-accountto observe:model_name (ID)format (e.g.,account (123)) since the object no longer exists, but the sortkey preserved the searchable textContributor Checklist
Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to NAV can be found in the
Hacker's guide to NAV.
<major>.<minor>.x). For a new feature or other additions, it should be based onmaster.