Loading
fix(govern): send the sync_type of the path that syncs the session
Description
glab govern audit sync always sent sync_type: hook when creating a session, so GitLab could not tell sessions the hooks synced from sessions the fallback periodic sync picked up. That is the first server-side signal of whether the hooks are missing sessions.
This MR sends the sync_type of the path that first syncs the session:
fallbackfor--all, which the fallback periodic sync runs.hookfor the Stop and SessionEnd hooks, which are the only callers that pass--silentwithout--all.manualwhen the command is run directly.
GitLab keeps the value sent when it creates the session, so a session first synced by a hook stays hook when --all later syncs it.
Related Issues
Resolves gitlab#633669 (closed)
Related to gitlab-org/gitlab#633647 and gitlab-org/gitlab#633649.
How has this been tested?
TestSyncAll_UploadsRecordedSessionnow asserts that--allsendsfallback.- New
TestSyncSession_ReportsSyncTypecovershook(with--silent) andmanual(without). Both assertions fail onmain, which sendshookfor every path. go test ./internal/commands/govern/...passes,golangci-lint(pinned 2.14.0) reports 0 issues, and the comment-overlap gate and generated-docs check pass.