Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/config-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
4 changes: 0 additions & 4 deletions internal/config/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down
3 changes: 0 additions & 3 deletions internal/librarian/rust/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
12 changes: 0 additions & 12 deletions internal/librarian/rust/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 0 additions & 4 deletions internal/sidekick/rust/annotate_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()),
Expand Down
17 changes: 0 additions & 17 deletions internal/sidekick/rust/annotate_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
12 changes: 0 additions & 12 deletions internal/sidekick/rust/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down
9 changes: 0 additions & 9 deletions internal/sidekick/rust/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Loading