Skip to content

fix(spp_audit): mark server-internal audit methods as private - #605

Open
gonzalesedwin1123 wants to merge 2 commits into
19.0from
fix-audit-private-methods
Open

gonzalesedwin1123 wants to merge 2 commits into
19.0from
fix-audit-private-methods

Conversation

@gonzalesedwin1123

@gonzalesedwin1123 gonzalesedwin1123 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Mark the audit backend methods (write_entry, is_enabled) and the audit rule's logging entry points (log, log_lifecycle_action, get_audit_rules) @api.private. They are called only from server-side code (AuditBackendRegistry.dispatch, the audit decorator, and the lifecycle callers in spp_studio and spp_claim_169).
  • Add spp_audit/tests/test_rpc_exposure.py.
  • Bump spp_audit to 19.0.2.0.3 with a HISTORY entry. No schema or data change, so no migration.

Server-side callers are unaffected. create_rules, used by XML <function> data in several modules, is unchanged.

Test plan

  • ./spp t spp_audit: 0 failed, 0 errors of 49 tests (42 existing + 7 new)
  • pre-commit on the changed files
  • README.rst / static/description/index.html regenerated from CI's output

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.
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.34%. Comparing base (a71e8f0) to head (b5e5d5a).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             19.0     #605      +/-   ##
==========================================
+ Coverage   77.17%   77.34%   +0.17%     
==========================================
  Files         727      751      +24     
  Lines       47006    48899    +1893     
==========================================
+ Hits        36276    37822    +1546     
- Misses      10730    11077     +347     
Flag Coverage Δ
spp_audit 74.10% <100.00%> (?)
spp_base_common 91.07% <ø> (ø)
spp_cel_event 85.34% <ø> (?)
spp_claim_169 58.18% <ø> (ø)
spp_dci_demo 94.28% <ø> (ø)
spp_dci_indicators 96.23% <ø> (?)
spp_drims 85.49% <ø> (ø)
spp_drims_sl_demo 68.47% <ø> (ø)
spp_farmer_registry 88.46% <ø> (ø)
spp_farmer_registry_cr 61.24% <ø> (ø)
spp_farmer_registry_demo 63.32% <ø> (-0.07%) ⬇️
spp_mis_demo_v2 70.41% <ø> (ø)
spp_programs 67.58% <ø> (ø)
spp_registry 89.00% <ø> (ø)
spp_security 69.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
spp_audit/models/spp_audit_backend.py 69.50% <100.00%> (ø)
spp_audit/models/spp_audit_rule.py 79.13% <100.00%> (ø)

... and 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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