Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: connectrpc/connect-go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.18.0
Choose a base ref
...
head repository: connectrpc/connect-go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.18.1
Choose a head ref
  • 3 commits
  • 7 files changed
  • 1 contributor

Commits on Jan 8, 2025

  1. Back to development (#806)

    <!--
    Before submitting your PR, please read through the contribution guide!
    
    
    https://github.com/connectrpc/connect-go/blob/main/.github/CONTRIBUTING.md
    -->
    
    Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
    emcfarlane authored Jan 8, 2025

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    867dac8 View commit details
  2. Fix protoc-gen-go schema variable case handling (#808)

    <!--
    Before submitting your PR, please read through the contribution guide!
    
    
    https://github.com/connectrpc/connect-go/blob/main/.github/CONTRIBUTING.md
    -->
    This fixes the handling of various casing when generating the service
    methods variable.
    
    Fixes #807
    
    Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
    emcfarlane authored Jan 8, 2025
    Copy the full SHA
    044befe View commit details
  3. Prepare for v1.18.1 (#809)

    Below are the draft notes for the release, this is a patch release to
    fix the protoc-gen-connect-go issue:
    
    ----
    # v1.18.1
    
    ## What's Changed
    ### Bugfixes
    * Fix protoc-gen-connect-go schema variable case handling by @emcfarlane
    in #808
    
    
    **Full Changelog**:
    v1.18.0...v1.18.1
    
    Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
    emcfarlane authored Jan 8, 2025
    Copy the full SHA
    46c8b00 View commit details
8 changes: 6 additions & 2 deletions cmd/protoc-gen-connect-go/main.go
Original file line number Diff line number Diff line change
@@ -259,7 +259,7 @@ func generateServiceMethodsVar(g *protogen.GeneratedFile, file *protogen.File, s
if len(service.Methods) == 0 {
return
}
serviceMethodsName := unexport(fmt.Sprintf("%sMethods", service.Desc.Name()))
serviceMethodsName := serviceVarMethodsName(service)
g.P(serviceMethodsName, ` := `,
g.QualifiedGoIdent(file.GoDescriptorIdent),
`.Services().ByName("`, service.Desc.Name(), `").Methods()`)
@@ -558,8 +558,12 @@ func procedureHandlerName(m *protogen.Method) string {
return fmt.Sprintf("%s%sHandler", unexport(m.Parent.GoName), m.GoName)
}

func serviceVarMethodsName(m *protogen.Service) string {
return unexport(fmt.Sprintf("%sMethods", m.GoName))
}

func procedureVarMethodDescriptor(m *protogen.Method) string {
serviceMethodsName := unexport(fmt.Sprintf("%sMethods", m.Parent.GoName))
serviceMethodsName := serviceVarMethodsName(m.Parent)
return serviceMethodsName + `.ByName("` + string(m.Desc.Name()) + `")`
}

1 change: 1 addition & 0 deletions cmd/protoc-gen-connect-go/main_test.go
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@ import (
"connectrpc.com/connect/cmd/protoc-gen-connect-go/testdata/diffpackage/diffpackagediff"
"connectrpc.com/connect/cmd/protoc-gen-connect-go/testdata/noservice"
"connectrpc.com/connect/cmd/protoc-gen-connect-go/testdata/samepackage"
_ "connectrpc.com/connect/cmd/protoc-gen-connect-go/testdata/v1beta1service"
)

//go:embed testdata
15 changes: 15 additions & 0 deletions cmd/protoc-gen-connect-go/testdata/v1beta1service/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: v2
managed:
enabled: true
override:
- file_option: go_package_prefix
value: connectrpc.com/connect/cmd/protoc-gen-connect-go/testdata/v1beta1service
plugins:
- local: protoc-gen-go
out: .
opt: paths=source_relative
- local: protoc-gen-connect-go
out: .
opt:
- paths=source_relative
- package_suffix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

188 changes: 188 additions & 0 deletions cmd/protoc-gen-connect-go/testdata/v1beta1service/v1beta1service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2021-2024 The Connect Authors
//
// 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
//
// http://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.

// This file tests varying casing of the service name and method name.
syntax = "proto3";

package example;

message GetExample_Request {}

message Get1example_response {}

service ExampleV1beta {
rpc Method(GetExample_Request) returns (Get1example_response) {}
}
2 changes: 1 addition & 1 deletion connect.go
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ import (
)

// Version is the semantic version of the connect module.
const Version = "1.18.0"
const Version = "1.18.1"

// These constants are used in compile-time handshakes with connect's generated
// code.