Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mfridman committed Oct 2, 2024
1 parent 7741a6b commit 365a2e4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 25 deletions.
17 changes: 4 additions & 13 deletions buf/registry/plugin/v1beta1/commit.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ option go_package = "buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/r
//
// Many Commits may be associated with one Digest.
//
// Not that the Digest returned on a Commit depends on the requested DigestType in the
// RPC that returned the Commit.
// Not that the Digest returned on a Commit depends on the requested DigestType in the RPC that
// returned the Commit.
message Commit {
option (buf.registry.priv.extension.v1beta1.message).response_only = true;

Expand All @@ -43,7 +43,7 @@ message Commit {
//
// Commits are immutable, so there is no corresponding update_time.
google.protobuf.Timestamp create_time = 2 [(buf.validate.field).required = true];
// The id of the User or Organization that owns the Plugin that the Commit is associated with.
// The id of the Organization that owns the Plugin that the Commit is associated with.
string owner_id = 3 [
(buf.validate.field).required = true,
(buf.validate.field).string.tuuid = true
Expand All @@ -69,15 +69,14 @@ message Commit {
(buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
];
// The SPDX identifier of the license of the Plugin.
string license_spdx_identifier = 8;
string spdx_license_id = 8;
// The plugin types the Commit supports. Must have at least one element.
repeated PluginType plugin_type = 9 [
(buf.validate.field).repeated.min_items = 1,
(buf.validate.field).repeated.unique = true,
(buf.validate.field).repeated.items.enum.defined_only = true,
(buf.validate.field).repeated.items.enum.not_in = 0
];
//
}

// The type of the Plugin.
Expand All @@ -88,14 +87,6 @@ enum PluginType {
PLUGIN_TYPE_CHECK = 3;
}

// The configuration for a check plugin.
//
// TODO(mf): we might want to remove this entirely, as it's not clear what this would be used for.
// The Rules and Categories are a property of the plugin itself, and not what a user would define.
// At most we'll want to keep this around for Responses to surface Rules and/or Categories, but this
// is not clear yet.
message CheckConfig {}

// The runtime type of the Commit.
enum RuntimeType {
RUNTIME_TYPE_UNSPECIFIED = 0;
Expand Down
4 changes: 2 additions & 2 deletions buf/registry/plugin/v1beta1/commit_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ message GetCommitsRequest {
// If this DigestType is not available, an error is returned.
// Note that certain DigestTypes may be deprecated over time.
//
// If not set, the latest DigestType is used, currently B5.
// If not set, the latest DigestType is used, currently p1.
DigestType digest_type = 2 [(buf.validate.field).enum.defined_only = true];
}

Expand Down Expand Up @@ -98,7 +98,7 @@ message ListCommitsRequest {
// If this DigestType is not available, an error is returned.
// Note that certain DigestTypes may be deprecated over time.
//
// If not set, the latest DigestType is used, currently B5.
// If not set, the latest DigestType is used, currently p1.
DigestType digest_type = 5 [(buf.validate.field).enum.defined_only = true];
// Only return Commits with an id that contains this string using a case-insensitive comparison.
string id_query = 6 [(buf.validate.field).string.max_len = 36];
Expand Down
14 changes: 7 additions & 7 deletions buf/registry/plugin/v1beta1/download_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ message DownloadResponse {
message Content {
// The Commit associated with the Content.
Commit commit = 1 [(buf.validate.field).required = true];
// TODO: compression? // Compression type of the content. CompressionType compression_type = 1 [
//(buf.validate.field).required = true, (buf.validate.field).enum.defined_only = true ]; The
//content.
bytes content = 2 [(buf.validate.field).required = true];

// TODO(mf): do we want to include the original PluginRef and Reference here? There might be an
// opportunity to encapsulate the content in a container type similar to Commit.
// Compression type of the content.
CompressionType compression_type = 2 [
(buf.validate.field).required = true,
(buf.validate.field).enum.defined_only = true
];
// The content.
bytes content = 3 [(buf.validate.field).required = true];
}
repeated Content contents = 1 [(buf.validate.field).repeated.min_items = 1];
}
4 changes: 2 additions & 2 deletions buf/registry/plugin/v1beta1/label.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ message LabelRef {
// A Name uniquely identifies a Label. This is used for requests when a caller only has the label
// name and not the ID.
message Name {
// The name of the owner of the Plugin that contains the Label, either a User or Organization.
// The name of the owner of the Plugin that contains the Label, an Organization.
string owner = 1 [
(buf.validate.field).required = true,
(buf.validate.field).string.max_len = 32
];
// The name of the Plugin that contains the Label, either a User or Organization.
// The name of the Plugin that contains the Label.
string plugin = 2 [(buf.validate.field).string = {
min_len: 2
max_len: 100
Expand Down
2 changes: 1 addition & 1 deletion buf/registry/plugin/v1beta1/resource.proto
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ message ResourceRef {
// Names can only be used in requests, and only for read-only RPCs, that is you should not use an
// arbitrary reference when modifying a specific resource.
message Name {
// The name of the User or Organization that owns the resource.
// The name of the Organization that owns the resource.
string owner = 1 [
(buf.validate.field).required = true,
(buf.validate.field).string.max_len = 32
Expand Down

0 comments on commit 365a2e4

Please sign in to comment.