FS#51333 - [gitlab-ci-multi-runner] Wrong User-Agent
Attached to Project:
Community Packages
Opened by Mathieu (mfc_alpha) - Tuesday, 11 October 2016, 22:39 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Tuesday, 23 May 2017, 18:04 GMT
Opened by Mathieu (mfc_alpha) - Tuesday, 11 October 2016, 22:39 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Tuesday, 23 May 2017, 18:04 GMT
|
Details
Description:
gitlab-ci-multi-runner regularly ask gitlab-workhorse by HTTP if jobs are available. When doing that, gitlab-workhorse check user agent given by the runner. The user agent NORMALLY contains gitlab-runner version (e.g. 1.6.0~beta.167.g2b2bacc (1-5-stable; go1.6.3; linux/amd64)) that help gitlab-workhorse to behave differently. (e.g use 204 http request instead of 404 and then avoid spamming journalctl https://gitlab.com/dblessing/gitlab-ce/commit/5fdd92df39030ba4297189a274b8055fbca4b580) But our user agent contains "gitlab-ci-multi-runner dev (HEAD; go1.7.1; linux/amd64)" and completely miss the version number. Additional info: * 1.6.0-1 Steps to reproduce: * activate gitlab runner and wait for log from gitlab-workhorse in journalctl ... gitlab-workhorse[558]: ... "POST /ci/api/v1/builds/register.json HTTP/1.1" 404 27 "" "gitlab-ci-multi-runner dev (HEAD; go1.7.1; linux/amd64)" 0.026087 * You can also use tcpdump to check the user-agent |
This task depends upon
EDIT: However, I do believe I have fixed the issue now by just building from the git repo directly which will enable the build script to find out its version.
It looks like this information is build here : common/version.go.
The information written in this file are suppose to be override at runtime ? Rebuild at build time ?
May be just add -X main.BRANCH=${pkgver} -X main.VERSION=${pkgver} to the build cmd in the PKGBUILD ?
In the original build, they are build this way:
REVISION := $(shell git rev-parse --short HEAD || echo unknown)
BRANCH := $(shell git show-ref | grep "$(REVISION)" | grep -v HEAD | awk '{print $$2}' | sed 's|refs/remotes/origin/||' | sed 's|refs/heads/||' | sort | head -n 1)