From 1f328a091a243f0822c7227791f2942affb68418 Mon Sep 17 00:00:00 2001 From: vdaas-ci <57942646+vdaas-ci@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:50:15 +0900 Subject: [PATCH] Buf CLI migrate to v2 (#2691) (#2695) * migrate to v2 * replace * format --------- Signed-off-by: Kosuke Morimoto Co-authored-by: Kosuke Morimoto Co-authored-by: Yusuke Kato --- apis/proto/buf.lock | 13 ------ buf.gen.yaml | 45 +++++++++---------- buf.lock | 9 ++++ buf.work.yaml | 18 -------- apis/proto/buf.yaml => buf.yaml | 23 +++++++--- rust/libs/proto/src/filter.egress.v1.tonic.rs | 4 -- .../libs/proto/src/filter.ingress.v1.tonic.rs | 4 -- rust/libs/proto/src/meta.v1.tonic.rs | 2 - rust/libs/proto/src/vald.v1.tonic.rs | 8 ---- 9 files changed, 45 insertions(+), 81 deletions(-) delete mode 100644 apis/proto/buf.lock create mode 100644 buf.lock delete mode 100644 buf.work.yaml rename apis/proto/buf.yaml => buf.yaml (77%) diff --git a/apis/proto/buf.lock b/apis/proto/buf.lock deleted file mode 100644 index 4666efd537..0000000000 --- a/apis/proto/buf.lock +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: bufbuild - repository: protovalidate - commit: 1baebb0a15184714854fa1ddfd22a29b - digest: shake256:ecd24ac37ca4f1ea65d816ae98e2a977e5004076ac957de9aedc0d4b517c66eaf3b7c8d6c7669ffd6e2eca5e8a5705372bed339ba47a608b37183ef1ee4f8baf - - remote: buf.build - owner: googleapis - repository: googleapis - commit: 28151c0d0a1641bf938a7672c500e01d - digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de diff --git a/buf.gen.yaml b/buf.gen.yaml index 04cc738bd4..f1f58bb6ba 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -13,40 +13,35 @@ # See the License for the specific language governing permissions and # limitations under the License. # -version: v1 +version: v2 managed: - enabled: false - go_package_prefix: - default: github.com/vdaas/vald/apis/grpc - except: - - buf.build/googleapis/googleapis + disable: + - file_option: go_package + module: buf.build/googleapis/googleapis + override: + - file_option: go_package_prefix + value: github.com/vdaas/vald/apis/grpc plugins: - - plugin: buf.build/protocolbuffers/go + - remote: buf.build/protocolbuffers/go out: apis/grpc - opt: - - paths=source_relative - - plugin: buf.build/community/planetscale-vtprotobuf + opt: paths=source_relative + - remote: buf.build/community/planetscale-vtprotobuf out: apis/grpc opt: - paths=source_relative - features=grpc+marshal+unmarshal+size+equal+clone - - plugin: buf.build/community/mfridman-go-json + - remote: buf.build/community/mfridman-go-json out: apis/grpc - opt: - - paths=source_relative - - plugin: buf.build/community/pseudomuto-doc + opt: paths=source_relative + - remote: buf.build/community/pseudomuto-doc out: apis/docs/v1 - opt: - - markdown,docs.md - - plugin: buf.build/grpc-ecosystem/openapiv2 + opt: markdown,docs.md + - remote: buf.build/grpc-ecosystem/openapiv2 out: apis/swagger - opt: - - json_names_for_fields=true - - plugin: buf.build/community/neoeinstein-prost + opt: json_names_for_fields=true + - remote: buf.build/community/neoeinstein-prost out: rust/libs/proto/src - opt: - - enable_type_names - - plugin: buf.build/community/neoeinstein-tonic + opt: enable_type_names + - remote: buf.build/community/neoeinstein-tonic out: rust/libs/proto/src - opt: - - no_include + opt: no_include diff --git a/buf.lock b/buf.lock new file mode 100644 index 0000000000..fe0ef317bb --- /dev/null +++ b/buf.lock @@ -0,0 +1,9 @@ +# Generated by buf. DO NOT EDIT. +version: v2 +deps: + - name: buf.build/bufbuild/protovalidate + commit: 1baebb0a15184714854fa1ddfd22a29b + digest: b5:6ee11b05d5f54b6257c79c3141eb1050723c4433cf490259ba1d8c02cd08c3e325625527b00fec4dc8b338901f1f3c567ef7ff0698b1c92d09b2dfa6f516c1e6 + - name: buf.build/googleapis/googleapis + commit: 28151c0d0a1641bf938a7672c500e01d + digest: b5:93b70089baa4fc05a92d3e52db91a4b7812db3b57b9664f6cb301733938cb630e377a938e8a56779388171c749c1d42a2e9a6c6230f2ff45f127a8102a6a27d0 diff --git a/buf.work.yaml b/buf.work.yaml deleted file mode 100644 index eae1124224..0000000000 --- a/buf.work.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (C) 2019-2024 vdaas.org vald team -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# You may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -version: v1 -directories: - - apis/proto diff --git a/apis/proto/buf.yaml b/buf.yaml similarity index 77% rename from apis/proto/buf.yaml rename to buf.yaml index afeb16b0b4..b6d71dcb1f 100644 --- a/apis/proto/buf.yaml +++ b/buf.yaml @@ -13,13 +13,22 @@ # See the License for the specific language governing permissions and # limitations under the License. # -version: v1 -breaking: - use: - - FILE -lint: - use: - - DEFAULT +version: v2 +modules: + - path: apis/proto deps: - buf.build/bufbuild/protovalidate - buf.build/googleapis/googleapis +lint: + use: + - STANDARD + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + disallow_comment_ignores: true +breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT diff --git a/rust/libs/proto/src/filter.egress.v1.tonic.rs b/rust/libs/proto/src/filter.egress.v1.tonic.rs index 9627dbcf2c..74102173ce 100644 --- a/rust/libs/proto/src/filter.egress.v1.tonic.rs +++ b/rust/libs/proto/src/filter.egress.v1.tonic.rs @@ -17,8 +17,6 @@ pub mod filter_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /** Represent the egress filter service. -*/ #[derive(Debug, Clone)] pub struct FilterClient { inner: tonic::client::Grpc, @@ -189,8 +187,6 @@ pub mod filter_server { tonic::Status, >; } - /** Represent the egress filter service. -*/ #[derive(Debug)] pub struct FilterServer { inner: Arc, diff --git a/rust/libs/proto/src/filter.ingress.v1.tonic.rs b/rust/libs/proto/src/filter.ingress.v1.tonic.rs index 76f377386b..d8b462caa1 100644 --- a/rust/libs/proto/src/filter.ingress.v1.tonic.rs +++ b/rust/libs/proto/src/filter.ingress.v1.tonic.rs @@ -17,8 +17,6 @@ pub mod filter_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /** Represent the ingress filter service. -*/ #[derive(Debug, Clone)] pub struct FilterClient { inner: tonic::client::Grpc, @@ -189,8 +187,6 @@ pub mod filter_server { tonic::Status, >; } - /** Represent the ingress filter service. -*/ #[derive(Debug)] pub struct FilterServer { inner: Arc, diff --git a/rust/libs/proto/src/meta.v1.tonic.rs b/rust/libs/proto/src/meta.v1.tonic.rs index 7f106ee0ca..b683ff6440 100644 --- a/rust/libs/proto/src/meta.v1.tonic.rs +++ b/rust/libs/proto/src/meta.v1.tonic.rs @@ -97,7 +97,6 @@ pub mod meta_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// pub async fn get( &mut self, request: impl tonic::IntoRequest, @@ -177,7 +176,6 @@ pub mod meta_server { /// Generated trait containing gRPC methods that should be implemented for use with MetaServer. #[async_trait] pub trait Meta: Send + Sync + 'static { - /// async fn get( &self, request: tonic::Request, diff --git a/rust/libs/proto/src/vald.v1.tonic.rs b/rust/libs/proto/src/vald.v1.tonic.rs index 29843a4d93..7cc2207e61 100644 --- a/rust/libs/proto/src/vald.v1.tonic.rs +++ b/rust/libs/proto/src/vald.v1.tonic.rs @@ -124,8 +124,6 @@ pub mod filter_client { .insert(GrpcMethod::new("vald.v1.Filter", "SearchObject")); self.inner.unary(req, path, codec).await } - /** A method to search multiple objects. -*/ pub async fn multi_search_object( &mut self, request: impl tonic::IntoRequest< @@ -477,8 +475,6 @@ pub mod filter_server { tonic::Response, tonic::Status, >; - /** A method to search multiple objects. -*/ async fn multi_search_object( &self, request: tonic::Request< @@ -4046,8 +4042,6 @@ pub mod search_client { req.extensions_mut().insert(GrpcMethod::new("vald.v1.Search", "Search")); self.inner.unary(req, path, codec).await } - /** A method to search indexed vectors by ID. -*/ pub async fn search_by_id( &mut self, request: impl tonic::IntoRequest< @@ -4398,8 +4392,6 @@ pub mod search_server { tonic::Response, tonic::Status, >; - /** A method to search indexed vectors by ID. -*/ async fn search_by_id( &self, request: tonic::Request,