As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit 907dafba authored by nanmu42's avatar nanmu42
Browse files

chore: amend test and comments for streaming audit events

parent e54b8dc5
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -188,7 +188,7 @@ func successAPI(t *testing.T, handlers ...customHandler) http.Handler {
_, err := fmt.Fprint(w, response)
require.NoError(t, err)
case "/api/v4/internal/shellhorse/git_audit_event":
// response success
w.WriteHeader(http.StatusOK)
return
default:
t.Logf("Unexpected request to successAPI: %s", r.URL.EscapedPath())
Loading
Loading
Loading
Loading
@@ -11,10 +11,8 @@ import (
"gitlab.com/gitlab-org/labkit/log"
)
// Audit is a command function that call rails to audit `git-receive-pack` and `git-upload-pack` events.
// Calling rails for git audit events is always followed by `git clone`, `git pull`, `git push`,
// So we do not guarantee that two requests will succeed, this is a Distributed transaction.
// Let's just simply ignore errors.
// Audit is called conditionally during `git-receive-pack` and `git-upload-pack` to generate streaming audit events.
// Errors are not propagated since this is more a logging process.
func Audit(ctx context.Context, commandType commandargs.CommandType, c *config.Config, response *accessverifier.Response, packfileStats *pb.PackfileNegotiationStatistics) {
ctxlog := log.WithContextFields(ctx, log.Fields{
"gl_repository": response.Repo,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment