diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-05-11 10:08:39 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-05-11 10:08:39 +0300 |
commit | 5200cc5b7bb1dc10738166b1be783e38acd98812 (patch) | |
tree | 938566eabe05a4cf7e885d873af9a15329cdd3d8 | |
parent | 60a7383d965aa6a8e69aa2e33a84792cde486cd3 (diff) | |
parent | ca71bbd189a528700f4583ee621b36bbb2b89ec7 (diff) |
Merge branch 'pks-proto-style-update' into 'master'
proto: Update documentation and modernize our style guide
See merge request gitlab-org/gitaly!4539
-rw-r--r-- | .editorconfig | 1 | ||||
-rw-r--r-- | doc/PROCESS.md | 16 | ||||
-rw-r--r-- | doc/protobuf.md | 391 | ||||
-rw-r--r-- | proto/.protolint.yaml | 11 | ||||
-rw-r--r-- | proto/CONTRIBUTING.md | 12 | ||||
-rw-r--r-- | proto/DEPRECATION.md | 16 | ||||
-rw-r--r-- | proto/README.md | 337 | ||||
-rw-r--r-- | proto/commit.proto | 38 | ||||
-rw-r--r-- | proto/diff.proto | 14 | ||||
-rw-r--r-- | proto/go/gitalypb/commit.pb.go | 38 | ||||
-rw-r--r-- | proto/go/gitalypb/diff.pb.go | 14 | ||||
-rw-r--r-- | proto/go/gitalypb/hook.pb.go | 6 | ||||
-rw-r--r-- | proto/go/gitalypb/lint.pb.go | 12 | ||||
-rw-r--r-- | proto/go/gitalypb/operations.pb.go | 24 | ||||
-rw-r--r-- | proto/go/gitalypb/ref.pb.go | 26 | ||||
-rw-r--r-- | proto/go/gitalypb/repository.pb.go | 24 | ||||
-rw-r--r-- | proto/go/gitalypb/shared.pb.go | 22 | ||||
-rw-r--r-- | proto/go/gitalypb/transaction.pb.go | 12 | ||||
-rw-r--r-- | proto/go/gitalypb/wiki.pb.go | 8 | ||||
-rw-r--r-- | proto/hook.proto | 6 | ||||
-rw-r--r-- | proto/lint.proto | 12 | ||||
-rw-r--r-- | proto/operations.proto | 24 | ||||
-rw-r--r-- | proto/ref.proto | 26 | ||||
-rw-r--r-- | proto/repository.proto | 24 | ||||
-rw-r--r-- | proto/shared.proto | 22 | ||||
-rw-r--r-- | proto/transaction.proto | 12 | ||||
-rw-r--r-- | proto/wiki.proto | 8 |
27 files changed, 597 insertions, 559 deletions
diff --git a/.editorconfig b/.editorconfig index 9a7c5bb71..c8f2af68c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -24,6 +24,7 @@ max_line_length = 80 [**.proto] indent_style = space indent_size = 2 +max_line_length = 100 [**.rb] indent_size = 2 diff --git a/doc/PROCESS.md b/doc/PROCESS.md index 79a78e4c5..ef1a571fb 100644 --- a/doc/PROCESS.md +++ b/doc/PROCESS.md @@ -519,3 +519,19 @@ if you add patches to Gitaly's Makefile, you cannot assume that installations will always have these patches. As a result, all code which makes use of patched-in features must have fallback code to support the [minimum required Git version](../README.md#installation) + +### RPC deprecation process + +First create a deprecation issue at https://gitlab.com/gitlab-org/gitaly/issues +with the title `Deprecate RPC FooBar`. Use label `Deprecation`. Below is a +template for the issue description. + +``` +We are deprecating RPC FooBar because **REASONS**. + +- [ ] put a deprecation comment `// DEPRECATED: <ISSUE-LINK>` in ./proto **Merge Request LINK** +- [ ] find all client-side uses of RPC and list below +- [ ] update all client-side uses to no longer use RPC **ADD Merge Request LINKS** +- [ ] wait for a GitLab release in which the RPC is no longer occurring in client side code **LINK TO GITLAB-CE RELEASE TAG** +- [ ] delete the server side implementation of the old RPC in https://gitlab.com/gitlab-org/gitaly **Merge Request LINK** +``` diff --git a/doc/protobuf.md b/doc/protobuf.md new file mode 100644 index 000000000..f7e188323 --- /dev/null +++ b/doc/protobuf.md @@ -0,0 +1,391 @@ +# Protobuf specifications and client libraries for Gitaly + +Gitaly is part of GitLab. It is a [server +application](https://gitlab.com/gitlab-org/gitaly) that uses its own +gRPC protocol to communicate with its clients. This repository +contains the protocol definition and automatically generated wrapper +code for Go and Ruby. + +The `.proto` files define the remote procedure calls for interacting +with Gitaly. We keep auto-generated client libraries for Ruby and Go +in their respective subdirectories. The list of RPCs can be +[found here](https://gitlab-org.gitlab.io/gitaly-proto/). + +Run `make proto` from the root of the repository to regenerate the client +libraries after updating .proto files. + +See +[developers.google.com](https://developers.google.com/protocol-buffers/docs/proto3) +for documentation of the 'proto3' Protocol buffer specification +language. + +## gRPC/Protobuf concepts + +The core Protobuf concepts we use are rpc, service and message. We use +these to define the Gitaly **protocol**. + +- **rpc** a function that can be called from the client and that gets + executed on the server. Belongs to a service. Can have one of four + request/response signatures: message/message (example: get metadata for + commit xxx), message/stream (example: get contents of blob xxx), + stream/message (example: create new blob with contents xxx), + stream/stream (example: git SSH session). +- **service** a logical group of RPC's. +- **message** like a JSON object except it has pre-defined types. +- **stream** an unbounded sequence of messages. In the Ruby clients + this looks like an Enumerator. + +gRPC provides an implementation framework based on these Protobuf concepts. + +- A gRPC **server** implements one or more services behind a network + listener. Example: the Gitaly server application. +- The gRPC toolchain automatically generates **client libraries** that + handle serialization and connection management. Example: the Go + client package and Ruby gem in this repository. +- gRPC **clients** use the client libraries to make remote procedure + calls. These clients must decide what network address to reach their + gRPC servers on and handle connection reuse: it is possible to + spread different gRPC services over multiple connections to the same + gRPC server. +- Officially a gRPC connection is called a **channel**. In the Go gRPC + library these channels are called **client connections** because + 'channel' is already a concept in Go itself. In Ruby a gRPC channel + is an instance of GRPC::Core::Channel. We use the word 'connection' + in this document. The underlying transport of gRPC, HTTP/2, allows + multiple remote procedure calls to happen at the same time on a + single connection to a gRPC server. In principle, a multi-threaded + gRPC client needs only one connection to a gRPC server. + +## Gitaly RPC Server Architecture + +Gitaly consists of two different server applications which implement services: + +- Gitaly hosts all the logic required to access and modify Git repositories. + This is the place where actual repositories reside and where the Git commands + get executed. + +- Praefect is a transparent proxy that routes requests to one or more Gitaly + nodes. This server allows for load-balancing and high availability by keeping + multiple Gitaly nodes up-to-date with the same data. + +Gitaly clients either interact with Praefect or with a single Gitaly server. For +most of the part the client does not need to know which of both types of servers +it is currently interacting with: Praefect transparently proxies requests to +Gitaly servers so that it behaves the same as a standalone Gitaly server. + +Servers can be sharded for larger installations so that only a subset of data is +stored on each of the Gitaly servers. + +## Design + +### RPC definitions + +Each RPC `FooBar` has its own `FooBarRequest` and `FooBarResponse` message +types. Try to keep the structure of these messages as flat as possible. Only add +abstractions when they have a practical benefit. + +We never make backwards incompatible changes to an RPC that is already +implemented on either the client side or server side. Instead we just create a +new RPC call and start a deprecation procedure (see below) for the old one. + +### Comments + +Services, RPCs, messages and their fields declared in `.proto` files must have +comments. This documentation must be sufficient to let potential callers figure +out why this RPC exists and what the behaviour of an RPC is without looking up +its implementation. Special error cases should be documented. + +### Errors + +Gitaly uses [error codes](https://pkg.go.dev/google.golang.org/grpc/codes) to +indicate basic error classes. In case error codes are not sufficient for clients +to make specific error cases actionable, Gitaly uses the [rich error +model](https://www.grpc.io/docs/guides/error/#richer-error-model) provided by +gRPC. With this error model, Gitaly can embed Protobuf messages into returned +errors and thus provide exact information about error conditions to the client. +In case the RPC needs to use the rich error model, it should have its own +`FooBarError` message type. + +RPCs must return an error if the action failed. It is disallowed to return +specific error cases via the RPC's normal response. This is required so that +Praefect can correctly handle any such errors. + +### RPC concepts + +RPCs should not be focussed on a single usecase only, but instead they should be +implemented with the underlying Git concept in mind. If they directly map to the +way Git handles specific data instead of directly mapping to the usecase at +hand, then chances are high that the RPC will be reusable for other, yet-unknown +usecases. + +Common concepts that can be considered: + +- Accept revisions as documented in gitrevisions(5) instead of object IDs or + references. If possible, accept an array of revisions instead of a single + revision only so that callers can easily specify revision ranges without + requiring a separate RPC. Furthermore, accept pseudo-revisions like `--not` + and `--all`. +- Accept fully-qualified references instead of branch names. This avoids issues + with ambiguity and makes it possible to use RPCs for references which are not + branches. + +### RPC naming conventions + +Gitaly has RPCs that are resource based, for example when querying for a commit. +Another class of RPCs are operations, where the result might be empty or one of +the RPC error codes but the fact that the operation took place is of importance. + +For all RPCs, start the name with a verb, followed by an entity, and if required +followed by a further specification. For example: + +- ListCommits +- RepackRepositoryIncremental +- CreateRepositoryFromBundle + +For resource RPCs the verbs in use are limited to: + +- Get +- List +- Is +- Create +- Update +- Delete + +Get and List as verbs denote these operations have no side effects. These verbs +differ in terms of the expected number of results the query yields. Get queries +are limited to one result, and are expected to return one result to the client. +List queries have zero or more results, and generally will create a gRPC stream +for their results. + +When the `Is` verb is used, this RPC is expected to return a boolean, or an +error. For example: `IsRepositoryEmpty`. + +When an operation-based RPC is defined, the verb should map to the first verb in +the Git command it represents, e.g. `FetchRemote`. + +Note that large parts of the current Gitaly RPC interface do not abide fully to +these conventions. Newly defined RPCs should, though, so eventually the +interface converges to a common standard. + +### Common field names and types + +As a general principle, remember that Git does not enforce encodings on most +data inside repositories, so we can rarely assume data to be a Protobuf "string" +(which implies UTF-8). + +1. `bytes revision`: for fields that accept any of branch names / tag + names / commit ID's. Uses `bytes` to be encoding agnostic. +2. `string commit_id`: for fields that accept a commit ID. +3. `bytes ref`: for fields that accept a refname. +4. `bytes path`: for paths inside Git repositories, i.e., inside Git + `tree` objects. +5. `string relative_path`: for paths on disk on a Gitaly server, + created by "us" (GitLab the application) instead of the user, we + want to use UTF-8, or better, ASCII. + +### Stream patterns + +Protobuf suppports streaming RPCs which allow for multiple request or response +messages to be sent in a single RPC call. We use these whenever it is expected +that an RPC may be invoked with lots of input parameters or when it may generate +a lot of data. This is required by limitations in the gRPC framework where +messages should not typically be larger than 1MB. + +#### Stream response of many small items + +``` +rpc FooBar(FooBarRequest) returns (stream FooBarResponse); + +message FooBarResponse { + message Item { + // ... + } + repeated Item items = 1; +} +``` + +A typical example of an "Item" would be a commit. To avoid the penalty of +network IO for each Item we return, we batch them together. You can think of +this as a kind of buffered IO at the level of the Item messages. In Go, to ease +the bookkeeping you can use +[gitlab.com/gitlab-org/gitaly/internal/helper/chunker](https://godoc.org/gitlab.com/gitlab-org/gitaly/internal/helper/chunker). + +#### Single large item split over multiple messages + +``` +rpc FooBar(FooBarRequest) returns (stream FooBarResponse); + +message FooBarResponse { + message Header { + // ... + } + + oneof payload { + Header header = 1; + bytes data = 2; + } +} +``` + +A typical example of a large item would be the contents of a Git blob. The +header might contain the blob OID and the blob size. Only the first message in +the response stream has `header` set, all others have `data` but no `header`. + +In the particular case where you're sending back raw binary data from Go, you +can use +[gitlab.com/gitlab-org/gitaly/streamio](https://godoc.org/gitlab.com/gitlab-org/gitaly/streamio) +to turn your gRPC response stream into an `io.Writer`. + +> Note that a number of existing RPC's do not use this pattern exactly; +> they don't use `oneof`. In practice this creates ambiguity (does the +> first message contain non-empty `data`?) and encourages complex +> optimization in the server implementation (trying to squeeze data into +> the first response message). Using `oneof` avoids this ambiguity. + +#### Many large items split over multiple messages + +``` +rpc FooBar(FooBarRequest) returns (stream FooBarResponse); + +message FooBarResponse { + message Header { + // ... + } + + oneof payload { + Header header = 1; + bytes data = 2; + } +} +``` + +This looks the same as the "single large item" case above, except whenever a new +large item begins, we send a new message with a non-empty `header` field. + +#### Footers + +If the RPC requires it we can also send a footer using `oneof`. But by default, +we prefer headers. + +### RPC Annotations + +Gitaly Cluster needs to know about the nature of RPCs in order to decide how a +specific request needs to be routed: + +- Accessors may be routed to any one Gitaly node which has an up-to-date + repository to allow for load-balancing reads. These RPCs must not have any + side effects. +- Mutators will be routed to all Gitaly nodes which have an up-to-date + repository so that changes are performed on all nodes at once. Each node is + expected to cast transactional votes so that the actual data that is written + to disk is verified to be the same for all of them. +- Maintenance RPCs are not deemed mission critical. They are routed on a + best-effort basis to all online nodes which have a specific repository. + +To classify RPCs, each declaration must contain one of the following lines: + +- `option (op_type).op = ACCESSOR;` +- `option (op_type).op = MUTATOR;` +- `option (op_type).op = MAINTENANCE;` + +We use a custom `protoc` plugin to verify that all RPCs do in fact have such a +declaration. This plugin can be executed via `make lint-proto`. + +Additionally, all mutator RPCs require additional annotations to clearly +indicate what is being modified: + +- Server-scoped RPCs modify server-wide resources. +- Storage-scoped RPCs modify data in a specific storage. +- Repository-scoped RPCs modify data in a specific repository. + +To declare the scope, mutators must contain one of the following lines: + +- `option(op_type).scope = SERVER;` +- `option(op_type).scope = STORAGE;`: The associated request must have a field + tagged with `[(storage)=true]` that indicates the storage's name. +- `option(op_type).scope = REPOSITORY;`: This is the default scoped and thus + doesn't need to be explicitly declared. The associated request must have a + field tagged with `[(target_repository)=true]` that indcates the repository's + location. + +The target repository represents the location or address of the repository being +modified by the operation. This is needed by Praefect (Gitaly Cluster) in order +to properly schedule replications to keep repository replicas up to date. + +The target repository annotation marks where the target repository can be found +in the message. The annotation is added near `gitaly.Repository` field (e.g. +`Repository repository = 1 [(target_repository)=true];`). If annotated field +isn't `gitaly.Repository` type then it has to contain field annotated +`[(repository)=true]` with correct type. Having separate `repository` annotation +allows to have same field in child message annotated as both `target_repository` +and `additional_repository` depending on parent message. + +The additional repository is annotated similarly to target repository but +annotation is named `additional_repository`. + +See our examples of [valid](go/internal/cmd/protoc-gen-gitaly-lint/testdata/valid.proto) and +[invalid](go/internal/cmd/protoc-gen-gitaly-lint/invalid.proto) proto annotations. + +### Transactions and Atomicity + +With Gitaly Cluster, mutating RPCs will get routed to multiple Gitaly nodes at +once. Each node must then vote on the changes it intends to perform, and only if +quorum was reached on the change should it be persisted to disk. For this to +work correctly, all mutating RPCs need to follow a set of rules: + +- Every mutator needs to vote at least twice on the data it is about to write: a + first preparatory vote must happen before data is visible to the user so that + data can be discarded in case nodes disagree without any impact on the + repository itself. And a second committing vote must happen to let Praefect + know that changes have indeed been committed to disk. +- In the general case, the vote should be computed from all data that is to be + written. +- Changes should be atomic: either all changes are persisted to disk or none + are. +- The number of transactional votes should be kept at a minimum and should not + scale with the number of changes performed. Every vote incurs costs, which may + become prohibitively expensive in case a vote is executed per change. +- Mutators must return an error in case anything unexpected happens. This error + needs to be deterministic so that Praefect can assert that a failing RPC call + has failed in the same way across nodes. + +### Go Package + +All Protobuf files hosted in the Gitaly project must have their Go package +declared. This is done via the `go_package` option: + +`option go_package = "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb";` + +This allows other protobuf files to locate and import the Go generated stubs. + +## Contributing + +The CI at https://gitlab.com/gitlab-org/gitaly-proto regenerates the +client libraries to guard against the mistake of updating the .proto +files but not the client libraries. This check uses `git diff` to look +for changes. Some of the code in the Go client libraries is sensitive +to implementation details of the Go standard library (specifically, +the output of gzip). **Use the same Go version as .gitlab-ci.yml (Go +1.13)** when generating new client libraries for a merge request. + +[DCO + License](CONTRIBUTING.md) + +## Workflows + +### Generating Protobuf sources + +After you change or add a .proto file you need to re-generate the Go and Ruby +libraries before committing your change. + +```shell +# Re-generate Go and Ruby libraries +make proto +``` + +### Deprecating an RPC call + +See [PROCESS.md](PROCESS.md#rpc-deprecation-process). + +## Releasing Protobuf definitions + +See [PROCESS.md](PROCESS.md#publishing-the-ruby-gem). diff --git a/proto/.protolint.yaml b/proto/.protolint.yaml index a2d94785d..1a53539c0 100644 --- a/proto/.protolint.yaml +++ b/proto/.protolint.yaml @@ -3,16 +3,11 @@ lint: rules: all_default: true remove: - # Our use of enums isn't conforming to best practices, and it's hard to - # change retroactively. We may eventually enable these linters and then - # create exceptions for preexisting definitions. - - ENUM_FIELD_NAMES_PREFIX - - ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH # We don't specify any line length limits. - MAX_LINE_LENGTH - # Many of our definitions aren't commented at all. We want to eventually - # opt-in to enable these linting warnings, but right now we just want to - # get protolint included in our workflow with minimal required changes. + # We do not put comments in front of files. We already document services, + # and only have a single service per file, so there is not much of a + # point anyway. - FILE_HAS_COMMENT # Many of our fields and messages have prepositions in them, and # furthermore this rule doesn't feel all that sensible after all. We thus diff --git a/proto/CONTRIBUTING.md b/proto/CONTRIBUTING.md deleted file mode 100644 index 442c2b00c..000000000 --- a/proto/CONTRIBUTING.md +++ /dev/null @@ -1,12 +0,0 @@ -## Developer Certificate of Origin + License - -By contributing to GitLab B.V., You accept and agree to the following terms and -conditions for Your present and future Contributions submitted to GitLab B.V. -Except for the license granted herein to GitLab B.V. and recipients of software -distributed by GitLab B.V., You reserve all right, title, and interest in and to -Your Contributions. All Contributions are subject to the following DCO + License -terms. - -[DCO + License](https://gitlab.com/gitlab-org/dco/blob/master/README.md) - -_This notice should stay as the first item in the CONTRIBUTING.md file._ diff --git a/proto/DEPRECATION.md b/proto/DEPRECATION.md deleted file mode 100644 index 18bd0b44e..000000000 --- a/proto/DEPRECATION.md +++ /dev/null @@ -1,16 +0,0 @@ -# RPC deprecation process for gitaly-proto - -First create a deprecation issue at -https://gitlab.com/gitlab-org/gitaly/issues with the title `Deprecate -RPC FooBar`. Use label `Deprecation`. Below is a template for the -issue description. - -``` -We are deprecating RPC FooBar because **REASONS**. - -- [ ] put a deprecation comment `// DEPRECATED: <ISSUE-LINK>` in ./proto **Merge Request LINK** -- [ ] find all client-side uses of RPC and list below -- [ ] update all client-side uses to no longer use RPC **ADD Merge Request LINKS** -- [ ] wait for a GitLab release in which the RPC is no longer occurring in client side code **LINK TO GITLAB-CE RELEASE TAG** -- [ ] delete the server side implementation of the old RPC in https://gitlab.com/gitlab-org/gitaly **Merge Request LINK** -``` diff --git a/proto/README.md b/proto/README.md deleted file mode 100644 index 3fd40b5fc..000000000 --- a/proto/README.md +++ /dev/null @@ -1,337 +0,0 @@ -# Protobuf specifications and client libraries for Gitaly - -> This directory was previously hosted at https://gitlab.com/gitlab-org/gitaly-proto. As of Gitaly 1.58.0 and gitaly-proto 1.39.0, all further proto changes will be made here, in `gitaly/proto`. - -Gitaly is part of GitLab. It is a [server -application](https://gitlab.com/gitlab-org/gitaly) that uses its own -gRPC protocol to communicate with its clients. This repository -contains the protocol definition and automatically generated wrapper -code for Go and Ruby. - -The `.proto` files define the remote procedure calls for interacting -with Gitaly. We keep auto-generated client libraries for Ruby and Go -in their respective subdirectories. The list of RPCs can be -[found here](https://gitlab-org.gitlab.io/gitaly-proto/). - -Run `make proto` from the root of the repository to regenerate the client -libraries after updating .proto files. - -See -[developers.google.com](https://developers.google.com/protocol-buffers/docs/proto3) -for documentation of the 'proto3' Protocol buffer specification -language. - -## Issues - -We have disabled the issue tracker of the gitaly-proto project. Please use the -[Gitaly issue tracker](https://gitlab.com/gitlab-org/gitaly/issues). - -## gRPC/Protobuf concepts - -The core Protobuf concepts we use are rpc, service and message. We use -these to define the Gitaly **protocol**. - -- **rpc** a function that can be called from the client and that gets - executed on the server. Belongs to a service. Can have one of four - request/response signatures: message/message (example: get metadata for - commit xxx), message/stream (example: get contents of blob xxx), - stream/message (example: create new blob with contents xxx), - stream/stream (example: git SSH session). -- **service** a logical group of RPC's. -- **message** like a JSON object except it has pre-defined types. -- **stream** an unbounded sequence of messages. In the Ruby clients - this looks like an Enumerator. - -gRPC provides an implementation framework based on these Protobuf concepts. - -- A gRPC **server** implements one or more services behind a network - listener. Example: the Gitaly server application. -- The gRPC toolchain automatically generates **client libraries** that - handle serialization and connection management. Example: the Go - client package and Ruby gem in this repository. -- gRPC **clients** use the client libraries to make remote procedure - calls. These clients must decide what network address to reach their - gRPC servers on and handle connection reuse: it is possible to - spread different gRPC services over multiple connections to the same - gRPC server. -- Officially a gRPC connection is called a **channel**. In the Go gRPC - library these channels are called **client connections** because - 'channel' is already a concept in Go itself. In Ruby a gRPC channel - is an instance of GRPC::Core::Channel. We use the word 'connection' - in this document. The underlying transport of gRPC, HTTP/2, allows - multiple remote procedure calls to happen at the same time on a - single connection to a gRPC server. In principle, a multi-threaded - gRPC client needs only one connection to a gRPC server. - -## Design decisions - -1. In Gitaly's case there is one server application - https://gitlab.com/gitlab-org/gitaly which implements all services - in the protocol. -1. In default GitLab installations each Gitaly client interacts with - exactly 1 Gitaly server, on the same host, via a Unix domain socket. - In a larger installation each Gitaly client will interact with many - different Gitaly servers (one per GitLab storage shard) via TCP - connections. -1. Gitaly uses - [grpc.Errorf](https://godoc.org/google.golang.org/grpc#Errorf) to - return meaningful - [errors](https://godoc.org/google.golang.org/grpc/codes#Code) to its - clients. -1. Each RPC `FooBar` has its own `FooBarRequest` and `FooBarResponse` - message types. Try to keep the structure of these messages as flat as - possible. Only add abstractions when they have a practical benefit. -1. We never make backwards incompatible changes to an RPC that is - already implemented on either the client side or server side. - Instead we just create a new RPC call and start a deprecation - procedure (see below) for the old one. -1. It is encouraged to put comments (starting with `//`) in .proto files. - Please put comments on their own lines. This will cause them to be - treated as documentation by the protoc compiler. -1. When choosing an RPC name don't use the service name as context. - Good: `service CommitService { rpc CommitExists }`. Bad: - `service CommitService { rpc Exists }`. - -### RPC naming conventions - -Gitaly-Proto has RPCs that are resource based, for example when querying for a -commit. Another class of RPCs are operations, where the result might be empty -or one of the RPC error codes but the fact that the operation took place is -of importance. - -For all RPCs, start the name with a verb, followed by an entity, and if required -followed by a further specification. For example: -- GetCommit -- RepackRepositoryIncremental -- CreateRepositoryFromBundle - -For resource RPCs the verbs in use are limited to: Get, List, Create, Update, -Delete, or Is. Where both Get and List as verbs denote these operations have no side -effects. These verbs differ in terms of the expected number of results the query -yields. Get queries are limited to one result, and are expected to return one -result to the client. List queries have zero or more results, and generally will -create a gRPC stream for their results. When the `Is` verb is used, this RPC -is expected to return a boolean, or an error. For example: `IsRepositoryEmpty`. - - -When an operation based RPC is defined, the verb should map to the first verb in -the Git command it represents. Example; FetchRemote. - -Note that the current interface defined in this repository does not yet abide -fully to these conventions. Newly defined RPCs should, though, so eventually -gitaly-proto converges to a common standard. - -### Common field names and types - -As a general principle, remember that Git does not enforce encodings on -most data inside repositories, so we can rarely assume data to be a -Protobuf "string" (which implies UTF-8). - -1. `bytes revision`: for fields that accept any of branch names / tag - names / commit ID's. Uses `bytes` to be encoding agnostic. -2. `string commit_id`: for fields that accept a commit ID. -3. `bytes ref`: for fields that accept a refname. -4. `bytes path`: for paths inside Git repositories, i.e., inside Git - `tree` objects. -5. `string relative_path`: for paths on disk on a Gitaly server, - created by "us" (GitLab the application) instead of the user, we - want to use UTF-8, or better, ASCII. - -### Stream patterns - -These are some patterns we already use, or want to use going forward. - -#### Stream response of many small items - -``` -rpc FooBar(FooBarRequest) returns (stream FooBarResponse); - -message FooBarResponse { - message Item { - // ... - } - repeated Item items = 1; -} -``` - -A typical example of an "Item" would be a commit. To avoid the penalty -of network IO for each Item we return, we batch them together. You can -think of this as a kind of buffered IO at the level of the Item -messages. In Go, to ease the bookkeeping you can use -[gitlab.com/gitlab-org/gitaly/internal/helper/chunker](https://godoc.org/gitlab.com/gitlab-org/gitaly/internal/helper/chunker). - -#### Single large item split over multiple messages - -``` -rpc FooBar(FooBarRequest) returns (stream FooBarResponse); - -message FooBarResponse { - message Header { - // ... - } - - oneof payload { - Header header = 1; - bytes data = 2; - } -} -``` - -A typical example of a large item would be the contents of a Git blob. -The header might contain the blob OID and the blob size. Only the first -message in the response stream has `header` set, all others have `data` -but no `header`. - -In the particular case where you're sending back raw binary data from -Go, you can use -[gitlab.com/gitlab-org/gitaly/streamio](https://godoc.org/gitlab.com/gitlab-org/gitaly/streamio) -to turn your gRPC response stream into an `io.Writer`. - -> Note that a number of existing RPC's do not use this pattern exactly; -> they don't use `oneof`. In practice this creates ambiguity (does the -> first message contain non-empty `data`?) and encourages complex -> optimization in the server implementation (trying to squeeze data into -> the first response message). Using `oneof` avoids this ambiguity. - -#### Many large items split over multiple messages - -``` -rpc FooBar(FooBarRequest) returns (stream FooBarResponse); - -message FooBarResponse { - message Header { - // ... - } - - oneof payload { - Header header = 1; - bytes data = 2; - } -} -``` - -This looks the same as the "single large item" case above, except -whenever a new large item begins, we send a new message with a non-empty -`header` field. - -#### Footers - -If the RPC requires it we can also send a footer using `oneof`. But by -default, we prefer headers. - -### RPC Annotations - -In preparation for Gitaly Cluster, we are now requiring all RPC's to be annotated -with an appropriate designation. All methods must contain one of the following lines: - -- `option (op_type).op = ACCESSOR;` - - Designates an RPC as being read-only (i.e. side effect free) -- `option (op_type).op = MUTATOR;` - - Designates that an RPC modifies the repository - -Failing to designate an RPC correctly will result in a CI error. For example: - -`--gitaly_out: server.proto: Method ServerInfo missing op_type option` - -Additionally, all mutator RPC's require additional annotations to clearly -indicate what is being modified: - -- When an RPC modifies a server-wide resource, the scope should specify `SERVER`. -- When an RPC modifies a storage-wide resource, the scope should specify `STORAGE`. - - Additionally, every request should contain field marked with `storage` annotation. -- When an RPC modifies a specific repository, the scope should specify `REPOSITORY`. - - Additionally, every RPC with `REPOSITORY` scope, should also specify the target repository - and may specify the additional repository. - -The target repository represents the location or address of the repository -being modified by the operation. This is needed by Praefect (Gitaly Cluster) in -order to properly schedule replications to keep repository replicas up to date. - -The target repository annotation marks where the target repository can be -found in the message. The annotation is added near `gitaly.Repository` field -(e.g. `Repository repository = 1 [(target_repository)=true];`). If annotated field isn't -`gitaly.Repository` type then it has to contain field annotated `[(repository)=true]` with -correct type. Having separate `repository` annotation allows to have same field in child -message annotated as both `target_repository` and `additional_repository` depending on parent -message. - -The additional repository is annotated similarly to target repository but annotation -is named `additional_repository` - -See our examples of [valid](go/internal/cmd/protoc-gen-gitaly-lint/testdata/valid.proto) and -[invalid](go/internal/cmd/protoc-gen-gitaly-lint/invalid.proto) proto annotations. - -### Go Package - -If adding new protobuf files, make sure to correctly set the `go_package` option -near the top of the file: - -`option go_package = "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb";` - -This allows other protobuf files to locate and import the Go generated stubs. If -you forget to add a `go_package` option, you may receive an error similar to: - -`blob.proto is missing the go_package option` - -### Documentation - -New or updated RPCs and message types should be accompanied by comment strings. -Good comment strings will explain why the RPC exists and how it behaves. Good -message type comments will explain what the message is communicating. Each updated -message field should have a comment. - -Refer to official protobuf documentation for -[how to add comments](https://developers.google.com/protocol-buffers/docs/proto#adding_comments). - -## Contributing - -The CI at https://gitlab.com/gitlab-org/gitaly-proto regenerates the -client libraries to guard against the mistake of updating the .proto -files but not the client libraries. This check uses `git diff` to look -for changes. Some of the code in the Go client libraries is sensitive -to implementation details of the Go standard library (specifically, -the output of gzip). **Use the same Go version as .gitlab-ci.yml (Go -1.13)** when generating new client libraries for a merge request. - -[DCO + License](CONTRIBUTING.md) - -### Build process - -After you change or add a .proto file you need to re-generate the Go -and Ruby libraries before committing your change. - -```shell -# Re-generate Go and Ruby libraries -make proto -``` - -## How to deprecate an RPC call - -See [DEPRECATION.md](DEPRECATION.md). - -## Release - -This will tag and release the gitaly-proto library, including -pushing the gem to rubygems.org - -```shell -make release version=X.Y.Z -``` - -## How to manually push the gem - -If the release script fails the gem may not be pushed. This is how you can do that after the fact: - -```shell -# Use a sub-shell to limit scope of 'set -e' -( - set -e - - # Replace X.Y.Z with the version you are pushing - GEM_VERSION=X.Y.Z - - git checkout v$GEM_VERSION - gem build gitaly.gemspec - gem push gitaly-$GEM_VERSION.gem -) -``` diff --git a/proto/commit.proto b/proto/commit.proto index cbc14fa6c..dad17d5f8 100644 --- a/proto/commit.proto +++ b/proto/commit.proto @@ -186,15 +186,15 @@ message ListCommitsRequest { // Order is the order in which commits shoud be traversed. enum Order { // NONE defaults to reverse chronological order. - NONE = 0; + NONE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // TOPO order will cause no parents to be shown before all of its children // are shown. Furthermore, multiple lines of history will not be // intermixed. - TOPO = 1; + TOPO = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // DATE order will cause no parents to be shown before all of its children // are shown. Otherwise, commits are shown in commit timestamp order. This // can cause history to be shown intermixed. - DATE = 2; + DATE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX }; // Repository is the repository in which commits should be searched for. @@ -321,13 +321,13 @@ message TreeEntryResponse { // TODO: Replace this enum with ObjectType in shared.proto enum ObjectType { // This comment is left unintentionally blank. - COMMIT = 0; + COMMIT = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - BLOB = 1; + BLOB = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - TREE = 2; + TREE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - TAG = 3; + TAG = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. @@ -398,11 +398,11 @@ message TreeEntry { // TODO: Replace this enum with ObjectType in shared.proto enum EntryType { // This comment is left unintentionally blank. - BLOB = 0; + BLOB = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - TREE = 1; + TREE = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - COMMIT = 3; + COMMIT = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // OID of the object this tree entry points to @@ -425,10 +425,10 @@ message TreeEntry { message GetTreeEntriesRequest { // This comment is left unintentionally blank. enum SortBy { - // This comment is left unintentionally blank. - DEFAULT = 0; // Preserve order of git ls-tree - // This comment is left unintentionally blank. - TREES_FIRST = 1; // trees, blobs, submodules + // Preserve order of git ls-tree. + DEFAULT = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH + // Trees, blobs, submodules. + TREES_FIRST = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. @@ -527,11 +527,11 @@ message FindAllCommitsRequest { // This comment is left unintentionally blank. enum Order { // This comment is left unintentionally blank. - NONE = 0; + NONE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - TOPO = 1; + TOPO = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - DATE = 2; + DATE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. @@ -557,9 +557,9 @@ message FindCommitsRequest { // This comment is left unintentionally blank. enum Order { // This comment is left unintentionally blank. - NONE = 0; + NONE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - TOPO = 1; + TOPO = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. diff --git a/proto/diff.proto b/proto/diff.proto index d8e5b31c1..5f1615a45 100644 --- a/proto/diff.proto +++ b/proto/diff.proto @@ -60,9 +60,9 @@ message CommitDiffRequest { // This comment is left unintentionally blank. enum DiffMode { // DEFAULT is the standard diff mode and results in a linewise diff for textfiles. - DEFAULT = 0; + DEFAULT = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // WORDDIFF is a word diff and computes the diff for whitespace separated words instead of for whole lines. - WORDDIFF = 1; + WORDDIFF = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. @@ -250,15 +250,15 @@ message ChangedPaths { // This comment is left unintentionally blank. enum Status { // This comment is left unintentionally blank. - ADDED = 0; + ADDED = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - MODIFIED = 1; + MODIFIED = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - DELETED = 2; + DELETED = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - TYPE_CHANGE = 3; + TYPE_CHANGE = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - COPIED = 4; + COPIED = 4; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. diff --git a/proto/go/gitalypb/commit.pb.go b/proto/go/gitalypb/commit.pb.go index a2c9d0a20..4a7ba41b3 100644 --- a/proto/go/gitalypb/commit.pb.go +++ b/proto/go/gitalypb/commit.pb.go @@ -26,15 +26,15 @@ type ListCommitsRequest_Order int32 const ( // NONE defaults to reverse chronological order. - ListCommitsRequest_NONE ListCommitsRequest_Order = 0 + ListCommitsRequest_NONE ListCommitsRequest_Order = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // TOPO order will cause no parents to be shown before all of its children // are shown. Furthermore, multiple lines of history will not be // intermixed. - ListCommitsRequest_TOPO ListCommitsRequest_Order = 1 + ListCommitsRequest_TOPO ListCommitsRequest_Order = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // DATE order will cause no parents to be shown before all of its children // are shown. Otherwise, commits are shown in commit timestamp order. This // can cause history to be shown intermixed. - ListCommitsRequest_DATE ListCommitsRequest_Order = 2 + ListCommitsRequest_DATE ListCommitsRequest_Order = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for ListCommitsRequest_Order. @@ -83,13 +83,13 @@ type TreeEntryResponse_ObjectType int32 const ( // This comment is left unintentionally blank. - TreeEntryResponse_COMMIT TreeEntryResponse_ObjectType = 0 + TreeEntryResponse_COMMIT TreeEntryResponse_ObjectType = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - TreeEntryResponse_BLOB TreeEntryResponse_ObjectType = 1 + TreeEntryResponse_BLOB TreeEntryResponse_ObjectType = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - TreeEntryResponse_TREE TreeEntryResponse_ObjectType = 2 + TreeEntryResponse_TREE TreeEntryResponse_ObjectType = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - TreeEntryResponse_TAG TreeEntryResponse_ObjectType = 3 + TreeEntryResponse_TAG TreeEntryResponse_ObjectType = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for TreeEntryResponse_ObjectType. @@ -140,11 +140,11 @@ type TreeEntry_EntryType int32 const ( // This comment is left unintentionally blank. - TreeEntry_BLOB TreeEntry_EntryType = 0 + TreeEntry_BLOB TreeEntry_EntryType = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - TreeEntry_TREE TreeEntry_EntryType = 1 + TreeEntry_TREE TreeEntry_EntryType = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - TreeEntry_COMMIT TreeEntry_EntryType = 3 + TreeEntry_COMMIT TreeEntry_EntryType = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for TreeEntry_EntryType. @@ -192,10 +192,10 @@ func (TreeEntry_EntryType) EnumDescriptor() ([]byte, []int) { type GetTreeEntriesRequest_SortBy int32 const ( - // This comment is left unintentionally blank. - GetTreeEntriesRequest_DEFAULT GetTreeEntriesRequest_SortBy = 0 // Preserve order of git ls-tree - // This comment is left unintentionally blank. - GetTreeEntriesRequest_TREES_FIRST GetTreeEntriesRequest_SortBy = 1 // trees, blobs, submodules + // Preserve order of git ls-tree. + GetTreeEntriesRequest_DEFAULT GetTreeEntriesRequest_SortBy = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH + // Trees, blobs, submodules. + GetTreeEntriesRequest_TREES_FIRST GetTreeEntriesRequest_SortBy = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for GetTreeEntriesRequest_SortBy. @@ -242,11 +242,11 @@ type FindAllCommitsRequest_Order int32 const ( // This comment is left unintentionally blank. - FindAllCommitsRequest_NONE FindAllCommitsRequest_Order = 0 + FindAllCommitsRequest_NONE FindAllCommitsRequest_Order = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - FindAllCommitsRequest_TOPO FindAllCommitsRequest_Order = 1 + FindAllCommitsRequest_TOPO FindAllCommitsRequest_Order = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - FindAllCommitsRequest_DATE FindAllCommitsRequest_Order = 2 + FindAllCommitsRequest_DATE FindAllCommitsRequest_Order = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for FindAllCommitsRequest_Order. @@ -295,9 +295,9 @@ type FindCommitsRequest_Order int32 const ( // This comment is left unintentionally blank. - FindCommitsRequest_NONE FindCommitsRequest_Order = 0 + FindCommitsRequest_NONE FindCommitsRequest_Order = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - FindCommitsRequest_TOPO FindCommitsRequest_Order = 1 + FindCommitsRequest_TOPO FindCommitsRequest_Order = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for FindCommitsRequest_Order. diff --git a/proto/go/gitalypb/diff.pb.go b/proto/go/gitalypb/diff.pb.go index cc2114b9c..6c8c08e8d 100644 --- a/proto/go/gitalypb/diff.pb.go +++ b/proto/go/gitalypb/diff.pb.go @@ -25,9 +25,9 @@ type CommitDiffRequest_DiffMode int32 const ( // DEFAULT is the standard diff mode and results in a linewise diff for textfiles. - CommitDiffRequest_DEFAULT CommitDiffRequest_DiffMode = 0 + CommitDiffRequest_DEFAULT CommitDiffRequest_DiffMode = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // WORDDIFF is a word diff and computes the diff for whitespace separated words instead of for whole lines. - CommitDiffRequest_WORDDIFF CommitDiffRequest_DiffMode = 1 + CommitDiffRequest_WORDDIFF CommitDiffRequest_DiffMode = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for CommitDiffRequest_DiffMode. @@ -74,15 +74,15 @@ type ChangedPaths_Status int32 const ( // This comment is left unintentionally blank. - ChangedPaths_ADDED ChangedPaths_Status = 0 + ChangedPaths_ADDED ChangedPaths_Status = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - ChangedPaths_MODIFIED ChangedPaths_Status = 1 + ChangedPaths_MODIFIED ChangedPaths_Status = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ChangedPaths_DELETED ChangedPaths_Status = 2 + ChangedPaths_DELETED ChangedPaths_Status = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ChangedPaths_TYPE_CHANGE ChangedPaths_Status = 3 + ChangedPaths_TYPE_CHANGE ChangedPaths_Status = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ChangedPaths_COPIED ChangedPaths_Status = 4 + ChangedPaths_COPIED ChangedPaths_Status = 4 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for ChangedPaths_Status. diff --git a/proto/go/gitalypb/hook.pb.go b/proto/go/gitalypb/hook.pb.go index 8fd4fe4c3..a8a92c76c 100644 --- a/proto/go/gitalypb/hook.pb.go +++ b/proto/go/gitalypb/hook.pb.go @@ -25,11 +25,11 @@ type ReferenceTransactionHookRequest_State int32 const ( // This comment is left unintentionally blank. - ReferenceTransactionHookRequest_PREPARED ReferenceTransactionHookRequest_State = 0 + ReferenceTransactionHookRequest_PREPARED ReferenceTransactionHookRequest_State = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - ReferenceTransactionHookRequest_COMMITTED ReferenceTransactionHookRequest_State = 1 + ReferenceTransactionHookRequest_COMMITTED ReferenceTransactionHookRequest_State = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ReferenceTransactionHookRequest_ABORTED ReferenceTransactionHookRequest_State = 2 + ReferenceTransactionHookRequest_ABORTED ReferenceTransactionHookRequest_State = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for ReferenceTransactionHookRequest_State. diff --git a/proto/go/gitalypb/lint.pb.go b/proto/go/gitalypb/lint.pb.go index 08d2ad0ae..a2f4e9e72 100644 --- a/proto/go/gitalypb/lint.pb.go +++ b/proto/go/gitalypb/lint.pb.go @@ -26,13 +26,13 @@ type OperationMsg_Operation int32 const ( // This comment is left unintentionally blank. - OperationMsg_UNKNOWN OperationMsg_Operation = 0 + OperationMsg_UNKNOWN OperationMsg_Operation = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - OperationMsg_MUTATOR OperationMsg_Operation = 1 + OperationMsg_MUTATOR OperationMsg_Operation = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - OperationMsg_ACCESSOR OperationMsg_Operation = 2 + OperationMsg_ACCESSOR OperationMsg_Operation = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - OperationMsg_MAINTENANCE OperationMsg_Operation = 3 + OperationMsg_MAINTENANCE OperationMsg_Operation = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for OperationMsg_Operation. @@ -83,9 +83,9 @@ type OperationMsg_Scope int32 const ( // This comment is left unintentionally blank. - OperationMsg_REPOSITORY OperationMsg_Scope = 0 + OperationMsg_REPOSITORY OperationMsg_Scope = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - OperationMsg_STORAGE OperationMsg_Scope = 2 + OperationMsg_STORAGE OperationMsg_Scope = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for OperationMsg_Scope. diff --git a/proto/go/gitalypb/operations.pb.go b/proto/go/gitalypb/operations.pb.go index 67c8676e1..e0efd07bc 100644 --- a/proto/go/gitalypb/operations.pb.go +++ b/proto/go/gitalypb/operations.pb.go @@ -27,12 +27,12 @@ type UserCherryPickResponse_CreateTreeError int32 const ( // NONE denotes that no error occurred. - UserCherryPickResponse_NONE UserCherryPickResponse_CreateTreeError = 0 + UserCherryPickResponse_NONE UserCherryPickResponse_CreateTreeError = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // EMPTY denotes that the cherry-pick would've resulted in an empty commit, // typically because it has already been applied to the target branch. - UserCherryPickResponse_EMPTY UserCherryPickResponse_CreateTreeError = 1 + UserCherryPickResponse_EMPTY UserCherryPickResponse_CreateTreeError = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // CONFLICT denotes that the cherry-pick resulted in a conflict. - UserCherryPickResponse_CONFLICT UserCherryPickResponse_CreateTreeError = 2 + UserCherryPickResponse_CONFLICT UserCherryPickResponse_CreateTreeError = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for UserCherryPickResponse_CreateTreeError. @@ -82,12 +82,12 @@ type UserRevertResponse_CreateTreeError int32 const ( // NONE denotes that no error occurred. - UserRevertResponse_NONE UserRevertResponse_CreateTreeError = 0 + UserRevertResponse_NONE UserRevertResponse_CreateTreeError = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // EMPTY denotes that the revert would've resulted in an empty commit, // typically because it has already been applied to the target branch. - UserRevertResponse_EMPTY UserRevertResponse_CreateTreeError = 1 + UserRevertResponse_EMPTY UserRevertResponse_CreateTreeError = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // CONFLICT denotes that the revert resulted in a conflict. - UserRevertResponse_CONFLICT UserRevertResponse_CreateTreeError = 2 + UserRevertResponse_CONFLICT UserRevertResponse_CreateTreeError = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for UserRevertResponse_CreateTreeError. @@ -136,17 +136,17 @@ type UserCommitFilesActionHeader_ActionType int32 const ( // CREATE creates a new file. - UserCommitFilesActionHeader_CREATE UserCommitFilesActionHeader_ActionType = 0 + UserCommitFilesActionHeader_CREATE UserCommitFilesActionHeader_ActionType = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // CREATE_DIR creates a new directory. - UserCommitFilesActionHeader_CREATE_DIR UserCommitFilesActionHeader_ActionType = 1 + UserCommitFilesActionHeader_CREATE_DIR UserCommitFilesActionHeader_ActionType = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // UPDATE updates an existing file. - UserCommitFilesActionHeader_UPDATE UserCommitFilesActionHeader_ActionType = 2 + UserCommitFilesActionHeader_UPDATE UserCommitFilesActionHeader_ActionType = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // MOVE moves an existing file to a new path. - UserCommitFilesActionHeader_MOVE UserCommitFilesActionHeader_ActionType = 3 + UserCommitFilesActionHeader_MOVE UserCommitFilesActionHeader_ActionType = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // DELETE deletes an existing file. - UserCommitFilesActionHeader_DELETE UserCommitFilesActionHeader_ActionType = 4 + UserCommitFilesActionHeader_DELETE UserCommitFilesActionHeader_ActionType = 4 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // CHMOD changes the permissions of an existing file. - UserCommitFilesActionHeader_CHMOD UserCommitFilesActionHeader_ActionType = 5 + UserCommitFilesActionHeader_CHMOD UserCommitFilesActionHeader_ActionType = 5 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for UserCommitFilesActionHeader_ActionType. diff --git a/proto/go/gitalypb/ref.pb.go b/proto/go/gitalypb/ref.pb.go index 536f61ff2..df88af5e2 100644 --- a/proto/go/gitalypb/ref.pb.go +++ b/proto/go/gitalypb/ref.pb.go @@ -26,11 +26,11 @@ type FindLocalBranchesRequest_SortBy int32 const ( // This comment is left unintentionally blank. - FindLocalBranchesRequest_NAME FindLocalBranchesRequest_SortBy = 0 + FindLocalBranchesRequest_NAME FindLocalBranchesRequest_SortBy = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - FindLocalBranchesRequest_UPDATED_ASC FindLocalBranchesRequest_SortBy = 1 + FindLocalBranchesRequest_UPDATED_ASC FindLocalBranchesRequest_SortBy = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - FindLocalBranchesRequest_UPDATED_DESC FindLocalBranchesRequest_SortBy = 2 + FindLocalBranchesRequest_UPDATED_DESC FindLocalBranchesRequest_SortBy = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for FindLocalBranchesRequest_SortBy. @@ -79,9 +79,9 @@ type FindAllTagsRequest_SortBy_Key int32 const ( // This comment is left unintentionally blank. - FindAllTagsRequest_SortBy_REFNAME FindAllTagsRequest_SortBy_Key = 0 + FindAllTagsRequest_SortBy_REFNAME FindAllTagsRequest_SortBy_Key = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - FindAllTagsRequest_SortBy_CREATORDATE FindAllTagsRequest_SortBy_Key = 1 + FindAllTagsRequest_SortBy_CREATORDATE FindAllTagsRequest_SortBy_Key = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for FindAllTagsRequest_SortBy_Key. @@ -128,13 +128,13 @@ type CreateBranchResponse_Status int32 const ( // This comment is left unintentionally blank. - CreateBranchResponse_OK CreateBranchResponse_Status = 0 + CreateBranchResponse_OK CreateBranchResponse_Status = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - CreateBranchResponse_ERR_EXISTS CreateBranchResponse_Status = 1 + CreateBranchResponse_ERR_EXISTS CreateBranchResponse_Status = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - CreateBranchResponse_ERR_INVALID CreateBranchResponse_Status = 2 + CreateBranchResponse_ERR_INVALID CreateBranchResponse_Status = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - CreateBranchResponse_ERR_INVALID_START_POINT CreateBranchResponse_Status = 3 + CreateBranchResponse_ERR_INVALID_START_POINT CreateBranchResponse_Status = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for CreateBranchResponse_Status. @@ -185,13 +185,13 @@ type ListRefsRequest_SortBy_Key int32 const ( // This comment is left unintentionally blank. - ListRefsRequest_SortBy_REFNAME ListRefsRequest_SortBy_Key = 0 + ListRefsRequest_SortBy_REFNAME ListRefsRequest_SortBy_Key = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - ListRefsRequest_SortBy_CREATORDATE ListRefsRequest_SortBy_Key = 1 + ListRefsRequest_SortBy_CREATORDATE ListRefsRequest_SortBy_Key = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ListRefsRequest_SortBy_AUTHORDATE ListRefsRequest_SortBy_Key = 2 + ListRefsRequest_SortBy_AUTHORDATE ListRefsRequest_SortBy_Key = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ListRefsRequest_SortBy_COMMITTERDATE ListRefsRequest_SortBy_Key = 3 + ListRefsRequest_SortBy_COMMITTERDATE ListRefsRequest_SortBy_Key = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for ListRefsRequest_SortBy_Key. diff --git a/proto/go/gitalypb/repository.pb.go b/proto/go/gitalypb/repository.pb.go index 90f8a7e6f..f24ce8a3d 100644 --- a/proto/go/gitalypb/repository.pb.go +++ b/proto/go/gitalypb/repository.pb.go @@ -27,7 +27,7 @@ const ( // SizeMultiple requires to use '--split --size-multiple=4' strategy to create/update commit graph. // https://git-scm.com/docs/git-commit-graph#Documentation/git-commit-graph.txt-emwriteem // It is a default, there is no need to explicitly set it in the request. - WriteCommitGraphRequest_SizeMultiple WriteCommitGraphRequest_SplitStrategy = 0 // protolint:disable:this ENUM_FIELD_NAMES_UPPER_SNAKE_CASE + WriteCommitGraphRequest_SizeMultiple WriteCommitGraphRequest_SplitStrategy = 0 // protolint:disable:this ENUM_FIELD_NAMES_UPPER_SNAKE_CASE ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH ) // Enum value maps for WriteCommitGraphRequest_SplitStrategy. @@ -72,13 +72,13 @@ type GetArchiveRequest_Format int32 const ( // This comment is left unintentionally blank. - GetArchiveRequest_ZIP GetArchiveRequest_Format = 0 + GetArchiveRequest_ZIP GetArchiveRequest_Format = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - GetArchiveRequest_TAR GetArchiveRequest_Format = 1 + GetArchiveRequest_TAR GetArchiveRequest_Format = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - GetArchiveRequest_TAR_GZ GetArchiveRequest_Format = 2 + GetArchiveRequest_TAR_GZ GetArchiveRequest_Format = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - GetArchiveRequest_TAR_BZ2 GetArchiveRequest_Format = 3 + GetArchiveRequest_TAR_BZ2 GetArchiveRequest_Format = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for GetArchiveRequest_Format. @@ -129,19 +129,19 @@ type GetRawChangesResponse_RawChange_Operation int32 const ( // This comment is left unintentionally blank. - GetRawChangesResponse_RawChange_UNKNOWN GetRawChangesResponse_RawChange_Operation = 0 + GetRawChangesResponse_RawChange_UNKNOWN GetRawChangesResponse_RawChange_Operation = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - GetRawChangesResponse_RawChange_ADDED GetRawChangesResponse_RawChange_Operation = 1 + GetRawChangesResponse_RawChange_ADDED GetRawChangesResponse_RawChange_Operation = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - GetRawChangesResponse_RawChange_COPIED GetRawChangesResponse_RawChange_Operation = 2 + GetRawChangesResponse_RawChange_COPIED GetRawChangesResponse_RawChange_Operation = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - GetRawChangesResponse_RawChange_DELETED GetRawChangesResponse_RawChange_Operation = 3 + GetRawChangesResponse_RawChange_DELETED GetRawChangesResponse_RawChange_Operation = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - GetRawChangesResponse_RawChange_MODIFIED GetRawChangesResponse_RawChange_Operation = 4 + GetRawChangesResponse_RawChange_MODIFIED GetRawChangesResponse_RawChange_Operation = 4 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - GetRawChangesResponse_RawChange_RENAMED GetRawChangesResponse_RawChange_Operation = 5 + GetRawChangesResponse_RawChange_RENAMED GetRawChangesResponse_RawChange_Operation = 5 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - GetRawChangesResponse_RawChange_TYPE_CHANGED GetRawChangesResponse_RawChange_Operation = 6 + GetRawChangesResponse_RawChange_TYPE_CHANGED GetRawChangesResponse_RawChange_Operation = 6 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for GetRawChangesResponse_RawChange_Operation. diff --git a/proto/go/gitalypb/shared.pb.go b/proto/go/gitalypb/shared.pb.go index 31a54b636..e1aa03aac 100644 --- a/proto/go/gitalypb/shared.pb.go +++ b/proto/go/gitalypb/shared.pb.go @@ -26,15 +26,15 @@ type ObjectType int32 const ( // This comment is left unintentionally blank. - ObjectType_UNKNOWN ObjectType = 0 + ObjectType_UNKNOWN ObjectType = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - ObjectType_COMMIT ObjectType = 1 + ObjectType_COMMIT ObjectType = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ObjectType_BLOB ObjectType = 2 + ObjectType_BLOB ObjectType = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ObjectType_TREE ObjectType = 3 + ObjectType_TREE ObjectType = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ObjectType_TAG ObjectType = 4 + ObjectType_TAG ObjectType = 4 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for ObjectType. @@ -87,13 +87,13 @@ type SignatureType int32 const ( // This comment is left unintentionally blank. - SignatureType_NONE SignatureType = 0 + SignatureType_NONE SignatureType = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - SignatureType_PGP SignatureType = 1 + SignatureType_PGP SignatureType = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - SignatureType_X509 SignatureType = 2 + SignatureType_X509 SignatureType = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - SignatureType_SSH SignatureType = 3 // maybe add X509+TSA or other combinations at a later step + SignatureType_SSH SignatureType = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for SignatureType. @@ -144,9 +144,9 @@ type SortDirection int32 const ( // ASCENDING sorts by the sort key in ascending order. - SortDirection_ASCENDING SortDirection = 0 + SortDirection_ASCENDING SortDirection = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // DESCENDING sorts by the sort key in descending order. - SortDirection_DESCENDING SortDirection = 1 + SortDirection_DESCENDING SortDirection = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for SortDirection. diff --git a/proto/go/gitalypb/transaction.pb.go b/proto/go/gitalypb/transaction.pb.go index b98a2af3a..6824ea2d8 100644 --- a/proto/go/gitalypb/transaction.pb.go +++ b/proto/go/gitalypb/transaction.pb.go @@ -27,14 +27,14 @@ const ( // UNKNOWN_PHASE is the unknown voting phase. This value has been the // default because phases have been introduced. Eventually, using this // phase will become unsupported. - VoteTransactionRequest_UNKNOWN_PHASE VoteTransactionRequest_Phase = 0 + VoteTransactionRequest_UNKNOWN_PHASE VoteTransactionRequest_Phase = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // PREPARED_PHASE is the prepratory phase. The data that is about to change // is locked for concurrent modification, but changes have not yet been // written to disk. - VoteTransactionRequest_PREPARED_PHASE VoteTransactionRequest_Phase = 1 + VoteTransactionRequest_PREPARED_PHASE VoteTransactionRequest_Phase = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // COMMITTED_PHASE is the committing phase. Data has been committed to disk // and will be visible in all subsequent requests. - VoteTransactionRequest_COMMITTED_PHASE VoteTransactionRequest_Phase = 2 + VoteTransactionRequest_COMMITTED_PHASE VoteTransactionRequest_Phase = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for VoteTransactionRequest_Phase. @@ -84,11 +84,11 @@ type VoteTransactionResponse_TransactionState int32 const ( // This comment is left unintentionally blank. - VoteTransactionResponse_COMMIT VoteTransactionResponse_TransactionState = 0 + VoteTransactionResponse_COMMIT VoteTransactionResponse_TransactionState = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - VoteTransactionResponse_ABORT VoteTransactionResponse_TransactionState = 1 + VoteTransactionResponse_ABORT VoteTransactionResponse_TransactionState = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - VoteTransactionResponse_STOP VoteTransactionResponse_TransactionState = 2 + VoteTransactionResponse_STOP VoteTransactionResponse_TransactionState = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for VoteTransactionResponse_TransactionState. diff --git a/proto/go/gitalypb/wiki.pb.go b/proto/go/gitalypb/wiki.pb.go index a57413524..d37ad38fc 100644 --- a/proto/go/gitalypb/wiki.pb.go +++ b/proto/go/gitalypb/wiki.pb.go @@ -25,9 +25,9 @@ type WikiGetAllPagesRequest_SortBy int32 const ( // This comment is left unintentionally blank. - WikiGetAllPagesRequest_TITLE WikiGetAllPagesRequest_SortBy = 0 + WikiGetAllPagesRequest_TITLE WikiGetAllPagesRequest_SortBy = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - WikiGetAllPagesRequest_CREATED_AT WikiGetAllPagesRequest_SortBy = 1 + WikiGetAllPagesRequest_CREATED_AT WikiGetAllPagesRequest_SortBy = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for WikiGetAllPagesRequest_SortBy. @@ -74,9 +74,9 @@ type WikiListPagesRequest_SortBy int32 const ( // This comment is left unintentionally blank. - WikiListPagesRequest_TITLE WikiListPagesRequest_SortBy = 0 + WikiListPagesRequest_TITLE WikiListPagesRequest_SortBy = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - WikiListPagesRequest_CREATED_AT WikiListPagesRequest_SortBy = 1 + WikiListPagesRequest_CREATED_AT WikiListPagesRequest_SortBy = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ) // Enum value maps for WikiListPagesRequest_SortBy. diff --git a/proto/hook.proto b/proto/hook.proto index eda4036cf..308154e51 100644 --- a/proto/hook.proto +++ b/proto/hook.proto @@ -123,11 +123,11 @@ message ReferenceTransactionHookRequest { // This comment is left unintentionally blank. enum State { // This comment is left unintentionally blank. - PREPARED = 0; + PREPARED = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - COMMITTED = 1; + COMMITTED = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ABORTED = 2; + ABORTED = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. diff --git a/proto/lint.proto b/proto/lint.proto index 6f1d2b1b5..49595e3d4 100644 --- a/proto/lint.proto +++ b/proto/lint.proto @@ -11,21 +11,21 @@ message OperationMsg { // This comment is left unintentionally blank. enum Operation { // This comment is left unintentionally blank. - UNKNOWN = 0; + UNKNOWN = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - MUTATOR = 1; + MUTATOR = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ACCESSOR = 2; + ACCESSOR = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - MAINTENANCE = 3; + MAINTENANCE = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. enum Scope { // This comment is left unintentionally blank. - REPOSITORY = 0; + REPOSITORY = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - STORAGE = 2; + STORAGE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX reserved 1; reserved "SERVER"; diff --git a/proto/operations.proto b/proto/operations.proto index b4afcd0bd..fdc690352 100644 --- a/proto/operations.proto +++ b/proto/operations.proto @@ -418,12 +418,12 @@ message UserCherryPickResponse { // cherry-pick. enum CreateTreeError { // NONE denotes that no error occurred. - NONE = 0; + NONE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // EMPTY denotes that the cherry-pick would've resulted in an empty commit, // typically because it has already been applied to the target branch. - EMPTY = 1; + EMPTY = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // CONFLICT denotes that the cherry-pick resulted in a conflict. - CONFLICT = 2; + CONFLICT = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // branch_update represents details about the updated branch. @@ -496,12 +496,12 @@ message UserRevertResponse { // revert. enum CreateTreeError { // NONE denotes that no error occurred. - NONE = 0; + NONE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // EMPTY denotes that the revert would've resulted in an empty commit, // typically because it has already been applied to the target branch. - EMPTY = 1; + EMPTY = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // CONFLICT denotes that the revert resulted in a conflict. - CONFLICT = 2; + CONFLICT = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // branch_update represents details about the updated branch. @@ -524,17 +524,17 @@ message UserCommitFilesActionHeader { // This comment is left unintentionally blank. enum ActionType { // CREATE creates a new file. - CREATE = 0; + CREATE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // CREATE_DIR creates a new directory. - CREATE_DIR = 1; + CREATE_DIR = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // UPDATE updates an existing file. - UPDATE = 2; + UPDATE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // MOVE moves an existing file to a new path. - MOVE = 3; + MOVE = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // DELETE deletes an existing file. - DELETE = 4; + DELETE = 4; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // CHMOD changes the permissions of an existing file. - CHMOD = 5; + CHMOD = 5; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // action is the type of the action taken to build a commit. Not all fields are diff --git a/proto/ref.proto b/proto/ref.proto index 502d86e7f..e97a85012 100644 --- a/proto/ref.proto +++ b/proto/ref.proto @@ -190,11 +190,11 @@ message FindLocalBranchesRequest { // This comment is left unintentionally blank. enum SortBy { // This comment is left unintentionally blank. - NAME = 0; + NAME = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - UPDATED_ASC = 1; + UPDATED_ASC = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - UPDATED_DESC = 2; + UPDATED_DESC = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. @@ -288,9 +288,9 @@ message FindAllTagsRequest { // Key is a key used for sorting. enum Key { // This comment is left unintentionally blank. - REFNAME = 0; + REFNAME = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - CREATORDATE = 1; + CREATORDATE = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. @@ -344,13 +344,13 @@ message CreateBranchResponse { // This comment is left unintentionally blank. enum Status { // This comment is left unintentionally blank. - OK = 0; + OK = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - ERR_EXISTS = 1; + ERR_EXISTS = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ERR_INVALID = 2; + ERR_INVALID = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - ERR_INVALID_START_POINT = 3; + ERR_INVALID_START_POINT = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. @@ -526,13 +526,13 @@ message ListRefsRequest { // This comment is left unintentionally blank. enum Key { // This comment is left unintentionally blank. - REFNAME = 0; + REFNAME = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - CREATORDATE = 1; + CREATORDATE = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - AUTHORDATE = 2; + AUTHORDATE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - COMMITTERDATE = 3; + COMMITTERDATE = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // Key is a key used for sorting. diff --git a/proto/repository.proto b/proto/repository.proto index 9f8c51d95..edac1fe51 100644 --- a/proto/repository.proto +++ b/proto/repository.proto @@ -399,7 +399,7 @@ message WriteCommitGraphRequest { // SizeMultiple requires to use '--split --size-multiple=4' strategy to create/update commit graph. // https://git-scm.com/docs/git-commit-graph#Documentation/git-commit-graph.txt-emwriteem // It is a default, there is no need to explicitly set it in the request. - SizeMultiple = 0; // protolint:disable:this ENUM_FIELD_NAMES_UPPER_SNAKE_CASE + SizeMultiple = 0; // protolint:disable:this ENUM_FIELD_NAMES_UPPER_SNAKE_CASE ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH } // This comment is left unintentionally blank. @@ -520,13 +520,13 @@ message GetArchiveRequest { // This comment is left unintentionally blank. enum Format { // This comment is left unintentionally blank. - ZIP = 0; + ZIP = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - TAR = 1; + TAR = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - TAR_GZ = 2; + TAR_GZ = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - TAR_BZ2 = 3; + TAR_BZ2 = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. @@ -842,19 +842,19 @@ message GetRawChangesResponse { // This comment is left unintentionally blank. enum Operation { // This comment is left unintentionally blank. - UNKNOWN = 0; + UNKNOWN = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - ADDED = 1; + ADDED = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - COPIED = 2; + COPIED = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - DELETED = 3; + DELETED = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - MODIFIED = 4; + MODIFIED = 4; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - RENAMED = 5; + RENAMED = 5; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - TYPE_CHANGED = 6; + TYPE_CHANGED = 6; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. diff --git a/proto/shared.proto b/proto/shared.proto index 8f5d04d99..0c734477d 100644 --- a/proto/shared.proto +++ b/proto/shared.proto @@ -10,27 +10,27 @@ option go_package = "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"; // This comment is left unintentionally blank. enum ObjectType { // This comment is left unintentionally blank. - UNKNOWN = 0; + UNKNOWN = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - COMMIT = 1; + COMMIT = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - BLOB = 2; + BLOB = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - TREE = 3; + TREE = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - TAG = 4; + TAG = 4; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. enum SignatureType { // This comment is left unintentionally blank. - NONE = 0; + NONE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - PGP = 1; + PGP = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - X509 = 2; + X509 = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - SSH = 3; + SSH = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // maybe add X509+TSA or other combinations at a later step } @@ -203,7 +203,7 @@ message GlobalOptions { // SortDirection defines the sort direction. enum SortDirection { // ASCENDING sorts by the sort key in ascending order. - ASCENDING = 0; + ASCENDING = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // DESCENDING sorts by the sort key in descending order. - DESCENDING = 1; + DESCENDING = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } diff --git a/proto/transaction.proto b/proto/transaction.proto index ed22eea63..577ca4e5b 100644 --- a/proto/transaction.proto +++ b/proto/transaction.proto @@ -49,14 +49,14 @@ message VoteTransactionRequest { // UNKNOWN_PHASE is the unknown voting phase. This value has been the // default because phases have been introduced. Eventually, using this // phase will become unsupported. - UNKNOWN_PHASE = 0; + UNKNOWN_PHASE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // PREPARED_PHASE is the prepratory phase. The data that is about to change // is locked for concurrent modification, but changes have not yet been // written to disk. - PREPARED_PHASE = 1; + PREPARED_PHASE = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // COMMITTED_PHASE is the committing phase. Data has been committed to disk // and will be visible in all subsequent requests. - COMMITTED_PHASE = 2; + COMMITTED_PHASE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX }; // This comment is left unintentionally blank. @@ -77,11 +77,11 @@ message VoteTransactionResponse { // transaction should be committed or rolled back. enum TransactionState { // This comment is left unintentionally blank. - COMMIT = 0; + COMMIT = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - ABORT = 1; + ABORT = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX // This comment is left unintentionally blank. - STOP = 2; + STOP = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. diff --git a/proto/wiki.proto b/proto/wiki.proto index 8c039ae75..ac096f26a 100644 --- a/proto/wiki.proto +++ b/proto/wiki.proto @@ -159,9 +159,9 @@ message WikiGetAllPagesRequest { // This comment is left unintentionally blank. enum SortBy { // This comment is left unintentionally blank. - TITLE = 0; + TITLE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - CREATED_AT = 1; + CREATED_AT = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. @@ -187,9 +187,9 @@ message WikiListPagesRequest { // This comment is left unintentionally blank. enum SortBy { // This comment is left unintentionally blank. - TITLE = 0; + TITLE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH // This comment is left unintentionally blank. - CREATED_AT = 1; + CREATED_AT = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX } // This comment is left unintentionally blank. |