CXP-383 Support Last Log In w/ usage event feed for the Enterprise connector - #188
CXP-383 Support Last Log In w/ usage event feed for the Enterprise connector#188JavierCarnelli-ConductorOne wants to merge 7 commits into
Conversation
Adds an opt-in usage event feed that streams each org's audit-log activity (web/API actions, excluding raw git operations and bot actors) as incremental usage events, letting the platform derive last-activity for members without a per-user API field to sync directly. The config field is intentionally hidden from this connector's CLI/GUI since it only applies to GitHub Enterprise audit-log access; the enterprise connector variant sets it directly on the shared config struct. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Connector PR Review: CXP-383 Support Last Log In w/ usage event feed for the Enterprise connectorBlocking Issues: 0 | Suggestions: 1 | Threads Resolved: 0 Review SummaryThe new commit addresses two of the three findings from the previous review: Security IssuesNone found. Correctness IssuesNone found. Suggestions
Prompt for AI agents |
newWithGithubApp built its GitHub struct without copying SyncLastActivity, so EventFeeds() always returned nil for App-authenticated connectors regardless of the config value, with no error or log. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Track the since-boundary explicitly instead of inferring it from whether an event was emitted, so a page of only filtered-out entries (bots, missing IDs) no longer ends an org's walk early and silently drops later pages of real activity. - Surface the tightest rate limit seen across a call's audit-log requests as an annotation, including on error responses, so the SDK can pace polling instead of hitting 429s. - Fall back to a synthesized event id (org/actor/timestamp/action) when GitHub omits _document_id, avoiding ambiguous dedup on empty ids. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…f them Skip-and-continue is now restricted to permanent per-org conditions (403/404), logged at Warn per this repo's log-level convention. Rate limits, 5xx, and any other error now abort the call instead of silently completing the pass and permanently losing the unfetched activity window on the next poll. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Use nanosecond precision for the synthesized event id and the persisted "since" cursor to avoid same-second id collisions and duplicate re-emitted events. Also check every audit entry's raw timestamp against the boundary, not just ones that pass the bot filter, so an all-filtered page doesn't stall pagination past "since". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The page budget is a single counter shared across every org processed in a call, not a per-org cap as the comment claimed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Requires review. Bugs fixed
Adds an opt-in usage event feed that streams each org's audit-log activity (web/API actions, excluding raw git operations and bot actors) as incremental usage events, letting the platform derive last-activity for members without a per-user API field to sync directly. The config field is intentionally hidden from this connector's CLI/GUI since it only applies to GitHub Enterprise audit-log access; the enterprise connector variant sets it directly on the shared config struct.
This feature is build to be used by baton-github-enterprise which vendors this connector.