Skip to content

feat: call git_autid_event when git operation

Sword requested to merge RryLee/gitlab:feat/call_rails_record_git_audit into master

What does this MR do and why?

According to this [discussion]#384960 (comment 1384459575), refactor the git streaming process flow in this merge request.

sequenceDiagram
    User->>+GitLabShell: git clone or pull (SSH)
    GitLabShell->>Rails: request /allowed
    Rails->>GitLabShell: authentication info
    GitLabShell->>Gitaly: UploadPackWithSidechannel
    Gitaly->>GitLabShell: UploadPackWithSidechannelResponse(stats={Wants=9, Haves=0, ...})
    GitLabShell-->>Rails: Report audit
    GitLabShell->>-User: Return

Update 5 files

  • /workhorse/internal/api/api.go
  • /workhorse/internal/api/api_test.go
  • /workhorse/internal/git/git-http.go
  • /workhorse/internal/git/receive-pack.go
  • /workhorse/internal/git/upload-pack.go
  • /workhorse/internal/gitaly/smarthttp.go

Workhorse will request /api/v4/internal/shellhorse/git_audit_event in this pr, it depends on:

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sword

Merge request reports