Include GitLab runner version in git user-agent string
When performing HTTP operations, the git client uses an HTTP user agent such as git/2.26.2
.
It would sometimes be helpful to know the runner version too. Additionally, this information would be really helpful in diagnosing some git clone stampeding herd problems (such as gitlab-com/gl-infra/production#2534 (closed)) knowing that the traffic was coming from a CI runner.
The git user agent can be overridden using GIT_HTTP_USER_AGENT
:
https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables
`GIT_HTTP_USER_AGENT` sets the user-agent string used by Git when communicating over HTTP. The default is a value like git/2.0.0.
Proposal
Modify the GIT_HTTP_USER_AGENT
environment variable to include runner version information.
User-Agent: git/2.26.2 (GitLab-Runner X.Y.Z)
Edited by Andrew Newdigate