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 215fb3c7 authored by nanmu42's avatar nanmu42
Browse files

Merge remote-tracking branch 'fork/main' into feat/call_rails_record_git_audit

parents b6732e6a 4383fd0a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -124,7 +124,7 @@ modules:download:
services:
- name: registry.gitlab.com/gitlab-org/build/cng/gitaly:master
# Disable the hooks so we don't have to stub the GitLab API
command: ["bash", "-c", "mkdir -p /home/git/repositories && rm -rf /srv/gitlab-shell/hooks/* && touch /srv/gitlab-shell/.gitlab_shell_secret && cp /etc/gitaly/config.toml.erb /etc/gitaly/config.toml 2>/dev/null && exec /usr/bin/env GITALY_TESTING_NO_GIT_HOOKS=1 /scripts/process-wrapper"]
command: ["bash", "-c", "mkdir -p /home/git/repositories && rm -rf /srv/gitlab-shell/hooks/* && touch /srv/gitlab-shell/.gitlab_shell_secret && exec /usr/bin/env GITALY_TESTING_NO_GIT_HOOKS=1 /scripts/process-wrapper"]
alias: gitaly
tests:
Loading
Loading
Loading
Loading
@@ -79,17 +79,16 @@ func ensureGitalyRepository(t *testing.T) (*grpc.ClientConn, *pb.Repository) {
conn, err := gitalyClient.Dial(gitalyConnInfo.Address, gitalyClient.DefaultDialOpts)
require.NoError(t, err)
namespace := pb.NewNamespaceServiceClient(conn)
repository := pb.NewRepositoryServiceClient(conn)
// Remove the repository if it already exists, for consistency
rmNsReq := &pb.RemoveNamespaceRequest{StorageName: gitalyConnInfo.Storage, Name: testRepoNamespace}
_, err = namespace.RemoveNamespace(context.Background(), rmNsReq)
require.NoError(t, err)
glRepository := &pb.Repository{StorageName: gitalyConnInfo.Storage, RelativePath: testRepo}
createReq := &pb.CreateRepositoryFromURLRequest{Repository: glRepository, Url: testRepoImportUrl}
// Remove the test repository before running the tests
removeReq := &pb.RemoveRepositoryRequest{Repository: glRepository}
// Ignore the error because the repository may not exist
repository.RemoveRepository(context.Background(), removeReq)
createReq := &pb.CreateRepositoryFromURLRequest{Repository: glRepository, Url: testRepoImportUrl}
_, err = repository.CreateRepositoryFromURL(context.Background(), createReq)
require.NoError(t, err)
Loading
Loading
Loading
Loading
@@ -5,6 +5,6 @@ services:
- GITALY_TESTING_NO_GIT_HOOKS=1
image: registry.gitlab.com/gitlab-org/build/cng/gitaly:master
command:
["bash", "-c", "mkdir -p /home/git/repositories && rm -rf /srv/gitlab-shell/hooks/* && touch /srv/gitlab-shell/.gitlab_shell_secret && cp /etc/gitaly/config.toml.erb /etc/gitaly/config.toml 2>/dev/null && exec /usr/bin/env GITALY_TESTING_NO_GIT_HOOKS=1 /scripts/process-wrapper"]
["bash", "-c", "mkdir -p /home/git/repositories && rm -rf /srv/gitlab-shell/hooks/* && touch /srv/gitlab-shell/.gitlab_shell_secret && exec /usr/bin/env GITALY_TESTING_NO_GIT_HOOKS=1 /scripts/process-wrapper"]
ports:
- '8075:8075'
Loading
Loading
@@ -14,8 +14,8 @@ require (
github.com/prometheus/client_golang v1.17.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.4
gitlab.com/gitlab-org/gitaly/v16 v16.5.1
gitlab.com/gitlab-org/labkit v1.20.0
gitlab.com/gitlab-org/gitaly/v16 v16.6.0
gitlab.com/gitlab-org/labkit v1.21.0
golang.org/x/crypto v0.15.0
golang.org/x/sync v0.5.0
google.golang.org/grpc v1.59.0
Loading
Loading
@@ -51,6 +51,7 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/yamux v0.1.2-0.20220728231024-8f49b6f63f18 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Loading
Loading
Loading
Loading
@@ -220,6 +220,8 @@ github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8=
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0 h1:2cz5kSrxzMYHiWOBbKj8itQm+nRykkB8aMv4ThcHYHA=
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0/go.mod h1:w9Y7gY31krpLmrVU5ZPG9H7l9fZuRu5/3R3S3FMtVQ4=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
Loading
Loading
@@ -361,10 +363,10 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
gitlab.com/gitlab-org/gitaly/v16 v16.5.1 h1:ewziqYFF2EK/pVWbZsvkSkgLlTvkGk+2a8r7iBLIIXQ=
gitlab.com/gitlab-org/gitaly/v16 v16.5.1/go.mod h1:tk4DzNt+NLKuXqAocZEIlJq1Q1D/DndpD4SLevjXEGE=
gitlab.com/gitlab-org/labkit v1.20.0 h1:DGIVAdzbCR8sq2TppBvAh35wWBYIOy5dBL5wqFK3Wa8=
gitlab.com/gitlab-org/labkit v1.20.0/go.mod h1:zeATDAaSBelPcPLbTTq8J3ZJEHyPTLVBM1q3nva+/W4=
gitlab.com/gitlab-org/gitaly/v16 v16.6.0 h1:4m48siPRsNSK2Su6Ir1VNladLmfbpHJC31GyqRurNSY=
gitlab.com/gitlab-org/gitaly/v16 v16.6.0/go.mod h1:LbekHBeRUnb1jDQCXIUSNebuPMzVTq8B9PXXp4xVOF4=
gitlab.com/gitlab-org/labkit v1.21.0 h1:hLmdBDtXjD1yOmZ+uJOac3a5Tlo83QaezwhES4IYik4=
gitlab.com/gitlab-org/labkit v1.21.0/go.mod h1:zeATDAaSBelPcPLbTTq8J3ZJEHyPTLVBM1q3nva+/W4=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
Loading
Loading
Loading
Loading
@@ -13,9 +13,8 @@ import (
)
const (
sshProtocol = "ssh"
sshCertProtocol = "ssh_certificates"
anyChanges = "_any"
sshProtocol = "ssh"
anyChanges = "_any"
)
type Client struct {
Loading
Loading
@@ -95,10 +94,6 @@ func (c *Client) Verify(ctx context.Context, args *commandargs.Shell, action com
NamespacePath: args.Env.NamespacePath,
}
if args.Env.NamespacePath != "" {
request.Protocol = sshCertProtocol
}
if args.GitlabUsername != "" {
request.Username = args.GitlabUsername
} else if args.GitlabKrb5Principal != "" {
Loading
Loading
Loading
Loading
@@ -266,7 +266,6 @@ func setup(t *testing.T, userResponses, keyResponses map[string]testResponse) *C
_, err := w.Write(tr.body)
require.NoError(t, err)
require.Equal(t, namespace, requestBody.NamespacePath)
require.Equal(t, sshCertProtocol, requestBody.Protocol)
} else if tr, ok := userResponses[requestBody.Krb5Principal]; ok {
w.WriteHeader(tr.status)
_, err := w.Write(tr.body)
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