feat(proxy): emit session summary on persistent proxy shutdown - #352
Merged
Conversation
The persistent proxy daemon never ran the per-invocation flow that calls LogSessionComplete, so no session summary reached the cloud for server-mode runs. Emit one from the daemon's aggregate stats collector on shutdown, before the final cloud flush, so it is delivered with the run's events and carries the CI/invocation context. Extract the event emission into a shared LogSessionSummary(SessionData); both the per-invocation flow and the daemon now use it. The daemon serves every package manager, so the summary carries no single package manager.
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #352 +/- ##
==========================================
- Coverage 54.10% 54.04% -0.07%
==========================================
Files 205 205
Lines 13937 13961 +24
==========================================
+ Hits 7541 7545 +4
- Misses 5697 5717 +20
Partials 699 699 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
abhisek
approved these changes
Jun 26, 2026
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.



Why
The persistent proxy daemon (server mode) never runs the per-invocation flow that calls
LogSessionComplete, so no session summary ever reached SafeDep Cloud for server-mode runs. Per-package events synced, but the per-run aggregate (and the CI/invocation context it carries) was missing.What
cloudSinkautomatically attaches the CI/invocation context.LogSessionCompleteinto a shared exportedLogSessionSummary(SessionData). The per-invocation flow (which sources data from the audit session) and the daemon (which sources from the stats collector) now share one emit path — no duplicated event construction.UNSPECIFIED); outcome isblockedwhen anything was blocked, elsesuccess; duration is the daemon lifetime.Notes
TrustedSkipped/InsecureBypassedare0in server mode — the stats collector doesn't track them yet. Can be added via newRecord*methods if needed.github-actions/→gha/.