feat: add nova_audit_pgo adapter + dependency model docs - #5
Merged
Conversation
Ships nova_audit_pgo as a third sibling OTP app, parallel to nova_audit_kura. Uses pgo:query/3 directly; soft-dep pattern via erlang:function_exported/3 means consumers who don't use this adapter don't pull pgo as a transitive dependency. Shared schema and hardening SQL: nova_audit_pgo:schema_sql/0 delegates to nova_audit_kura:schema_sql/0 to keep one source of truth. Expanded guides/adapters.md with: - A dependency model table making clear what consumers actually need when they take a dep on nova_audit (only jhn_stdlib transitively; Kura/pgo only required if you USE that adapter). - A complete "writing your own adapter" walkthrough including the worker spawn + registry registration sequence. - The soft-dep pattern documented so third-party adapters can follow the same approach.
ℹ️ 15 OTP CVEs auto-ignored (already fixed in running version)These CVEs are patched in the installed OTP version but NVD data
|
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.
Summary
nova_audit_pgo— a third sibling OTP app that writes audit events directly viapgo, for consumers who don't want Kura as a transitive dep.nova_audit.Why
Question from a consumer: "If I take nova_audit, do I have to pull every adapter's underlying library?" Answer: no — adapters use the soft-dep pattern (
erlang:function_exported/3runtime checks). But the docs didn't make that clear. This PR fixes both: ships pgo as a turnkey alternative AND documents the pattern.Dependency model
nova_auditonlyjhn_stdlib. Adapters compile but onlynova_audit_logworks.nova_audit+ usenova_audit_kurakurato your deps.nova_audit+ usenova_audit_pgopgoto your deps.nova_audit+ custom adapterAdapter
pgo:query/3for both write and query paths.nova_audit_pgo:schema_sql/0delegates tonova_audit_kura:schema_sql/0for one source of truth.query/3(cursor = lastoccurred_at).pgo_not_loadederror ifpgois not in the consumer's deps.Tests
nova_audit_pgo_SUITE— 5 tests: registry registration, schema_sql, hardening_sql, write/query returningpgo_not_loadedwhen pgo isn't there.Docs
guides/adapters.mdexpanded with the dependency table, the pgo adapter section, and a complete "writing your own adapter" walkthrough including the worker + registry sequence.Test plan
rebar3 compilecleanrebar3 ct— 16/16 pass (was 11; +5 from pgo suite)rebar3 xrefcleanrebar3 dialyzercleanrebar3 hankcleanrebar3 fmt --checkclean