diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
commit | 3b1af5cc7ed2666ff18b718ce5d30fa5a2756674 (patch) | |
tree | 3bc4a40e0ee51ec27eabf917c537033c0c5b14d4 /workhorse/internal | |
parent | 9bba14be3f2c211bf79e15769cd9b77bc73a13bc (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-eev16.1.0-rc42
Diffstat (limited to 'workhorse/internal')
23 files changed, 42 insertions, 37 deletions
diff --git a/workhorse/internal/api/api.go b/workhorse/internal/api/api.go index 8a7fb191ec4..4b36c9ddcbb 100644 --- a/workhorse/internal/api/api.go +++ b/workhorse/internal/api/api.go @@ -14,7 +14,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/config" "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper" diff --git a/workhorse/internal/git/archive.go b/workhorse/internal/git/archive.go index 3361a8bed44..acccd937038 100644 --- a/workhorse/internal/git/archive.go +++ b/workhorse/internal/git/archive.go @@ -19,7 +19,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" diff --git a/workhorse/internal/git/archive_test.go b/workhorse/internal/git/archive_test.go index 4348f5fe6f5..4942f5548f8 100644 --- a/workhorse/internal/git/archive_test.go +++ b/workhorse/internal/git/archive_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/testhelper" diff --git a/workhorse/internal/git/blob.go b/workhorse/internal/git/blob.go index 06b0eb08228..a7b2b0ca332 100644 --- a/workhorse/internal/git/blob.go +++ b/workhorse/internal/git/blob.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" diff --git a/workhorse/internal/git/diff.go b/workhorse/internal/git/diff.go index d450d1b9034..ced3cc4a51e 100644 --- a/workhorse/internal/git/diff.go +++ b/workhorse/internal/git/diff.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" diff --git a/workhorse/internal/git/error.go b/workhorse/internal/git/error.go index e073df19fff..311c76a01d0 100644 --- a/workhorse/internal/git/error.go +++ b/workhorse/internal/git/error.go @@ -5,7 +5,7 @@ import ( "fmt" "io" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "google.golang.org/grpc/status" "gitlab.com/gitlab-org/gitlab/workhorse/internal/log" diff --git a/workhorse/internal/git/error_test.go b/workhorse/internal/git/error_test.go index 11c9baa7d08..af39522c20d 100644 --- a/workhorse/internal/git/error_test.go +++ b/workhorse/internal/git/error_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" diff --git a/workhorse/internal/git/format-patch.go b/workhorse/internal/git/format-patch.go index a4306474aa5..6c15845f2d1 100644 --- a/workhorse/internal/git/format-patch.go +++ b/workhorse/internal/git/format-patch.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" diff --git a/workhorse/internal/git/info-refs_test.go b/workhorse/internal/git/info-refs_test.go index 6f45caed01e..57ed3c50111 100644 --- a/workhorse/internal/git/info-refs_test.go +++ b/workhorse/internal/git/info-refs_test.go @@ -8,7 +8,7 @@ import ( grpccodes "google.golang.org/grpc/codes" grpcstatus "google.golang.org/grpc/status" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" ) diff --git a/workhorse/internal/git/snapshot.go b/workhorse/internal/git/snapshot.go index 777ecd144a8..168f3641dcb 100644 --- a/workhorse/internal/git/snapshot.go +++ b/workhorse/internal/git/snapshot.go @@ -5,7 +5,7 @@ import ( "io" "net/http" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" diff --git a/workhorse/internal/git/upload-pack_test.go b/workhorse/internal/git/upload-pack_test.go index efe7977acc0..359262542f1 100644 --- a/workhorse/internal/git/upload-pack_test.go +++ b/workhorse/internal/git/upload-pack_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" - "gitlab.com/gitlab-org/gitaly/v15/client" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/client" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/testhelper" diff --git a/workhorse/internal/gitaly/blob.go b/workhorse/internal/gitaly/blob.go index 0a47b2da5ff..c84c1731300 100644 --- a/workhorse/internal/gitaly/blob.go +++ b/workhorse/internal/gitaly/blob.go @@ -7,8 +7,8 @@ import ( "net/http" "strconv" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/v15/streamio" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/streamio" ) type BlobClient struct { diff --git a/workhorse/internal/gitaly/diff.go b/workhorse/internal/gitaly/diff.go index cd63dbcbd13..a8f427231bb 100644 --- a/workhorse/internal/gitaly/diff.go +++ b/workhorse/internal/gitaly/diff.go @@ -6,8 +6,8 @@ import ( "io" "net/http" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/v15/streamio" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/streamio" ) type DiffClient struct { diff --git a/workhorse/internal/gitaly/gitaly.go b/workhorse/internal/gitaly/gitaly.go index eace87dda36..d9dbbdbb605 100644 --- a/workhorse/internal/gitaly/gitaly.go +++ b/workhorse/internal/gitaly/gitaly.go @@ -15,9 +15,9 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/metadata" - gitalyauth "gitlab.com/gitlab-org/gitaly/v15/auth" - gitalyclient "gitlab.com/gitlab-org/gitaly/v15/client" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + gitalyauth "gitlab.com/gitlab-org/gitaly/v16/auth" + gitalyclient "gitlab.com/gitlab-org/gitaly/v16/client" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" diff --git a/workhorse/internal/gitaly/namespace.go b/workhorse/internal/gitaly/namespace.go index 1e6cb079ee0..a9bc2d07a7e 100644 --- a/workhorse/internal/gitaly/namespace.go +++ b/workhorse/internal/gitaly/namespace.go @@ -1,6 +1,6 @@ package gitaly -import "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" +import "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" // NamespaceClient encapsulates NamespaceService calls type NamespaceClient struct { diff --git a/workhorse/internal/gitaly/repository.go b/workhorse/internal/gitaly/repository.go index cd5ae463a19..ad7ef869316 100644 --- a/workhorse/internal/gitaly/repository.go +++ b/workhorse/internal/gitaly/repository.go @@ -5,8 +5,8 @@ import ( "fmt" "io" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/v15/streamio" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/streamio" ) // RepositoryClient encapsulates RepositoryService calls diff --git a/workhorse/internal/gitaly/smarthttp.go b/workhorse/internal/gitaly/smarthttp.go index 06ed215f4ec..e0ddf5ae4eb 100644 --- a/workhorse/internal/gitaly/smarthttp.go +++ b/workhorse/internal/gitaly/smarthttp.go @@ -5,9 +5,9 @@ import ( "fmt" "io" - gitalyclient "gitlab.com/gitlab-org/gitaly/v15/client" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/v15/streamio" + gitalyclient "gitlab.com/gitlab-org/gitaly/v16/client" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/streamio" ) type SmartHTTPClient struct { diff --git a/workhorse/internal/gitaly/unmarshal_test.go b/workhorse/internal/gitaly/unmarshal_test.go index 2e59fe973bf..39e3a3f2502 100644 --- a/workhorse/internal/gitaly/unmarshal_test.go +++ b/workhorse/internal/gitaly/unmarshal_test.go @@ -5,7 +5,7 @@ import ( "github.com/golang/protobuf/proto" //lint:ignore SA1019 https://gitlab.com/gitlab-org/gitlab/-/issues/324868 "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" ) func TestUnmarshalJSON(t *testing.T) { diff --git a/workhorse/internal/httprs/httprs_test.go b/workhorse/internal/httprs/httprs_test.go index 9dcfe75219b..8def6de09d9 100644 --- a/workhorse/internal/httprs/httprs_test.go +++ b/workhorse/internal/httprs/httprs_test.go @@ -197,7 +197,7 @@ func testHttpReaderSeeker(t *testing.T, newRS RSFactory) { defer r.Close() buf := make([]byte, 4) io.ReadFull(r, buf) - s, err := r.Seek(4*64, os.SEEK_CUR) + s, err := r.Seek(4*64, io.SeekCurrent) So(s, ShouldEqual, 4*64+4) So(err, ShouldBeNil) n, err := io.ReadFull(r, buf) @@ -212,7 +212,7 @@ func testHttpReaderSeeker(t *testing.T, newRS RSFactory) { defer r.Close() buf := make([]byte, 4) io.ReadFull(r, buf) - s, err := r.Seek(4, os.SEEK_END) + s, err := r.Seek(4, io.SeekEnd) So(s, ShouldEqual, SZ*4-4) So(err, ShouldBeNil) n, err := io.ReadFull(r, buf) @@ -229,7 +229,7 @@ func testHttpReaderSeeker(t *testing.T, newRS RSFactory) { So(r.Requests, ShouldEqual, 0) io.ReadFull(r, buf) So(r.Requests, ShouldEqual, 1) - s, err := r.Seek(shortSeekBytes, os.SEEK_CUR) + s, err := r.Seek(shortSeekBytes, io.SeekCurrent) So(r.Requests, ShouldEqual, 1) So(s, ShouldEqual, shortSeekBytes+4) So(err, ShouldBeNil) @@ -248,7 +248,7 @@ func testHttpReaderSeeker(t *testing.T, newRS RSFactory) { So(r.Requests, ShouldEqual, 0) io.ReadFull(r, buf) So(r.Requests, ShouldEqual, 1) - s, err := r.Seek(shortSeekBytes+1, os.SEEK_CUR) + s, err := r.Seek(shortSeekBytes+1, io.SeekCurrent) So(r.Requests, ShouldEqual, 1) So(s, ShouldEqual, shortSeekBytes+4+1) So(err, ShouldBeNil) diff --git a/workhorse/internal/testhelper/gitaly.go b/workhorse/internal/testhelper/gitaly.go index 55fbcf2db2d..b468f0941de 100644 --- a/workhorse/internal/testhelper/gitaly.go +++ b/workhorse/internal/testhelper/gitaly.go @@ -19,8 +19,8 @@ import ( "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" - "gitlab.com/gitlab-org/gitaly/v15/client" - "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/v16/client" + "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" "gitlab.com/gitlab-org/labkit/log" ) diff --git a/workhorse/internal/upload/destination/objectstore/s3_session.go b/workhorse/internal/upload/destination/objectstore/s3_session.go index e1fe6fbbdc9..168a80845bb 100644 --- a/workhorse/internal/upload/destination/objectstore/s3_session.go +++ b/workhorse/internal/upload/destination/objectstore/s3_session.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/s3" "gitlab.com/gitlab-org/gitlab/workhorse/internal/config" @@ -76,7 +77,7 @@ func setupS3Session(s3Credentials config.S3Credentials, s3Config config.S3Config // the custom endpoint is only used for S3 API calls, and not // for STS API calls. s3CustomResolver := func(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { - if service == endpoints.S3ServiceID { + if service == s3.EndpointsID { return endpoints.ResolvedEndpoint{ URL: s3Config.Endpoint, SigningRegion: region, diff --git a/workhorse/internal/upload/destination/objectstore/s3_session_test.go b/workhorse/internal/upload/destination/objectstore/s3_session_test.go index b7bbee0ef69..2329569b774 100644 --- a/workhorse/internal/upload/destination/objectstore/s3_session_test.go +++ b/workhorse/internal/upload/destination/objectstore/s3_session_test.go @@ -5,7 +5,8 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/endpoints" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/sts" "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitlab/workhorse/internal/config" @@ -20,7 +21,7 @@ func TestS3SessionSetup(t *testing.T) { sess, err := setupS3Session(credentials, cfg) require.NoError(t, err) - s3Config := sess.ClientConfig(endpoints.S3ServiceID) + s3Config := sess.ClientConfig(s3.EndpointsID) require.Equal(t, "https://s3.us-west-1.amazonaws.com", s3Config.Endpoint) require.Equal(t, "us-west-1", s3Config.SigningRegion) require.True(t, aws.BoolValue(sess.Config.S3ForcePathStyle)) @@ -44,11 +45,11 @@ func TestS3SessionEndpointSetup(t *testing.T) { require.NoError(t, err) // ClientConfig is what is ultimately used by an S3 client - s3Config := sess.ClientConfig(endpoints.S3ServiceID) + s3Config := sess.ClientConfig(s3.EndpointsID) require.Equal(t, customS3Endpoint, s3Config.Endpoint) require.Equal(t, region, s3Config.SigningRegion) - stsConfig := sess.ClientConfig(endpoints.StsServiceID) + stsConfig := sess.ClientConfig(sts.EndpointsID) require.Equal(t, "https://sts.amazonaws.com", stsConfig.Endpoint, "STS should use default endpoint") } diff --git a/workhorse/internal/upstream/routes.go b/workhorse/internal/upstream/routes.go index c5af9dc3f00..dd1725a723e 100644 --- a/workhorse/internal/upstream/routes.go +++ b/workhorse/internal/upstream/routes.go @@ -279,6 +279,9 @@ func configureRoutes(u *upstream) { // Generic Packages Repository u.route("PUT", apiProjectPattern+`/packages/generic/`, requestBodyUploader), + // Ml Model Packages Repository + u.route("PUT", apiProjectPattern+`/packages/ml_models/`, requestBodyUploader), + // NuGet Artifact Repository u.route("PUT", apiProjectPattern+`/packages/nuget/`, mimeMultipartUploader), |