diff --git a/doc/config-schema.md b/doc/config-schema.md index d0789997e3..744a6f32fb 100644 --- a/doc/config-schema.md +++ b/doc/config-schema.md @@ -602,7 +602,6 @@ This document describes the schema for the librarian.yaml. | `default_transport` | string | Specifies the default transport protocol for unary methods ("grpc" or "http"). This overrides the crate-level setting. | | `detailed_tracing_attributes` | bool (optional) | Indicates whether to include detailed tracing attributes. This overrides the crate-level setting. | | `documentation_overrides` | list of [RustDocumentationOverride](#rustdocumentationoverride-configuration) | Contains overrides for element documentation. | -| `extend_grpc_transport` | bool | Indicates whether the transport stub can be extended (in order to support streams). | | `generate_setter_samples` | string | Indicates whether to generate setter samples. | | `generate_rpc_samples` | string | Indicates whether to generate RPC samples. | | `has_veneer` | bool | Indicates whether this module has a handwritten wrapper. | diff --git a/internal/config/language.go b/internal/config/language.go index 2beb6d98f4..4060fe45e3 100644 --- a/internal/config/language.go +++ b/internal/config/language.go @@ -190,10 +190,6 @@ type RustModule struct { // DocumentationOverrides contains overrides for element documentation. DocumentationOverrides []RustDocumentationOverride `yaml:"documentation_overrides,omitempty"` - // ExtendGrpcTransport indicates whether the transport stub can be - // extended (in order to support streams). - ExtendGrpcTransport bool `yaml:"extend_grpc_transport,omitempty"` - // GenerateSetterSamples indicates whether to generate setter samples. GenerateSetterSamples string `yaml:"generate_setter_samples,omitempty"` diff --git a/internal/librarian/rust/codec.go b/internal/librarian/rust/codec.go index a5423b861f..b95898517a 100644 --- a/internal/librarian/rust/codec.go +++ b/internal/librarian/rust/codec.go @@ -372,9 +372,6 @@ func buildModuleCodec(library *config.Library, module *config.RustModule) map[st if module.RoutingRequired { codec["routing-required"] = "true" } - if module.ExtendGrpcTransport { - codec["extend-grpc-transport"] = "true" - } if module.Template != "" { codec["template-override"] = "templates/" + module.Template } diff --git a/internal/librarian/rust/codec_test.go b/internal/librarian/rust/codec_test.go index 88344407d8..29349b3984 100644 --- a/internal/librarian/rust/codec_test.go +++ b/internal/librarian/rust/codec_test.go @@ -1244,16 +1244,6 @@ func TestBuildModuleCodec(t *testing.T) { "routing-required": "true", }, }, - { - name: "with ExtendGrpcTransport", - library: &config.Library{}, - module: &config.RustModule{ - ExtendGrpcTransport: true, - }, - want: map[string]string{ - "extend-grpc-transport": "true", - }, - }, { name: "with Template prepends templates/", library: &config.Library{}, @@ -1340,7 +1330,6 @@ func TestBuildModuleCodec(t *testing.T) { NameOverrides: "a=b", PostProcessProtos: "post", RoutingRequired: true, - ExtendGrpcTransport: true, Template: "grpc-client", DisabledRustdocWarnings: []string{"w1", "w2"}, RootName: "my-root", @@ -1362,7 +1351,6 @@ func TestBuildModuleCodec(t *testing.T) { "name-overrides": "a=b", "post-process-protos": "post", "routing-required": "true", - "extend-grpc-transport": "true", "template-override": "templates/grpc-client", "root-name": "my-root", "internal-builders": "true", diff --git a/internal/sidekick/rust/annotate_service.go b/internal/sidekick/rust/annotate_service.go index e1f8d016ab..e680b014c6 100644 --- a/internal/sidekick/rust/annotate_service.go +++ b/internal/sidekick/rust/annotate_service.go @@ -46,9 +46,6 @@ type serviceAnnotations struct { PerServiceFeatures bool // If true, there is a handwritten client surface. HasVeneer bool - // If true, the transport stub is extensible from outside of - // `transport.rs`. This is done to add ad-hoc streaming support. - ExtendGrpcTransport bool // If true, the service has a method we cannot wrap (yet). Incomplete bool // If true, the generated code includes detailed tracing attributes on HTTP @@ -229,7 +226,6 @@ func (c *codec) annotateService(s *api.Service) (*serviceAnnotations, error) { APITitle: s.Model().Title, PerServiceFeatures: c.perServiceFeatures, HasVeneer: c.serviceHasVeneer(s.ID()), - ExtendGrpcTransport: c.extendGrpcTransport, Incomplete: slices.ContainsFunc(allMethods, func(m *api.Method) bool { return !c.generateMethod(m) }), DetailedTracingAttributes: c.detailedTracingAttributes, InternalBuilders: c.serviceInternalBuilders(s.ID()), diff --git a/internal/sidekick/rust/annotate_service_test.go b/internal/sidekick/rust/annotate_service_test.go index 65ce5e27c6..3e36e2fd0e 100644 --- a/internal/sidekick/rust/annotate_service_test.go +++ b/internal/sidekick/rust/annotate_service_test.go @@ -24,23 +24,6 @@ import ( "github.com/googleapis/librarian/internal/sidekick/api/apitest" ) -func TestServiceAnnotationsExtendGrpcTransport(t *testing.T) { - model := serviceAnnotationsModel() - service := model.Service(".test.v1.ResourceService") - if service == nil { - t.Fatal("cannot find .test.v1.ResourceService") - } - codec := newTestCodec(t, libconfig.SpecProtobuf, "", map[string]string{ - "extend-grpc-transport": "true", - }) - annotateModel(model, codec) - serviceAnn := service.Codec().(*serviceAnnotations) - - if !serviceAnn.ExtendGrpcTransport { - t.Errorf("expected `extend-grpc-transport` to be set on the service.") - } -} - func TestServiceAnnotationsDetailedTracing(t *testing.T) { model := serviceAnnotationsModel() service := model.Service(".test.v1.ResourceService") diff --git a/internal/sidekick/rust/codec.go b/internal/sidekick/rust/codec.go index c26a2d990b..1eb794fb0d 100644 --- a/internal/sidekick/rust/codec.go +++ b/internal/sidekick/rust/codec.go @@ -167,12 +167,6 @@ func newCodec(specificationFormat string, options map[string]string) (*codec, er return nil, fmt.Errorf("cannot convert `routing-required` value %q to boolean: %w", definition, err) } codec.routingRequired = value - case key == "extend-grpc-transport": - value, err := strconv.ParseBool(definition) - if err != nil { - return nil, fmt.Errorf("cannot convert `extend-grpc-transport` value %q to boolean: %w", definition, err) - } - codec.extendGrpcTransport = value case key == "generate-setter-samples": value, err := strconv.ParseBool(definition) if err != nil { @@ -359,12 +353,6 @@ type codec struct { // If true, fail requests locally that do not yield a gRPC routing // header. routingRequired bool - // If true, the transport stub is extensible from outside of - // `transport.rs`. This is done to add ad-hoc streaming support. - // - // This is an option, because we don't want to change all of the client - // libraries for a feature only needed in one library (at the moment). - extendGrpcTransport bool // If true, the generator will produce reference documentation samples for message fields setters. generateSetterSamples bool // If true, the generator will produce reference documentation samples for functions that correspond to RPCs. diff --git a/internal/sidekick/rust/codec_test.go b/internal/sidekick/rust/codec_test.go index 2e9b3b19a4..6064e8dd86 100644 --- a/internal/sidekick/rust/codec_test.go +++ b/internal/sidekick/rust/codec_test.go @@ -306,15 +306,6 @@ func TestParseOptions(t *testing.T) { c.routingRequired = true }, }, - { - Format: libconfig.SpecProtobuf, - Options: map[string]string{ - "extend-grpc-transport": "true", - }, - Update: func(c *codec) { - c.extendGrpcTransport = true - }, - }, { Format: libconfig.SpecProtobuf, Options: map[string]string{ diff --git a/internal/sidekick/rust/templates/grpc-client/transport.rs.gotmpl b/internal/sidekick/rust/templates/grpc-client/transport.rs.gotmpl index d4065076ac..d84bd50c84 100644 --- a/internal/sidekick/rust/templates/grpc-client/transport.rs.gotmpl +++ b/internal/sidekick/rust/templates/grpc-client/transport.rs.gotmpl @@ -57,11 +57,7 @@ mod info { {{- end }} #[derive(Clone)] pub struct {{ .Codec.Name }} { - {{- if .Codec.ExtendGrpcTransport }} pub(crate) inner: {{ .Codec.GrpcClient }}, - {{- else }} - inner: {{ .Codec.GrpcClient }}, - {{- end }} } {{ if .Codec.PerServiceFeatures }}