Skip to content

feat(audit): record the branch name alongside the X-NetBox-Branch schema_id (#172) - #213

Merged
thomaschristory merged 1 commit into
mainfrom
feat/172-audit-branch-name
Oct 25, 2026
Merged

thomaschristory merged 1 commit into
mainfrom
feat/172-audit-branch-name

Conversation

@thomaschristory

Copy link
Copy Markdown
Owner

Summary

  • Branch resolvers can now return a ResolvedBranch(name, schema_id) (defined in nsc/http, so the client learns the human-readable name without importing nsc/branching).
  • Once a branch is resolved, every audit log entry carries a top-level branch key with the branch name next to the X-NetBox-Branch schema_id header. This also applies under audit_redaction: full.
  • Requests on main omit the key, so their audit lines look the same as before.
  • Docs: docs/guides/audit-log.md, docs/guides/branching.md. CHANGELOG entry under Unreleased.

Closes #172

Test plan

  • New tests in tests/http/test_audit.py, tests/http/test_client_branch.py and tests/cli/test_branch_commands.py (branch key present when branched, absent on main, kept under full redaction)
  • just test: 1664 passed, 1 skipped
  • just lint: ruff, ruff format and mypy --strict all clean

https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb

…ema_id (#172)

Branch resolvers may now return a ResolvedBranch(name, schema_id) defined in
nsc/http, so the client learns the human name without importing
nsc/branching. Once resolved, every audit entry carries a top-level `branch`
key (also under audit_redaction: full). Unbranched lines omit the key and
keep their previous shape.

Claude-Session: https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb
@thomaschristory
thomaschristory merged commit 13a7cf2 into main Oct 25, 2026
15 checks passed
@thomaschristory
thomaschristory deleted the feat/172-audit-branch-name branch October 25, 2026 10:45
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.

Audit log: record the branch name alongside the X-NetBox-Branch schema_id

1 participant