Inspect changes in Gitaly bf0be1ad00e3c2657c2e5d66ec86824d859aa2fb
Upstream merge commit c4d2e17461d8 changes Gitaly server version from 119bc72eed2618fa5fbd21f35c290c6106275301 to bf0be1ad00e3c2657c2e5d66ec86824d859aa2fb, with changes in protocol or one of the source subtrees currently under watch.
To further inspect, go to an up to date Gitaly source clone and run
diff 119bc72eed2618fa5fbd21f35c290c6106275301..bf0be1ad00e3c2657c2e5d66ec86824d859aa2fb -- proto/*.proto internal/backup
. Here is a preview, truncated at 500 lines:
diff --git a/proto/blob.proto b/proto/blob.proto
index fec951adf..6b83d31dc 100644
--- a/proto/blob.proto
+++ b/proto/blob.proto
@@ -20,7 +20,10 @@ service BlobService {
};
}
- // This comment is left unintentionally blank.
+ // GetBlobs returns blobs identified via a revision and path.
+ //
+ // Note that the behaviour of this RPC is quite weird: it does not only return blobs, but will also return submodules
+ // as commits and trees. It's use is thus discouraged in favor of ListBlobs, which behaves more sanely.
rpc GetBlobs(GetBlobsRequest) returns (stream GetBlobsResponse) {
option (op_type) = {
op: ACCESSOR
@@ -75,61 +78,74 @@ service BlobService {
}
-// This comment is left unintentionally blank.
+// GetBlobRequest is a request for the GetBlob RPC.
message GetBlobRequest {
- // This comment is left unintentionally blank.
+ // Repository is the repository that shall be searched.
Repository repository = 1[(target_repository)=true];
- // Object ID (SHA1) of the blob we want to get
+ // Oid is the object ID of the blob we want to get.
string oid = 2;
- // Maximum number of bytes we want to receive. Use '-1' to get the full blob no matter how big.
+ // Limit is the maximum number of bytes we want to receive. Use '-1' to get the full blob no matter how big. Setting
+ // this to `0` will return no data.
int64 limit = 3;
}
-// This comment is left unintentionally blank.
+// GetBlobResponse is a response for the GetBlob RPC. Multiple responses will be returned when the blob is large and
+// thus doesn't fit into a single response.
message GetBlobResponse {
- // Blob size; present only in first response message
+ // Size is the size of the blob. Present only in first response message.
int64 size = 1;
- // Chunk of blob data
+ // Data is a chunk of data.
bytes data = 2;
- // Object ID of the actual blob returned. Empty if no blob was found.
+ // Oid of the actual blob returned. Empty if no blob was found.
string oid = 3;
}
-// This comment is left unintentionally blank.
+// GetBlobsRequest is a request for the GetBlobs RPC.
message GetBlobsRequest {
- // This comment is left unintentionally blank.
+ // RevisionPath is a combination of revision and path. All objects reachable in the subdirectory of the treeish
+ // will be returned.
message RevisionPath {
- // This comment is left unintentionally blank.
+ // Revision is the revision that identifies the tree-ish. Must not be empty.
string revision = 1;
- // This comment is left unintentionally blank.
+ // Path is the path relative to the treeish revision that shall be searched for a blob. If the path is empty the
+ // root directory of the tree-ish will be searched.
bytes path = 2;
}
- // This comment is left unintentionally blank.
+ // Repository is the repository that shall be searched.
Repository repository = 1[(target_repository)=true];
- // Revision/Path pairs of the blobs we want to get.
+ // RevisionPaths identifies the set of revision/path pairs that shall be searched for blobs.
repeated RevisionPath revision_paths = 2;
- // Maximum number of bytes we want to receive. Use '-1' to get the full blobs no matter how big.
+ // Limit is the maximum number of bytes we want to receive. Use '-1' to get the full blobs no matter how big.
int64 limit = 3;
}
-// This comment is left unintentionally blank.
+// GetBlobsResponse is a response for the GetBlobs RPC and identifies a single blob. Multiple responses can be returned
+// for the same blob in case its data is longer than the gRPC message limit. Subsequent messages for the same blob will
+// only have their data field set. Blobs which cannot be found will only have their path and revision set, but will
+// otherwise be empty.
message GetBlobsResponse {
- // Blob size; present only on the first message per blob
+ // Size is the size of the blob. Present only on the first message per blob
int64 size = 1;
- // Chunk of blob data, could span over multiple messages.
+ // Data is a chunk of blob data, which could span over multiple messages.
bytes data = 2;
- // Object ID of the current blob. Only present on the first message per blob. Empty if no blob was found.
+ // Oid is the object ID of the current blob. Only present on the first message per blob. Empty if no blob was
+ // found.
string oid = 3;
- // This comment is left unintentionally blank.
+ // IsSubmodule indicates whether the blob is a submodule.
bool is_submodule = 4;
- // This comment is left unintentionally blank.
+ // Mode is the file mode of blob as present in the tree. It is typically one of:
+ //
+ // - 0o100644 for non-executable files.
+ // - 0o100755 for executable files.
+ // - 0o160000 for submodules.
+ // - 0o040000 for subtrees.
int32 mode = 5;
- // This comment is left unintentionally blank.
+ // Revision is the revision that this blob has been traversed from.
string revision = 6;
- // This comment is left unintentionally blank.
+ // Path is the path of the blob inside of the tree.
bytes path = 7;
- // This comment is left unintentionally blank.
+ // Type is the type of the "blob".
ObjectType type = 8;
}
@@ -229,16 +245,6 @@ message LFSPointer {
string oid = 3;
}
-// This comment is left unintentionally blank.
-message NewBlobObject {
- // This comment is left unintentionally blank.
- int64 size = 1;
- // This comment is left unintentionally blank.
- string oid = 2;
- // This comment is left unintentionally blank.
- bytes path = 3;
-}
-
// GetLFSPointersRequest is a request for the GetLFSPointers RPC.
message GetLFSPointersRequest {
// Repository is the repository for which LFS pointers should be retrieved
diff --git a/proto/errors.proto b/proto/errors.proto
index c383eadff..6697d1883 100644
--- a/proto/errors.proto
+++ b/proto/errors.proto
@@ -104,6 +104,18 @@ message ReferenceNotFoundError {
bytes reference_name = 1;
}
+// ReferenceStateMismatchError is an error returned when updating a reference fails because its pointing to a different
+// object ID than expected.
+message ReferenceStateMismatchError {
+ // ReferenceName is the name of the reference that was failed to update.
+ bytes reference_name = 1;
+ // ExpectedObjectId is the object ID that the reference was expected to point to but didn't.
+ bytes expected_object_id = 2;
+ // ActualObjectId is the object ID that the reference actually pointed to at the time when it was tried to be
+ // updated.
+ bytes actual_object_id = 3;
+}
+
// ReferenceUpdateError is an error returned when updating a reference has
// failed.
message ReferenceUpdateError {
diff --git a/proto/ref.proto b/proto/ref.proto
index 41b4a8122..9d09bac91 100644
--- a/proto/ref.proto
+++ b/proto/ref.proto
@@ -78,6 +78,16 @@ service RefService {
};
}
+ // UpdateReferences atomically updates a set of references to a new state. This RPC allows creating
+ // new references, deleting old references and updating existing references in a raceless way.
+ //
+ // Updating symbolic references with this RPC is not allowed.
+ rpc UpdateReferences(stream UpdateReferencesRequest) returns (UpdateReferencesResponse) {
+ option (op_type) = {
+ op: MUTATOR
+ };
+ }
+
// This comment is left unintentionally blank.
rpc DeleteRefs(DeleteRefsRequest) returns (DeleteRefsResponse) {
option (op_type) = {
@@ -344,6 +354,53 @@ message FindBranchResponse {
Branch branch = 1;
}
+// UpdateReferencesRequest is a request for the UpdateReferences RPC.
+message UpdateReferencesRequest {
+ // Update represents a reference update.
+ message Update {
+ // Reference is the fully-qualified reference name that should be updated.
+ bytes reference = 1;
+
+ // OldObjectId is the object ID the reference should be pointing to in order to be updated.
+ // This has the intent to avoid time-of-check-time-of-use-style races when the object ID
+ // has changed.
+ //
+ // If empty, the reference will be force-updated without any such checks. If set to the
+ // all-zeroes object ID, this will verify that the branch did not exist previously.
+ bytes old_object_id = 2;
+
+ // NewObjectId is the object ID the reference should be updated to. If set to the all-zeroes
+ // object ID the branch will be deleted.
+ bytes new_object_id = 3;
+ };
+
+ // Repository is the repository where references shall be updated in.
+ Repository repository = 1 [(target_repository)=true];
+ // Updates is the set of reference updates that shall be performed.
+ repeated Update updates = 2;
+}
+
+// UpdateReferencesResponse is a response for the UpdateReferences RPC.
+message UpdateReferencesResponse {
+}
+
+// UpdateReferencesError is returned when UpdateReferences fails to update references in some specific well-defined
+// cases.
+message UpdateReferencesError {
+ oneof error {
+ // InvalidFormat is returned when one or more of the refs to be deleted
+ // have an invalid format.
+ InvalidRefFormatError invalid_format = 1;
+ // ReferencesLocked is returned when the references to be deleted are already
+ // locked by another process.
+ ReferencesLockedError references_locked = 2;
+ // ReferenceStateMismatch is return for unforced reference updates when the expected object ID does not match
+ // the actual object ID of the reference. This indicates either mismatching expectations or a race with another
+ // client that has updated the reference concurrently.
+ ReferenceStateMismatchError reference_state_mismatch = 3;
+ }
+}
+
// This comment is left unintentionally blank.
message DeleteRefsRequest{
// This comment is left unintentionally blank.
diff --git a/proto/repository.proto b/proto/repository.proto
index 0bb54e9a4..d3a54b37a 100644
--- a/proto/repository.proto
+++ b/proto/repository.proto
@@ -311,7 +311,14 @@ service RepositoryService {
};
}
- // This comment is left unintentionally blank.
+ // ReplicateRepository replicates data from a source repository to target repository. On the
+ // target repository, this operation ensures synchronization of the following components:
+ //
+ // - Git config
+ // - Git attributes
+ // - Custom Git hooks,
+ // - References and objects
+ // - (Optional) Object deduplication network membership
rpc ReplicateRepository(ReplicateRepositoryRequest) returns (ReplicateRepositoryResponse) {
option (op_type) = {
op: MUTATOR
@@ -1156,15 +1163,24 @@ message RenameRepositoryRequest {
message RenameRepositoryResponse{
}
-// This comment is left unintentionally blank.
+// ReplicateRepositoryRequest is a request for the ReplicateRepository RPC.
message ReplicateRepositoryRequest {
- // This comment is left unintentionally blank.
+ // Repository is the target repository that the RPC replicates to.
Repository repository = 1 [(target_repository)=true];
- // This comment is left unintentionally blank.
+ // Source is the source repository that the RPC replicates from. This repository can sit on a
+ // different storage node. The information for how to connect to this storage node needs to be
+ // injected into the gRPC context by the caller by setting the `gitaly-servers` metadata.
Repository source = 2;
+ // ReplicateObjectDeduplicationNetworkMembership enables replication of the source repository's
+ // object pool to the target repository's storage and recreates the Git `alternates` link. If the
+ // source repository is not linked to an object pool, no linking or additional replication is
+ // performed. In the event the target repository is linked to an object pool, but the source
+ // repository is not part of an object deduplication network, the target repository is
+ // disconnected from its object pool.
+ bool replicate_object_deduplication_network_membership = 3;
}
-// This comment is left unintentionally blank.
+// ReplicateRepositoryResponse is a response for the ReplicateRepository RPC.
message ReplicateRepositoryResponse{
}
A merge request may have already been submitted, check that on [merge commit commit](c4d2e17461d8, as usually changes in Gitaly are not breaking, compliance becoming mandatory in the following development cycles.