Skip to content

Commit

Permalink
fix: Partially revert #41735 ("Buf config v2") (#41812)
Browse files Browse the repository at this point in the history
* Revert "chore: Bump Buf to v1.32.0 and move to v2 (#41735)"

This reverts commit c585850.

* Bump Buf to v1.32.0

* Update generated protos
  • Loading branch information
codingllama authored May 21, 2024
1 parent cbbf4bd commit b8dd19a
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 107 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ protos/format: buf/installed
.PHONY: protos/lint
protos/lint: buf/installed
$(BUF) lint
$(BUF) lint --config=buf-legacy.yaml api/proto
$(BUF) lint --config=api/proto/buf-legacy.yaml api/proto

.PHONY: protos/breaking
protos/breaking: BASE=origin/master
Expand Down
14 changes: 2 additions & 12 deletions buf-legacy.yaml → api/proto/buf-legacy.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
# buf-legacy.yaml is used so we can apply tighter settings to legacy protos.
# This should be used exclusively to lint legacy protos, all other actions
# should use the default buf.yaml file.
version: v2

modules:
- path: api/proto

version: v1
deps:
# gogo/protobuf v1.3.2, keep in sync with build.assets/versions.mk.
# gogo/protobuf v1.3.2, keep in sync with build.assets/Makefile.
- buf.build/gogo/protobuf:b03c65ea87cdc3521ede29f62fe3ce239267c1bc
- buf.build/googleapis/googleapis:beb34b4050abfcfff72ff5cc6a28f0afa4043ce0

lint:
use:
- DEFAULT
Expand All @@ -35,7 +26,6 @@ lint:
- RPC_REQUEST_RESPONSE_UNIQUE
- RPC_REQUEST_STANDARD_NAME
- RPC_RESPONSE_STANDARD_NAME

breaking:
use:
- "buf-legacy.yaml should not be used for buf breaking"
11 changes: 11 additions & 0 deletions api/proto/buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: gogo
repository: protobuf
commit: 4df00b267f944190a229ce3695781e99
- remote: buf.build
owner: googleapis
repository: googleapis
commit: d1263fe26f8e430a967dc22a4d0cad18
65 changes: 65 additions & 0 deletions api/proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: v1
deps:
# gogo/protobuf v1.3.2, keep in sync with build.assets/Makefile.
- buf.build/gogo/protobuf:b03c65ea87cdc3521ede29f62fe3ce239267c1bc
- buf.build/googleapis/googleapis:beb34b4050abfcfff72ff5cc6a28f0afa4043ce0
lint:
use:
- DEFAULT
- PACKAGE_NO_IMPORT_CYCLE
- UNARY_RPC
# Top-level types require comments.
- COMMENT_ENUM
- COMMENT_MESSAGE
- COMMENT_RPC
- COMMENT_SERVICE
except:
# Allow Google API-style responses (CreateFoo returns Foo).
# See https://cloud.google.com/apis/design/standard_methods.
- RPC_REQUEST_RESPONSE_UNIQUE
- RPC_RESPONSE_STANDARD_NAME
ignore:
- teleport/legacy/client/proto/authservice.proto
- teleport/legacy/client/proto/certs.proto
- teleport/legacy/client/proto/event.proto
- teleport/legacy/client/proto/proxyservice.proto
- teleport/legacy/types/events/events.proto
- teleport/legacy/types/events/athena.proto
- teleport/legacy/types/types.proto
- teleport/legacy/types/wrappers/wrappers.proto
ignore_only:
# Allow package/directory mismatch for legacy protos.
FIELD_LOWER_SNAKE_CASE:
- teleport/legacy/types/device.proto
# Allow package/directory mismatch for legacy protos.
PACKAGE_DIRECTORY_MATCH:
- teleport/legacy/client/proto/joinservice.proto
- teleport/legacy/types/device.proto
- teleport/legacy/types/webauthn/webauthn.proto
# Allow non-versioned packages for legacy protos.
PACKAGE_VERSION_SUFFIX:
- teleport/legacy/client/proto/joinservice.proto
- teleport/legacy/types/device.proto
- teleport/legacy/types/webauthn/webauthn.proto
# Allow only certain services to use streaming RPCs.
#
# We should avoid streaming RPCs until we have a compelling reason to use them (e.g. the
# implementation needs 1-N messages or the server cannot dial directly to the client).
#
# Check out the links below. If you still have questions or doubts, reach out to @codingllama.
#
# https://docs.buf.build/lint/rules#unary_rpc
# https://github.com/gravitational/teleport/pull/16043#issuecomment-1235728212
# https://github.com/twitchtv/twirp/issues/70#issuecomment-470367807
UNARY_RPC:
- teleport/devicetrust/v1/devicetrust_service.proto
- teleport/legacy/client/proto/joinservice.proto
- teleport/transport/v1/transport_service.proto
- teleport/auditlog/v1/auditlog.proto
breaking:
use:
- WIRE_JSON
- ENUM_VALUE_NO_DELETE
ignore_only:
RESERVED_ENUM_NO_DELETE:
- teleport/legacy/types/types.proto
9 changes: 0 additions & 9 deletions buf.lock

