-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
gitlab-runner: 17.2.0 -> 17.9.1 #392089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
gitlab-runner: 17.2.0 -> 17.9.1 #392089
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
pkgs/by-name/gi/gitlab-runner/disable-kubernetes-test-on-aarch64.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| diff --git a/executors/kubernetes/kubernetes_test.go b/executors/kubernetes/kubernetes_test.go | ||
| index ba50f31e0..c500e3a26 100644 | ||
| --- a/executors/kubernetes/kubernetes_test.go | ||
| +++ b/executors/kubernetes/kubernetes_test.go | ||
| @@ -2815,6 +2815,9 @@ func TestPrepare(t *testing.T) { | ||
| if runtime.GOOS == "windows" { | ||
| return false, "skipping test, because we are running on windows" | ||
| } | ||
| + if runtime.GOARCH == "arm64" { | ||
| + return false, "skipping test, because of fix assertion we should be on x86" | ||
| + } | ||
| return true, "" | ||
| }, | ||
| WindowsKernelVersionGetter: func() string { |
42 changes: 42 additions & 0 deletions
42
pkgs/by-name/gi/gitlab-runner/disable-unix-socket-tests-on-darwin.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| diff --git a/commands/wrapper_test.go b/commands/wrapper_test.go | ||
| index c897c8170..b5ad47acf 100644 | ||
| --- a/commands/wrapper_test.go | ||
| +++ b/commands/wrapper_test.go | ||
| @@ -16,10 +16,13 @@ import ( | ||
| func TestRunnerWrapperCommand_createListener(t *testing.T) { | ||
| testSocketPath := filepath.Join(t.TempDir(), "test.sock") | ||
|
|
||
| - skipOnWindows := func(t *testing.T) { | ||
| + skipCondition := func(t *testing.T) { | ||
| if runtime.GOOS == "windows" { | ||
| t.Skip("Test doesn't work reliably on Windows (unix socket usage)") | ||
| } | ||
| + if runtime.GOOS == "darwin" { | ||
| + t.Skip("Test doesn't work reliably on Darwin with enabled sandbox") | ||
| + } | ||
| } | ||
|
|
||
| tests := map[string]struct { | ||
| @@ -36,19 +39,19 @@ func TestRunnerWrapperCommand_createListener(t *testing.T) { | ||
| }, | ||
| }, | ||
| "proper unix socket - unix://": { | ||
| - skip: skipOnWindows, | ||
| + skip: skipCondition, | ||
| grpcAddress: fmt.Sprintf("unix://%s", testSocketPath), | ||
| expectedNetwork: "unix", | ||
| expectedAddress: testSocketPath, | ||
| }, | ||
| "proper unix socket - unix:": { | ||
| - skip: skipOnWindows, | ||
| + skip: skipCondition, | ||
| grpcAddress: fmt.Sprintf("unix://%s", testSocketPath), | ||
| expectedNetwork: "unix", | ||
| expectedAddress: testSocketPath, | ||
| }, | ||
| "invalid unix socket": { | ||
| - skip: skipOnWindows, | ||
| + skip: skipCondition, | ||
| grpcAddress: fmt.Sprintf("unix:/%s", testSocketPath), | ||
| assertError: func(t *testing.T, err error) { | ||
| var eerr *net.OpError |
24 changes: 24 additions & 0 deletions
24
pkgs/by-name/gi/gitlab-runner/disable-x509-certificate-check-on-darwin.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| diff --git a/helpers/certificate/x509_test.go b/helpers/certificate/x509_test.go | ||
| index 8afe0d9e8..7eac8a691 100644 | ||
| --- a/helpers/certificate/x509_test.go | ||
| +++ b/helpers/certificate/x509_test.go | ||
| @@ -8,6 +8,7 @@ import ( | ||
| "net" | ||
| "net/http" | ||
| "regexp" | ||
| + "runtime" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| @@ -62,6 +63,9 @@ func TestCertificate(t *testing.T) { | ||
| _, err = client.Do(req) | ||
| assert.Error(t, err) | ||
| // Error messages provided by Linux and MacOS respectively. | ||
| - const want = "certificate signed by unknown authority|certificate is not trusted" | ||
| - assert.Regexp(t, regexp.MustCompile(want), err.Error()) | ||
| + // Nix sandbox prevents the test from working | ||
| + if runtime.GOOS != "darwin" { | ||
| + const want = "certificate signed by unknown authority|certificate is not trusted" | ||
| + assert.Regexp(t, regexp.MustCompile(want), err.Error()) | ||
| + } | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,39 @@ | ||
| { lib, buildGoModule, fetchFromGitLab, bash }: | ||
| { | ||
| lib, | ||
| buildGoModule, | ||
| fetchFromGitLab, | ||
| bash, | ||
| }: | ||
|
|
||
| let | ||
| version = "17.2.0"; | ||
| version = "17.9.2"; | ||
| in | ||
| buildGoModule rec { | ||
| inherit version; | ||
| pname = "gitlab-runner"; | ||
|
|
||
| commonPackagePath = "gitlab.com/gitlab-org/gitlab-runner/common"; | ||
| ldflags = [ | ||
| "-X ${commonPackagePath}.NAME=gitlab-runner" | ||
| "-X ${commonPackagePath}.VERSION=${version}" | ||
| "-X ${commonPackagePath}.REVISION=v${version}" | ||
| ]; | ||
|
|
||
| # For patchShebangs | ||
| buildInputs = [ bash ]; | ||
|
|
||
| vendorHash = "sha256-1MwHss76apA9KoFhEU6lYiUACrPMGYzjhds6nTyNuJI="; | ||
| vendorHash = "sha256-t/FVaDga2ogyqgVdJuBMSyls3rricfqIy5bFSH4snk4="; | ||
|
|
||
| src = fetchFromGitLab { | ||
| owner = "gitlab-org"; | ||
| repo = "gitlab-runner"; | ||
| rev = "v${version}"; | ||
| hash = "sha256-a2Igy4DS3fYTvPW1vvDrH/DjMQ4lG9cm/P3mFr+y9s4="; | ||
| hash = "sha256-kcDsjmx/900p2ux7dyGHSOVqXxxVhg2/o0a3NYcqIrA="; | ||
| }; | ||
|
|
||
| patches = [ | ||
| ./fix-shell-path.patch | ||
| ./remove-bash-test.patch | ||
| # Asserts for x86_64 architecture | ||
| # https://gitlab.com/gitlab-org/gitlab-runner/-/issues/38697 | ||
| ./disable-kubernetes-test-on-aarch64.patch | ||
| # Fails in nix sandbox | ||
| ./disable-unix-socket-tests-on-darwin.patch | ||
| # Fails in nix sandbox | ||
| # Returns OSStatus -26276 | ||
| ./disable-x509-certificate-check-on-darwin.patch | ||
| ]; | ||
|
|
||
| prePatch = '' | ||
|
|
@@ -50,13 +55,26 @@ buildGoModule rec { | |
| rm executors/docker/services_test.go | ||
| ''; | ||
|
|
||
| postPatch = '' | ||
| substituteInPlace Makefile --replace-fail "export VERSION := \$(shell ./ci/version)" "export VERSION := ${version}" | ||
| substituteInPlace Makefile --replace-fail "REVISION := \$(shell git rev-parse --short=8 HEAD || echo unknown)" "REVISION := v${version}" | ||
| ''; | ||
|
|
||
| excludedPackages = [ | ||
| # CI helper script for pushing images to Docker and ECR registries | ||
| # https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/4139 | ||
| "./scripts/sync-docker-images" | ||
| ]; | ||
|
|
||
| buildPhase = '' | ||
| runHook preBuild | ||
| make -j $NIX_BUILD_CORES runner-and-helper-bin-host | ||
| runHook postBuild | ||
| ''; | ||
|
|
||
| postInstall = '' | ||
| mkdir $out/bin | ||
| cp out/binaries/gitlab-runner-$GOOS-$GOARCH $out/bin/gitlab-runner | ||
|
Comment on lines
+76
to
+77
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| install packaging/root/usr/share/gitlab-runner/clear-docker-cache $out/bin | ||
| ''; | ||
|
|
||
|
|
@@ -65,6 +83,12 @@ buildGoModule rec { | |
| export CI=0 | ||
| ''; | ||
|
|
||
| checkPhase = '' | ||
| runHook preCheck | ||
| make simple-test | ||
| runHook postCheck | ||
| ''; | ||
|
|
||
| meta = with lib; { | ||
| description = "GitLab Runner the continuous integration executor of GitLab"; | ||
| license = licenses.mit; | ||
|
|
||
29 changes: 29 additions & 0 deletions
29
pkgs/by-name/gi/gitlab-runner/replace-make-go-invocations.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| diff --git a/Makefile b/Makefile | ||
| index e948db0d6d..cd0957251e 100644 | ||
| --- a/Makefile | ||
| +++ b/Makefile | ||
| @@ -3,14 +3,10 @@ | ||
| export PACKAGE_NAME ?= $(NAME) | ||
| export VERSION := $(shell ./ci/version) | ||
| REVISION := $(shell git rev-parse --short=8 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) | ||
| +BRANCH := | ||
| export TESTFLAGS ?= -cover | ||
|
|
||
| -LATEST_STABLE_TAG := $(shell git -c versionsort.prereleaseSuffix="-rc" -c versionsort.prereleaseSuffix="-RC" tag -l "v*.*.*" | sort -rV | awk '!/rc/' | head -n 1) | ||
| export IS_LATEST := | ||
| -ifeq ($(shell git describe --exact-match --match $(LATEST_STABLE_TAG) >/dev/null 2>&1; echo $$?), 0) | ||
| -export IS_LATEST := true | ||
| -endif | ||
|
|
||
| PACKAGE_CLOUD ?= runner/gitlab-runner | ||
| PACKAGE_CLOUD_URL ?= https://packages.gitlab.com | ||
| @@ -32,7 +28,7 @@ | ||
| export MAIN_PACKAGE ?= gitlab.com/gitlab-org/gitlab-runner | ||
|
|
||
| GO_LDFLAGS ?= -X $(COMMON_PACKAGE_NAMESPACE).NAME=$(APP_NAME) -X $(COMMON_PACKAGE_NAMESPACE).VERSION=$(VERSION) \ | ||
| - -X $(COMMON_PACKAGE_NAMESPACE).BRANCH=$(BRANCH) \ | ||
| + -X $(COMMON_PACKAGE_NAMESPACE).REVISION=$(REVISION) -X $(COMMON_PACKAGE_NAMESPACE).BRANCH=$(BRANCH) \ | ||
| -w | ||
|
|
||
| GO_TEST_LDFLAGS ?= -X $(COMMON_PACKAGE_NAMESPACE).NAME=$(APP_NAME) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps I am wrong but, I think the
.gitfolder is stripped out, sogit rev-parsewon't work.Have you tested this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. I switched back to draft, as I made a mistake while pushing. 17.9.2 introduced further changes (mroe tests fail when not there is no .git directory). I'm currently trying some more things...