Repository navigation
fix(spp_audit): tighten audit context flags and audit nested writes - #611
Open
gonzalesedwin1123 wants to merge 6 commits into
Open
gonzalesedwin1123 wants to merge 6 commits into
gonzalesedwin1123 wants to merge 6 commits into
Conversation
The audit backend methods and the rule's logging entry points are called only from server-side code. Mark them @api.private and cover it with tests. Server-side callers are unaffected.
… code audit_disable and audit_in_progress are now matched by identity against marker objects defined in spp_audit, instead of by truthiness. Trusted flows pass spp_audit.tools.AUDIT_DISABLE; a plain value is ignored and the operation is audited.
The in-progress guard covered every model and record for the duration of the original write, so a nested write to another record was not audited. Track the records being audited on the cursor and skip a nested write for those records only.
Check the in-progress records are released when the write fails without relying on assertRaises, and that copying a context keeps the marker.
gonzalesedwin1123
changed the base branch from
fix-audit-private-methods
to
19.0
November 24, 2026 16:00
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 19.0 #611 +/- ##
==========================================
+ Coverage 77.17% 77.35% +0.17%
==========================================
Files 727 751 +24
Lines 47006 48916 +1910
==========================================
+ Hits 36276 37838 +1562
- Misses 10730 11078 +348
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
gonzalesedwin1123
marked this pull request as ready for review
November 24, 2026 16:27
gonzalesedwin1123
requested review from
jeremi and
kneckinator
and removed request for
kneckinator
November 24, 2026 16:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #605: until that merges, the first two commits shown here (
9e8d83cb,b5e5d5ad) belong to it. This PR is the three commits after them.Summary
audit_disableis honoured only when server-side code sets it to theAUDIT_DISABLEmarker exported fromspp_audit.tools:A plain value such as
Trueis ignored and the operation is audited.A write made inside an audited write is audited when it touches other records, for example a child record updated through its parent's one2many field. Only the records already being audited by the enclosing write are skipped, so the same change is not logged twice. The
audit_in_progresscontext key is no longer read; the records being audited are tracked on the cursor.spp_auditto19.0.2.0.4with a HISTORY entry. No schema or data change, so no migration.Behaviour changes to note
audit_disable=Trueare audited again until they pass the marker. Nothing in this repo sets the key; the bridge import that perf(spp_audit): audit_disable context bypass + skip snapshot reads when no rule matches #290 added it for needs the one-line change above.Test plan
./spp t spp_audit: 0 failed, 0 errors of 64 tests (49 on the base branch + 15 new)pre-commiton the changed filesREADME.rst/static/description/index.htmlregenerated from CI's output