This file was deleted.

4 changes: 4 additions & 0 deletions buf.work.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: v1
directories:
- api/proto
- proto
85 changes: 0 additions & 85 deletions buf.yaml

This file was deleted.

66 changes: 66 additions & 0 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: v1
deps:
# gogo/protobuf v1.3.2, keep in sync with build.assets/Makefile.
- buf.build/gogo/protobuf:b03c65ea87cdc3521ede29f62fe3ce239267c1bc
lint:
use:
- DEFAULT
- PACKAGE_NO_IMPORT_CYCLE
- UNARY_RPC
# Top-level types require comments.
- COMMENT_ENUM
- COMMENT_MESSAGE
- COMMENT_RPC
- COMMENT_SERVICE
except:
# Allow Google API-style responses (CreateFoo returns Foo).
# See https://cloud.google.com/apis/design/standard_methods.
- RPC_REQUEST_RESPONSE_UNIQUE
- RPC_RESPONSE_STANDARD_NAME
ignore:
# "legacy" lib protos.
- teleport/lib/multiplexer/test/ping.proto
- teleport/lib/web/envelope.proto
ignore_only:
# Allow only certain services to use streaming RPCs.
#
# We should avoid streaming RPCs until we have a compelling reason to use them (e.g. the
# implementation needs 1-N messages or the server cannot dial directly to the client).
#
# Check out the links below. If you still have questions or doubts, reach out to @codingllama.
#
# https://docs.buf.build/lint/rules#unary_rpc
# https://github.com/gravitational/teleport/pull/16043#issuecomment-1235728212
# https://github.com/twitchtv/twirp/issues/70#issuecomment-470367807
UNARY_RPC:
- teleport/lib/teleterm/v1/service.proto
- accessgraph/v1alpha/access_graph_service.proto
# TODO(ravicious): Fix protos and re-enable lib/teleterm lint rules below.
RPC_REQUEST_STANDARD_NAME:
- teleport/lib/teleterm/v1/service.proto
# TODO(espadolini): Fix protos and re-enable prehog lint rules below.
COMMENT_MESSAGE:
- prehog
- teleport/lib/teleterm/v1/access_request.proto
- teleport/lib/teleterm/v1/app.proto
- teleport/lib/teleterm/v1/auth_settings.proto
- teleport/lib/teleterm/v1/cluster.proto
- teleport/lib/teleterm/v1/database.proto
- teleport/lib/teleterm/v1/gateway.proto
- teleport/lib/teleterm/v1/kube.proto
- teleport/lib/teleterm/v1/label.proto
- teleport/lib/teleterm/v1/server.proto
- teleport/lib/teleterm/v1/service.proto
- teleport/lib/teleterm/v1/tshd_events_service.proto
- teleport/lib/teleterm/v1/usage_events.proto
COMMENT_RPC:
- prehog
COMMENT_SERVICE:
- prehog
breaking:
use:
- WIRE_JSON
- ENUM_VALUE_NO_DELETE
ignore_only:
RESERVED_ENUM_NO_DELETE:
- teleport/legacy/types/types.proto

0 comments on commit b8dd19a

Please sign in to comment.