Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
saquibmian committed Nov 14, 2023
1 parent 5558e21 commit a5ee577
Showing 1 changed file with 42 additions and 25 deletions.
67 changes: 42 additions & 25 deletions buf/registry/module/v1beta1/tag_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ service TagService {
rpc CreateTags(CreateTagsRequest) returns (CreateTagsResponse) {
option idempotency_level = IDEMPOTENT;
}
// Move existing Tags on a Module.
// Create new Tags on a Module, and Update existing Tags on a Module.
//
// This operation is atomic. Either all Tags are moved or an error is returned.
rpc MoveTags(MoveTagsRequest) returns (MoveTagsResponse) {
// This operation is atomic. Either all Tags are created/updated or an error is returned.
rpc CreateOrUpdateTags(CreateOrUpdateTagsRequest) returns (CreateOrUpdateTagsResponse) {
option idempotency_level = IDEMPOTENT;
}
// Delete existing Tags.
Expand Down Expand Up @@ -101,18 +101,26 @@ message ListTagsResponse {
message CreateTagsRequest {
// An individual request to create a Tag.
message Value {
// The Module to create the Tag under.
ModuleRef module_ref = 1 [(buf.validate.field).required = true];
// The Tag name.
string name = 2 [
//
// If there is already a Tag with a name, the request errors. Otherwise, a new Tag will be
// created associated with the commit identified.
repeated string name = 1 [
(buf.validate.field).required = true,
(buf.validate.field).string.max_len = 250
];
// The id of the Commit associated with the Tag.
string commit_id = 3 [
(buf.validate.field).required = true,
(buf.validate.field).string.uuid = true
];
// The reference to resolve the Commit to which these Tags will be set.
//
// See the documentation on Ref for resource resolution details.
//
// The Tags are set depending on the kind of resource that is resolved:
// - If a Module is referenced, Tags are set to the latest released Commit in the module.
// - If a Commit is referenced, Tags are set for that Commit.
// - If a Tag is referenced, Tags are set for the Commit that this Tag references.
// - If a VCSCommit is referenced, Tags are set for the Commit that this VCSCommit references.
// - Is a Branch is referenced, Tags are set for the latest Commit on the Branch.
// - If a Digest is referenced, Tags are set for the most recent Commit with this Digest.
ResourceRef resource_ref = 2 [(buf.validate.field).required = true];
}
// The Tags to create.
repeated Value values = 1 [
Expand All @@ -126,31 +134,40 @@ message CreateTagsResponse {
repeated Tag tags = 1 [(buf.validate.field).repeated.min_items = 1];
}

message MoveTagsRequest {
// An individual request to move a Tag.
message CreateOrUpdateTagsRequest {
// An individual request to create or update a Tag.
message Value {
// The Module associated with the Tag.
ModuleRef module_ref = 1 [(buf.validate.field).required = true];
// The Tag name.
string name = 2 [
// The Tag names.
//
// If there is already a Tag with a name, it will be updated to be associated with
// the commit identified. Otherwise, a new Tag will be created associated with the
// commit identified.
repeated string name = 1 [
(buf.validate.field).required = true,
(buf.validate.field).string.max_len = 250
];
// The id of the Commit to associate with the Tag.
string commit_id = 3 [
(buf.validate.field).required = true,
(buf.validate.field).string.uuid = true
];
// The reference to resolve the Commit to which these Tags will be set.
//
// See the documentation on Ref for resource resolution details.
//
// The Tags are set depending on the kind of resource that is resolved:
// - If a Module is referenced, Tags are set to the latest released Commit in the module.
// - If a Commit is referenced, Tags are set for that Commit.
// - If a Tag is referenced, Tags are set for the Commit that this Tag references.
// - If a VCSCommit is referenced, Tags are set for the Commit that this VCSCommit references.
// - Is a Branch is referenced, Tags are set for the latest Commit on the Branch.
// - If a Digest is referenced, Tags are set for the most recent Commit with this Digest.
ResourceRef resource_ref = 2 [(buf.validate.field).required = true];
}
// The Tags to move.
// The Tags to create or update.
repeated Value values = 1 [
(buf.validate.field).repeated.min_items = 1,
(buf.validate.field).repeated.max_items = 250
];
}

message MoveTagsResponse {
// The moved Tags in the same order as given on the request.
message CreateOrUpdateTagsResponse {
// The created or updated Tags in the same order as given on the request.
repeated Tag tags = 1 [(buf.validate.field).repeated.min_items = 1];
}

Expand Down

0 comments on commit a5ee577

Please sign in to comment.