Skip to content

feat(cli): --journey flag for campus audit traces search - #64

Merged
ngjunsiang merged 1 commit into
mainfrom
feat/63-audit-traces-journey
Oct 20, 2026
Merged

ngjunsiang merged 1 commit into
mainfrom
feat/63-audit-traces-journey

Conversation

@ngjunsiang

Copy link
Copy Markdown
Contributor

Closes #63

Summary

Adds the server's login-journey filter to campus audit traces search
as --journey, closing the last documented gap from the campus audit
rollout (#54). PR #55 deliberately omitted it because
campus-api-python's Traces.search() did not carry journey_id; the
SDK now does (campus-api-python#110, merged via #111), matching the
server route /audit/v1/traces/search?journey_id=… (campus#803, via
campus#812 on weekly).

Changes

  • campus_cli/audit/traces.py traces_search:
    • new --journey option alongside --user/--client/--api-key-id
    • forwarded to api.traces.search(journey_id=journey)
    • journey_id included in the --dry-run kwargs (None values are
      already dropped by _query_operation, like the other filters)
    • the "not exposed here yet" docstring caveat is gone
  • poetry.lock: campus-api-python re-pinned 89df17e → dad0442
    (#111). Required, not cosmetic — the old pin rejects the kwarg.
    Targeted poetry update campus-api-python; campus-suite and all
    other pins untouched.

Tests

  • tests/unit/test_audit.py TestTracesSearchJourney: mocked-client
    passthrough — journey_id set when --journey is given, None
    when absent (all kwargs are always sent, matching the SDK's
    keyword-only signature).
  • tests/integration/test_dry_run.py: --journey snippet shows
    journey_id='…'; the plain search dry-run asserts journey_id
    stays absent when not given; added to the snippet compile-check
    cases.

Suite: 296 passed, ruff clean.

Related

PR #55 omitted the server's login-journey filter because
campus-api-python's Traces.search() did not carry it, leaving the
--dry-run snippets unable to mention journey_id honestly. The SDK
now ships the keyword-only journey_id filter (campus-api-python#110,
merged via #111), matching /audit/v1/traces/search?journey_id=…
(campus#803, campus#812 on weekly).

- add --journey to traces search, forwarded as journey_id=
- include journey_id in --dry-run kwargs (None dropped by
  _query_operation, like the other filters)
- drop the "not exposed here yet" docstring caveat
- relock campus-api-python to dad0442 (old pin 89df17e rejects the
  kwarg; targeted `poetry update`, campus-suite untouched)

Tests: unit passthrough via mocked client (journey_id set / None
when absent) plus dry-run snippet assertions mirroring the existing
search coverage. Suite: 296 passed; ruff clean.
@ngjunsiang
ngjunsiang merged commit dcd0ce3 into main Oct 20, 2026
4 checks passed
@ngjunsiang
ngjunsiang deleted the feat/63-audit-traces-journey branch October 20, 2026 14:42
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.

feat(cli): --journey flag for campus audit traces search

1 participant