Skip to content

Commit

Permalink
Use the latest version of buf (#121)
Browse files Browse the repository at this point in the history
It is more important for our repos to always track latest for dogfooding
purposes.

This is [what we are going to do in
bufbuild/buf](bufbuild/buf#3071).
  • Loading branch information
nicksnyder authored Jun 26, 2024
1 parent 1b1f67c commit 57ff078
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 36 deletions.
1 change: 0 additions & 1 deletion .github/workflows/buf-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ jobs:
- uses: bufbuild/[email protected]
with:
token: ${{ secrets.BUF_TOKEN }}
version: 1.32.2
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ BIN := .tmp/bin
export PATH := $(BIN):$(PATH)
export GOBIN := $(abspath $(BIN))

BUF_VERSION := 1.32.2
COPYRIGHT_YEARS := 2023-2024

.PHONY: help
Expand Down Expand Up @@ -56,8 +55,8 @@ checkgenerate:

$(BIN)/buf: Makefile
@mkdir -p $(@D)
go install github.com/bufbuild/buf/cmd/buf@v$(BUF_VERSION)
go install github.com/bufbuild/buf/cmd/buf@latest

$(BIN)/license-header: Makefile
@mkdir -p $(@D)
go install github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@v$(BUF_VERSION)
go install github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@latest
4 changes: 2 additions & 2 deletions buf/registry/module/v1/file.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ message File {
string path = 1 [
(buf.validate.field).required = true,
(buf.validate.field).string = {
max_len: 4096,
not_contains: "\\",
max_len: 4096
not_contains: "\\"
pattern: "^([^/.][^/]?|[^/][^/.]|[^/]{3,})(/([^/.][^/]?|[^/][^/.]|[^/]{3,}))*$"
}
];
Expand Down
8 changes: 4 additions & 4 deletions buf/registry/module/v1/label.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ message Label {
CommitCheckState commit_check_state = 10 [
(buf.validate.field).required = true,
(buf.validate.field).cel = {
id: "label_commit_check_state_status",
message: "commit_check_state must have a status of DISABLED, PASSED, or APPROVED",
expression: "this.status in [1, 2, 5]",
id: "label_commit_check_state_status"
message: "commit_check_state must have a status of DISABLED, PASSED, or APPROVED"
expression: "this.status in [1, 2, 5]"
}
];
}
Expand Down Expand Up @@ -137,7 +137,7 @@ message LabelRef {
];
// The name of the Module that contains the Label, either a User or Organization.
string module = 2 [(buf.validate.field).string = {
min_len: 2,
min_len: 2
max_len: 100
}];
// The Label name.
Expand Down
2 changes: 1 addition & 1 deletion buf/registry/module/v1/label_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ message ListLabelsRequest {
// It is an error to filter on CommitCheckStatuses of pending or rejected, as Labels will only
// point to Commits that are passed or approved, or that have policy checks disabled.
repeated CommitCheckStatus commit_check_statuses = 5 [(buf.validate.field).repeated.items.enum = {
defined_only: true,
defined_only: true
in: [
1,
2,
Expand Down
4 changes: 2 additions & 2 deletions buf/registry/module/v1/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ message Module {
//
// Unique within a given User or Organization.
string name = 4 [(buf.validate.field).string = {
min_len: 2,
min_len: 2
max_len: 100
}];
// The id of the User or Organization that owns the Module.
Expand Down Expand Up @@ -115,7 +115,7 @@ message ModuleRef {
];
// The name of the Module.
string module = 2 [(buf.validate.field).string = {
min_len: 2,
min_len: 2
max_len: 100
}];
}
Expand Down
2 changes: 1 addition & 1 deletion buf/registry/module/v1/module_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ message CreateModulesRequest {
buf.registry.owner.v1.OwnerRef owner_ref = 1 [(buf.validate.field).required = true];
// The name of the Module.
string name = 2 [(buf.validate.field).string = {
min_len: 2,
min_len: 2
max_len: 100
}];
// The module's visibility.
Expand Down
2 changes: 1 addition & 1 deletion buf/registry/module/v1/resource.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ message ResourceRef {
];
// The name of the Module that contains or is the resource.
string module = 2 [(buf.validate.field).string = {
min_len: 2,
min_len: 2
max_len: 100
}];
// If the oneof is present but empty, this should be treated as not present.
Expand Down
4 changes: 2 additions & 2 deletions buf/registry/module/v1beta1/file.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ message File {
string path = 1 [
(buf.validate.field).required = true,
(buf.validate.field).string = {
max_len: 4096,
not_contains: "\\",
max_len: 4096
not_contains: "\\"
pattern: "^([^/.][^/]?|[^/][^/.]|[^/]{3,})(/([^/.][^/]?|[^/][^/.]|[^/]{3,}))*$"
}
];
Expand Down
8 changes: 4 additions & 4 deletions buf/registry/module/v1beta1/label.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ message Label {
CommitCheckState commit_check_state = 10 [
(buf.validate.field).required = true,
(buf.validate.field).cel = {
id: "label_commit_check_state_status",
message: "commit_check_state must have a status of DISABLED, PASSED, or APPROVED",
expression: "this.status in [1, 2, 5]",
id: "label_commit_check_state_status"
message: "commit_check_state must have a status of DISABLED, PASSED, or APPROVED"
expression: "this.status in [1, 2, 5]"
}
];
}
Expand Down Expand Up @@ -137,7 +137,7 @@ message LabelRef {
];
// The name of the Module that contains the Label, either a User or Organization.
string module = 2 [(buf.validate.field).string = {
min_len: 2,
min_len: 2
max_len: 100
}];
// The Label name.
Expand Down
2 changes: 1 addition & 1 deletion buf/registry/module/v1beta1/label_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ message ListLabelsRequest {
// It is an error to filter on CommitCheckStatuses of pending or rejected, as Labels will only
// point to Commits that are passed or approved, or that have policy checks disabled.
repeated CommitCheckStatus commit_check_statuses = 5 [(buf.validate.field).repeated.items.enum = {
defined_only: true,
defined_only: true
in: [
1,
2,
Expand Down
4 changes: 2 additions & 2 deletions buf/registry/module/v1beta1/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ message Module {
//
// Unique within a given User or Organization.
string name = 4 [(buf.validate.field).string = {
min_len: 2,
min_len: 2
max_len: 100
}];
// The id of the User or Organization that owns the Module.
Expand Down Expand Up @@ -115,7 +115,7 @@ message ModuleRef {
];
// The name of the Module.
string module = 2 [(buf.validate.field).string = {
min_len: 2,
min_len: 2
max_len: 100
}];
}
Expand Down
2 changes: 1 addition & 1 deletion buf/registry/module/v1beta1/module_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ message CreateModulesRequest {
buf.registry.owner.v1.OwnerRef owner_ref = 1 [(buf.validate.field).required = true];
// The name of the Module.
string name = 2 [(buf.validate.field).string = {
min_len: 2,
min_len: 2
max_len: 100
}];
// The module's visibility.
Expand Down
2 changes: 1 addition & 1 deletion buf/registry/module/v1beta1/resource.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ message ResourceRef {
];
// The name of the Module that contains or is the resource.
string module = 2 [(buf.validate.field).string = {
min_len: 2,
min_len: 2
max_len: 100
}];
// If the oneof is present but empty, this should be treated as not present.
Expand Down
6 changes: 3 additions & 3 deletions buf/registry/owner/v1/organization.proto
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ message OrganizationRef {
string id = 1 [(buf.validate.field).string.tuuid = true];
// The name of the Organization.
string name = 2 [(buf.validate.field).string = {
min_len: 2;
max_len: 32;
pattern: "^[a-z][a-z0-9-]*[a-z0-9]$";
min_len: 2
max_len: 32
pattern: "^[a-z][a-z0-9-]*[a-z0-9]$"
}];
}
}
6 changes: 3 additions & 3 deletions buf/registry/owner/v1/owner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ message OwnerRef {
string id = 1 [(buf.validate.field).string.tuuid = true];
// The name of the User or Organization.
string name = 2 [(buf.validate.field).string = {
min_len: 2;
max_len: 32;
pattern: "^[a-z][a-z0-9-]*[a-z0-9]$";
min_len: 2
max_len: 32
pattern: "^[a-z][a-z0-9-]*[a-z0-9]$"
}];
}
}
6 changes: 3 additions & 3 deletions buf/registry/owner/v1/user.proto
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ message UserRef {
string id = 1 [(buf.validate.field).string.tuuid = true];
// The name of the User.
string name = 2 [(buf.validate.field).string = {
min_len: 2;
max_len: 32;
pattern: "^[a-z][a-z0-9-]*[a-z0-9]$";
min_len: 2
max_len: 32
pattern: "^[a-z][a-z0-9-]*[a-z0-9]$"
}];
}
}
2 changes: 1 addition & 1 deletion buf/registry/owner/v1/user_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ message UpdateUsersRequest {
optional string url = 4 [
(buf.validate.field).string.max_len = 255,
(buf.validate.field).cel = {
id: "string.uri",
id: "string.uri"
expression: "this == '' || this.isUri() ? '' : 'value must be a valid URI'"
}
];
Expand Down

0 comments on commit 57ff078

Please sign in to comment.