Skip to content

Comments

Audit Log Event refactor#2788

Draft
cikzh wants to merge 6 commits intomainfrom
audit-log-refactor-2
Draft

Audit Log Event refactor#2788
cikzh wants to merge 6 commits intomainfrom
audit-log-refactor-2

Conversation

@cikzh
Copy link
Contributor

@cikzh cikzh commented Jan 27, 2026

Refactors the Audit Events

  • AuditEvent enum is renamed to AuditEventType and is now a flat enum
  • AsAuditEvent trait added, so we can move implementation details away from audit_log module
  • existing event_name database column is used for saving and returning the AuditEventType to the frontend. A rename of the column might be appropriate

@cikzh cikzh mentioned this pull request Jan 27, 2026
@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Sigrid maintainability feedback

⚠️ Your code did not improve towards your objective of 3.5 stars.

Show details

Sigrid compared your code against the baseline of 2026-02-10.

👍 What went well?

You fixed or improved 61 refactoring candidates.

Risk System property Location
🔴 Duplication
(Fixed)
backend/src/api/investigation.rs line 466-473
backend/src/api/data_entry.rs line 453-460
backend/src/api/data_entry.rs line 629-636
🔴 Duplication
(Fixed)
backend/src/repository/user_repo.rs line 260-273
backend/src/repository/user_repo.rs line 288-301
🔴 Duplication
(Fixed)
backend/src/api/polling_station.rs line 339-347
backend/src/api/polling_station.rs line 418-426
🔴 Duplication
(Fixed)
backend/src/api/data_entry.rs line 777-787
backend/src/api/data_entry.rs line 896-906
🔴 Duplication
(Fixed)
backend/src/api/data_entry.rs line 424-430
backend/src/api/data_entry.rs line 304-310
backend/src/api/data_entry.rs line 575-581
+ 1 occurrences
🔴 Duplication
(Fixed)
backend/src/api/user.rs line 192-204
backend/src/api/user.rs line 252-264
🔴 Duplication
(Fixed)
backend/src/api/investigation.rs line 94-105
backend/src/api/investigation.rs line 293-304
🔴 Duplication
(Fixed)
backend/src/api/polling_station.rs line 291-297
backend/src/api/investigation.rs line 358-364
backend/src/api/investigation.rs line 426-432
⚫️ + 53 more

👎 What could be better?

Unfortunately, 63 refactoring candidates were introduced or got worse.

Risk System property Location
🔴 Duplication
(Introduced)
backend/src/domain/file.rs line 34-64
backend/src/files/mod.rs line 17-47
🔴 Duplication
(Introduced)
backend/src/api/polling_station.rs line 191-208
backend/src/api/investigation.rs line 210-227
🔴 Duplication
(Introduced)
backend/src/repository/user_repo.rs line 248-261
backend/src/repository/user_repo.rs line 276-289
🔴 Duplication
(Introduced)
backend/src/api/report.rs line 488-504
backend/src/api/document.rs line 39-55
backend/src/api/document.rs line 118-134
🔴 Duplication
(Introduced)
backend/src/api/document.rs line 198-214
backend/src/api/report.rs line 559-575
🔴 Duplication
(Introduced)
backend/src/api/report.rs line 559-574
backend/src/api/document.rs line 198-213
backend/src/api/investigation.rs line 484-499
🔴 Duplication
(Introduced)
backend/src/domain/file.rs line 58-70
backend/src/api/report.rs line 380-392
🔴 Duplication
(Introduced)
backend/src/api/data_entry.rs line 415-426
backend/src/api/data_entry.rs line 544-555
⚫️ + 55 more

📚 Remaining technical debt

113 refactoring candidates didn't get better or worse, but are still present in the code you touched.

View this system in Sigrid to explore your technical debt

⭐️ Sigrid ratings

System property System on 2026-02-10 Before changes New/changed code
Volume 3.4 N/A N/A
Duplication 3.7 3.0 2.9
Unit Size 2.2 2.0 2.0
Unit Complexity 3.2 4.2 4.2
Unit Interfacing 2.9 0.7 0.5
Module Coupling 3.4 3.2 3.3
Component Independence 5.5 N/A N/A
Component Entanglement N/A N/A N/A
Maintainability 3.5 3.0 2.9

💬 Did you find this feedback helpful?

We would like to know your thoughts to make Sigrid better.
Your username will remain confidential throughout the process.


View this system in Sigrid

@cikzh cikzh force-pushed the audit-log-refactor-2 branch from b74e26a to b0bd219 Compare February 2, 2026 15:07
@cikzh cikzh force-pushed the audit-log-refactor-2 branch from d622e83 to 05053e0 Compare February 9, 2026 09:57
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 71.35678% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.41%. Comparing base (df673ad) to head (e9b9ad9).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
backend/src/domain/file.rs 0.00% 26 Missing ⚠️
backend/src/api/middleware/airgap/detect.rs 13.33% 8 Missing and 5 partials ⚠️
backend/src/infra/audit_log/audit_event.rs 89.47% 6 Missing ⚠️
backend/src/app_error.rs 0.00% 4 Missing ⚠️
backend/src/infra/audit_log/error_logging.rs 62.50% 2 Missing and 1 partial ⚠️
backend/src/lib.rs 0.00% 3 Missing ⚠️
backend/src/api/data_entry.rs 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2788      +/-   ##
==========================================
+ Coverage   91.35%   91.41%   +0.05%     
==========================================
  Files         380      389       +9     
  Lines       17661    18733    +1072     
  Branches     1987     2051      +64     
==========================================
+ Hits        16134    17124     +990     
- Misses       1428     1506      +78     
- Partials       99      103       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cikzh cikzh force-pushed the audit-log-refactor-2 branch from 319a0a1 to b06a316 Compare February 10, 2026 14:35
@cikzh cikzh force-pushed the audit-log-refactor-2 branch from b06a316 to 0039335 Compare February 10, 2026 16:42
@cikzh cikzh force-pushed the audit-log-refactor-2 branch from 0039335 to e9b9ad9 Compare February 10, 2026 16:46
@github-actions
Copy link

PDF Diff Summary

Comparing against base branch: main

File Status
model-n-10-2.pdf ✅ No changes
model-na-14-2-bijlage1.pdf ✅ No changes
model-na-14-2.pdf ✅ No changes
model-na-31-2-bijlage1.pdf ✅ No changes
model-na-31-2-inlegvel.pdf ✅ No changes
model-na-31-2.pdf ✅ No changes
model-p-2a.pdf ✅ No changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant