diff options
author | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2022-11-09 13:50:00 +0300 |
---|---|---|
committer | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2022-11-09 13:50:00 +0300 |
commit | 2a4b8505acc10b6d4c89d1c6c7b319c2ddadedfc (patch) | |
tree | 55af2208d2551bc33fd724698ec8bddd0123dfb8 | |
parent | 6783b007be1ab5e2e1e36f54f680cba482278a3c (diff) | |
parent | bf526b8f62d87106d1f340b9c839444c4e150cca (diff) |
Merge branch 'pks-golang-support-v1.19' into 'master'
go: Add support for Go 1.19
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5000
Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
-rw-r--r-- | .gitlab-ci.yml | 10 | ||||
-rw-r--r-- | .golangci.yml | 9 | ||||
-rw-r--r-- | .tool-versions | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | proto/go/gitalypb/conflicts.pb.go | 2 | ||||
-rw-r--r-- | proto/go/gitalypb/diff.pb.go | 1 | ||||
-rw-r--r-- | proto/go/gitalypb/operations.pb.go | 25 | ||||
-rw-r--r-- | proto/go/gitalypb/operations_grpc.pb.go | 40 | ||||
-rw-r--r-- | proto/go/gitalypb/praefect.pb.go | 2 | ||||
-rw-r--r-- | proto/go/gitalypb/ref.pb.go | 2 | ||||
-rw-r--r-- | proto/go/gitalypb/repository.pb.go | 12 | ||||
-rw-r--r-- | proto/go/gitalypb/server.pb.go | 1 | ||||
-rw-r--r-- | proto/go/gitalypb/transaction_grpc.pb.go | 24 |
13 files changed, 79 insertions, 53 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66ea51cd0..664cef42f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ variables: UBI_VERSION: "8.6" # We use Gitaly's Git version by default. GIT_VERSION: "default" - GO_VERSION: "1.18" + GO_VERSION: "1.19" RUBY_VERSION: "2.7" POSTGRES_VERSION: "12.6-alpine" PGBOUNCER_VERSION: "1.16.1" @@ -155,7 +155,7 @@ build: - _support/test-boot . ${TEST_BOOT_ARGS} parallel: matrix: - - GO_VERSION: [ "1.18" ] + - GO_VERSION: [ "1.18", "1.19" ] TEST_BOOT_ARGS: "--bundled-git" - GIT_VERSION: "v2.37.0" @@ -180,7 +180,7 @@ build:binaries: expire_in: 6 months parallel: matrix: - - GO_VERSION: [ "1.18" ] + - GO_VERSION: [ "1.18", "1.19" ] test: <<: *test_definition @@ -188,7 +188,7 @@ test: matrix: # The following jobs all test with our default Git version, which is # using bundled Git binaries. - - GO_VERSION: [ "1.18" ] + - GO_VERSION: [ "1.18", "1.19" ] TEST_TARGET: test - TEST_TARGET: [ test-with-proxies, test-with-praefect, race-go ] # We also verify that things work as expected with a non-bundled Git @@ -285,6 +285,8 @@ test:fips: matrix: - TEST_TARGET: [ test, test-with-praefect ] FIPS_MODE: "YesPlease" + # There is no Go 1.19 release yet for the FIPS-based images. + GO_VERSION: "1.18" rules: # When running in a fork of Gitaly we don't have the runners available, and # consequentially this job would fail anyway. So we configure the job to be diff --git a/.golangci.yml b/.golangci.yml index b96b5beeb..635fc2299 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -28,14 +28,17 @@ linters: - noctx - nolintlint - revive - - rowserrcheck - - sqlclosecheck - staticcheck - stylecheck - thelper - unconvert - unused - - wastedassign + # These linters don't currently support Go 1.18+. Please refer to + # https://github.com/golangci/golangci-lint/issues/2649 for further + # information. + #- rowserrcheck + #- sqlclosecheck + #- wastedassign linters-settings: depguard: diff --git a/.tool-versions b/.tool-versions index b502cd0ff..57145a95d 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ # Versions of Gitaly dependencies managed by asdf. -golang 1.18.7 +golang 1.19.2 1.18.7 ruby 2.7.5 @@ -55,7 +55,7 @@ GitLab.com, read about our [observability story](doc/observability.md)! Most users won't install Gitaly on its own. It is already included in [your GitLab installation](https://about.gitlab.com/install/). -Gitaly requires Go 1.18 and Ruby 2.7. Run `make` to download and +Gitaly requires Go 1.18 or Go 1.19 and Ruby 2.7. Run `make` to download and compile Ruby dependencies, and to compile the Gitaly Go executable. Gitaly uses `git`. Versions `2.37.0` and newer are supported. diff --git a/proto/go/gitalypb/conflicts.pb.go b/proto/go/gitalypb/conflicts.pb.go index 2aca35039..ef15a5008 100644 --- a/proto/go/gitalypb/conflicts.pb.go +++ b/proto/go/gitalypb/conflicts.pb.go @@ -191,6 +191,7 @@ type ConflictFile struct { unknownFields protoimpl.UnknownFields // Types that are assignable to ConflictFilePayload: + // // *ConflictFile_Header // *ConflictFile_Content ConflictFilePayload isConflictFile_ConflictFilePayload `protobuf_oneof:"conflict_file_payload"` @@ -455,6 +456,7 @@ type ResolveConflictsRequest struct { // requests must be FilesJson requests. // // Types that are assignable to ResolveConflictsRequestPayload: + // // *ResolveConflictsRequest_Header // *ResolveConflictsRequest_FilesJson ResolveConflictsRequestPayload isResolveConflictsRequest_ResolveConflictsRequestPayload `protobuf_oneof:"resolve_conflicts_request_payload"` diff --git a/proto/go/gitalypb/diff.pb.go b/proto/go/gitalypb/diff.pb.go index c1ab9d712..ad38fd178 100644 --- a/proto/go/gitalypb/diff.pb.go +++ b/proto/go/gitalypb/diff.pb.go @@ -1313,6 +1313,7 @@ type FindChangedPathsRequest_Request struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Type: + // // *FindChangedPathsRequest_Request_TreeRequest_ // *FindChangedPathsRequest_Request_CommitRequest_ Type isFindChangedPathsRequest_Request_Type `protobuf_oneof:"type"` diff --git a/proto/go/gitalypb/operations.pb.go b/proto/go/gitalypb/operations.pb.go index fb8715ee0..98569abe3 100644 --- a/proto/go/gitalypb/operations.pb.go +++ b/proto/go/gitalypb/operations.pb.go @@ -342,6 +342,7 @@ type UserCreateBranchError struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Error: + // // *UserCreateBranchError_CustomHook Error isUserCreateBranchError_Error `protobuf_oneof:"error"` } @@ -670,6 +671,7 @@ type UserDeleteBranchError struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Error: + // // *UserDeleteBranchError_AccessCheck // *UserDeleteBranchError_ReferenceUpdate // *UserDeleteBranchError_CustomHook @@ -1063,6 +1065,7 @@ type UserCreateTagError struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Error: + // // *UserCreateTagError_AccessCheck // *UserCreateTagError_ReferenceUpdate // *UserCreateTagError_CustomHook @@ -1348,6 +1351,7 @@ type UserMergeBranchError struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Error: + // // *UserMergeBranchError_AccessCheck // *UserMergeBranchError_ReferenceUpdate // *UserMergeBranchError_CustomHook @@ -2077,6 +2081,7 @@ type UserCherryPickError struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Error: + // // *UserCherryPickError_CherryPickConflict // *UserCherryPickError_TargetBranchDiverged // *UserCherryPickError_ChangesAlreadyApplied @@ -2416,12 +2421,12 @@ type UserCommitFilesActionHeader struct { Action UserCommitFilesActionHeader_ActionType `protobuf:"varint,1,opt,name=action,proto3,enum=gitaly.UserCommitFilesActionHeader_ActionType" json:"action,omitempty"` // file_path refers to the file or directory being modified. The meaning differs for each // action: - // 1. CREATE: path of the file to create - // 2. CREATE_DIR: path of the directory to create - // 3. UPDATE: path of the file to update - // 4. MOVE: the new path of the moved file - // 5. DELETE: path of the file to delete - // 6. CHMOD: path of the file to modify permissions for + // 1. CREATE: path of the file to create + // 2. CREATE_DIR: path of the directory to create + // 3. UPDATE: path of the file to update + // 4. MOVE: the new path of the moved file + // 5. DELETE: path of the file to delete + // 6. CHMOD: path of the file to modify permissions for FilePath []byte `protobuf:"bytes,2,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` // previous_path is used in MOVE action to specify the path of the file to move. PreviousPath []byte `protobuf:"bytes,3,opt,name=previous_path,json=previousPath,proto3" json:"previous_path,omitempty"` @@ -2519,6 +2524,7 @@ type UserCommitFilesAction struct { unknownFields protoimpl.UnknownFields // Types that are assignable to UserCommitFilesActionPayload: + // // *UserCommitFilesAction_Header // *UserCommitFilesAction_Content UserCommitFilesActionPayload isUserCommitFilesAction_UserCommitFilesActionPayload `protobuf_oneof:"user_commit_files_action_payload"` @@ -2752,6 +2758,7 @@ type UserCommitFilesRequest struct { unknownFields protoimpl.UnknownFields // Types that are assignable to UserCommitFilesRequestPayload: + // // *UserCommitFilesRequest_Header // *UserCommitFilesRequest_Action UserCommitFilesRequestPayload isUserCommitFilesRequest_UserCommitFilesRequestPayload `protobuf_oneof:"user_commit_files_request_payload"` @@ -2905,6 +2912,7 @@ type UserCommitFilesError struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Error: + // // *UserCommitFilesError_AccessCheck // *UserCommitFilesError_IndexUpdate // *UserCommitFilesError_CustomHook @@ -3005,6 +3013,7 @@ type UserRebaseConfirmableRequest struct { unknownFields protoimpl.UnknownFields // Types that are assignable to UserRebaseConfirmableRequestPayload: + // // *UserRebaseConfirmableRequest_Header_ // *UserRebaseConfirmableRequest_Apply UserRebaseConfirmableRequestPayload isUserRebaseConfirmableRequest_UserRebaseConfirmableRequestPayload `protobuf_oneof:"user_rebase_confirmable_request_payload"` @@ -3092,6 +3101,7 @@ type UserRebaseConfirmableResponse struct { unknownFields protoimpl.UnknownFields // Types that are assignable to UserRebaseConfirmableResponsePayload: + // // *UserRebaseConfirmableResponse_RebaseSha // *UserRebaseConfirmableResponse_RebaseApplied UserRebaseConfirmableResponsePayload isUserRebaseConfirmableResponse_UserRebaseConfirmableResponsePayload `protobuf_oneof:"user_rebase_confirmable_response_payload"` @@ -3354,6 +3364,7 @@ type UserRebaseConfirmableError struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Error: + // // *UserRebaseConfirmableError_RebaseConflict // *UserRebaseConfirmableError_AccessCheck Error isUserRebaseConfirmableError_Error `protobuf_oneof:"error"` @@ -3441,6 +3452,7 @@ type UserSquashError struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Error: + // // *UserSquashError_ResolveRevision // *UserSquashError_RebaseConflict Error isUserSquashError_Error `protobuf_oneof:"error"` @@ -3526,6 +3538,7 @@ type UserApplyPatchRequest struct { unknownFields protoimpl.UnknownFields // Types that are assignable to UserApplyPatchRequestPayload: + // // *UserApplyPatchRequest_Header_ // *UserApplyPatchRequest_Patches UserApplyPatchRequestPayload isUserApplyPatchRequest_UserApplyPatchRequestPayload `protobuf_oneof:"user_apply_patch_request_payload"` diff --git a/proto/go/gitalypb/operations_grpc.pb.go b/proto/go/gitalypb/operations_grpc.pb.go index d85789d8a..33ad54215 100644 --- a/proto/go/gitalypb/operations_grpc.pb.go +++ b/proto/go/gitalypb/operations_grpc.pb.go @@ -30,16 +30,16 @@ type OperationServiceClient interface { // hooks and contacts Rails to verify that the user is indeed allowed to delete that branch. The // following known error conditions may happen: // - // - Returns `InvalidArgument` in case either the branch name or user are not set. - // - Returns `FailedPrecondition` in case the branch does not exist. - // - Returns `OK` with a `PreReceiveError` in case custom hooks refused the update. If the - // `gitaly_user_delete_branch_structured_errors` feature flag is enabled this error case will - // instead return `PermissionDenied` with either a `CustomHook` or AccessCheck` structured - // error. - // - Returns `FailedPrecondition` in case updating the reference fails because - // of a concurrent write to the same reference. If the - // `gitaly_user_delete_branch_structured_errors` feature flag is set this error case will - // instead return `FailedPrecondition` with a `ReferenceUpdate` structured error. + // - Returns `InvalidArgument` in case either the branch name or user are not set. + // - Returns `FailedPrecondition` in case the branch does not exist. + // - Returns `OK` with a `PreReceiveError` in case custom hooks refused the update. If the + // `gitaly_user_delete_branch_structured_errors` feature flag is enabled this error case will + // instead return `PermissionDenied` with either a `CustomHook` or AccessCheck` structured + // error. + // - Returns `FailedPrecondition` in case updating the reference fails because + // of a concurrent write to the same reference. If the + // `gitaly_user_delete_branch_structured_errors` feature flag is set this error case will + // instead return `FailedPrecondition` with a `ReferenceUpdate` structured error. UserDeleteBranch(ctx context.Context, in *UserDeleteBranchRequest, opts ...grpc.CallOption) (*UserDeleteBranchResponse, error) // UserCreateTag creates a new tag. This RPC knows to create both lightweight and annotated tags // depending on whether a message is set. @@ -346,16 +346,16 @@ type OperationServiceServer interface { // hooks and contacts Rails to verify that the user is indeed allowed to delete that branch. The // following known error conditions may happen: // - // - Returns `InvalidArgument` in case either the branch name or user are not set. - // - Returns `FailedPrecondition` in case the branch does not exist. - // - Returns `OK` with a `PreReceiveError` in case custom hooks refused the update. If the - // `gitaly_user_delete_branch_structured_errors` feature flag is enabled this error case will - // instead return `PermissionDenied` with either a `CustomHook` or AccessCheck` structured - // error. - // - Returns `FailedPrecondition` in case updating the reference fails because - // of a concurrent write to the same reference. If the - // `gitaly_user_delete_branch_structured_errors` feature flag is set this error case will - // instead return `FailedPrecondition` with a `ReferenceUpdate` structured error. + // - Returns `InvalidArgument` in case either the branch name or user are not set. + // - Returns `FailedPrecondition` in case the branch does not exist. + // - Returns `OK` with a `PreReceiveError` in case custom hooks refused the update. If the + // `gitaly_user_delete_branch_structured_errors` feature flag is enabled this error case will + // instead return `PermissionDenied` with either a `CustomHook` or AccessCheck` structured + // error. + // - Returns `FailedPrecondition` in case updating the reference fails because + // of a concurrent write to the same reference. If the + // `gitaly_user_delete_branch_structured_errors` feature flag is set this error case will + // instead return `FailedPrecondition` with a `ReferenceUpdate` structured error. UserDeleteBranch(context.Context, *UserDeleteBranchRequest) (*UserDeleteBranchResponse, error) // UserCreateTag creates a new tag. This RPC knows to create both lightweight and annotated tags // depending on whether a message is set. diff --git a/proto/go/gitalypb/praefect.pb.go b/proto/go/gitalypb/praefect.pb.go index 3326d5b57..ef98874ce 100644 --- a/proto/go/gitalypb/praefect.pb.go +++ b/proto/go/gitalypb/praefect.pb.go @@ -30,6 +30,7 @@ type MarkUnverifiedRequest struct { // selector specifies the replicas which to mark unverified. // // Types that are assignable to Selector: + // // *MarkUnverifiedRequest_RepositoryId // *MarkUnverifiedRequest_VirtualStorage // *MarkUnverifiedRequest_Storage_ @@ -178,6 +179,7 @@ type GetRepositoryMetadataRequest struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Query: + // // *GetRepositoryMetadataRequest_RepositoryId // *GetRepositoryMetadataRequest_Path_ Query isGetRepositoryMetadataRequest_Query `protobuf_oneof:"query"` diff --git a/proto/go/gitalypb/ref.pb.go b/proto/go/gitalypb/ref.pb.go index c17d820ed..508fce608 100644 --- a/proto/go/gitalypb/ref.pb.go +++ b/proto/go/gitalypb/ref.pb.go @@ -1072,6 +1072,7 @@ type FindTagError struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Error: + // // *FindTagError_TagNotFound Error isFindTagError_Error `protobuf_oneof:"error"` } @@ -1811,6 +1812,7 @@ type DeleteRefsError struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Error: + // // *DeleteRefsError_InvalidFormat // *DeleteRefsError_ReferencesLocked Error isDeleteRefsError_Error `protobuf_oneof:"error"` diff --git a/proto/go/gitalypb/repository.pb.go b/proto/go/gitalypb/repository.pb.go index 71e08335f..145965686 100644 --- a/proto/go/gitalypb/repository.pb.go +++ b/proto/go/gitalypb/repository.pb.go @@ -4051,12 +4051,12 @@ type Remote struct { // mirror_refmaps contains the refspecs which shall be fetched. Some special // refspecs are accepted: // - // - "all_refs" gets translated to "+refs/*:refs/*", which mirrors all - // references of the source repository. - // - "heads" gets translated to "+refs/heads/*:refs/heads/*", which mirrors - // all branches of the source repository. - // - "tags" gets translated to "+refs/tags/*:refs/tags/*", which mirrors all - // tags of the source repository. + // - "all_refs" gets translated to "+refs/*:refs/*", which mirrors all + // references of the source repository. + // - "heads" gets translated to "+refs/heads/*:refs/heads/*", which mirrors + // all branches of the source repository. + // - "tags" gets translated to "+refs/tags/*:refs/tags/*", which mirrors all + // tags of the source repository. // // If no refspecs are given, this defaults to "all_refs". MirrorRefmaps []string `protobuf:"bytes,4,rep,name=mirror_refmaps,json=mirrorRefmaps,proto3" json:"mirror_refmaps,omitempty"` diff --git a/proto/go/gitalypb/server.pb.go b/proto/go/gitalypb/server.pb.go index 0b3e932de..3ed8b84fd 100644 --- a/proto/go/gitalypb/server.pb.go +++ b/proto/go/gitalypb/server.pb.go @@ -380,6 +380,7 @@ type ReadinessCheckResponse struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Result: + // // *ReadinessCheckResponse_OkResponse // *ReadinessCheckResponse_FailureResponse Result isReadinessCheckResponse_Result `protobuf_oneof:"Result"` diff --git a/proto/go/gitalypb/transaction_grpc.pb.go b/proto/go/gitalypb/transaction_grpc.pb.go index 5664e70d8..5d9f9f299 100644 --- a/proto/go/gitalypb/transaction_grpc.pb.go +++ b/proto/go/gitalypb/transaction_grpc.pb.go @@ -29,9 +29,9 @@ type RefTransactionClient interface { // // This RPC may return one of the following error codes: // - // - `NotFound` in case the transaction could not be found. - // - `Canceled` in case the transaction has been canceled before quorum was - // reached. + // - `NotFound` in case the transaction could not be found. + // - `Canceled` in case the transaction has been canceled before quorum was + // reached. VoteTransaction(ctx context.Context, in *VoteTransactionRequest, opts ...grpc.CallOption) (*VoteTransactionResponse, error) // StopTransaction gracefully stops a transaction. This RPC can be used if // only a subset of nodes executes specific code which may cause the @@ -41,9 +41,9 @@ type RefTransactionClient interface { // // This RPC may return one of the following error codes: // - // - `NotFound` in case the transaction could not be found. - // - `Canceled` in case the transaction has been canceled before quorum was - // reached. + // - `NotFound` in case the transaction could not be found. + // - `Canceled` in case the transaction has been canceled before quorum was + // reached. StopTransaction(ctx context.Context, in *StopTransactionRequest, opts ...grpc.CallOption) (*StopTransactionResponse, error) } @@ -84,9 +84,9 @@ type RefTransactionServer interface { // // This RPC may return one of the following error codes: // - // - `NotFound` in case the transaction could not be found. - // - `Canceled` in case the transaction has been canceled before quorum was - // reached. + // - `NotFound` in case the transaction could not be found. + // - `Canceled` in case the transaction has been canceled before quorum was + // reached. VoteTransaction(context.Context, *VoteTransactionRequest) (*VoteTransactionResponse, error) // StopTransaction gracefully stops a transaction. This RPC can be used if // only a subset of nodes executes specific code which may cause the @@ -96,9 +96,9 @@ type RefTransactionServer interface { // // This RPC may return one of the following error codes: // - // - `NotFound` in case the transaction could not be found. - // - `Canceled` in case the transaction has been canceled before quorum was - // reached. + // - `NotFound` in case the transaction could not be found. + // - `Canceled` in case the transaction has been canceled before quorum was + // reached. StopTransaction(context.Context, *StopTransactionRequest) (*StopTransactionResponse, error) mustEmbedUnimplementedRefTransactionServer() } |