Skip to content

Commit

Permalink
Lower-case OpenAPIv2 and OpenAPIv3 dirs to follow style guide. (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
timburks committed Jan 31, 2020
1 parent 81b31a2 commit 896953e
Show file tree
Hide file tree
Showing 40 changed files with 796 additions and 795 deletions.
4 changes: 2 additions & 2 deletions COMPILE-PROTOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

go get github.com/golang/protobuf/protoc-gen-go

protoc --go_out=. OpenAPIv2/OpenAPIv2.proto
protoc --go_out=. OpenAPIv3/OpenAPIv3.proto
protoc --go_out=. openapiv2/OpenAPIv2.proto
protoc --go_out=. openapiv3/OpenAPIv3.proto
protoc --go_out=. discovery/discovery.proto
protoc --go_out=. plugins/plugin.proto
protoc --go_out=. extensions/extension.proto
Expand Down
2 changes: 1 addition & 1 deletion apps/petstore-builder/petstore-v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package main

import (
v2 "github.com/googleapis/gnostic/OpenAPIv2"
v2 "github.com/googleapis/gnostic/openapiv2"
)

func buildDocumentV2() *v2.Document {
Expand Down
2 changes: 1 addition & 1 deletion apps/petstore-builder/petstore-v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package main

import (
v3 "github.com/googleapis/gnostic/OpenAPIv3"
v3 "github.com/googleapis/gnostic/openapiv3"
)

func buildDocumentV3() *v3.Document {
Expand Down
2 changes: 1 addition & 1 deletion apps/report/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/golang/protobuf/proto"
"github.com/googleapis/gnostic/printer"

pb "github.com/googleapis/gnostic/OpenAPIv2"
pb "github.com/googleapis/gnostic/openapiv2"
)

func readDocumentFromFileWithName(filename string) (*pb.Document, error) {
Expand Down
2 changes: 1 addition & 1 deletion conversions/openapiv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"log"
"net/url"

openapi2 "github.com/googleapis/gnostic/OpenAPIv2"
openapi2 "github.com/googleapis/gnostic/openapiv2"
discovery "github.com/googleapis/gnostic/discovery"
)

Expand Down
2 changes: 1 addition & 1 deletion conversions/openapiv3.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"net/url"
"strings"

openapi3 "github.com/googleapis/gnostic/OpenAPIv3"
openapi3 "github.com/googleapis/gnostic/openapiv3"
discovery "github.com/googleapis/gnostic/discovery"
)

Expand Down
214 changes: 107 additions & 107 deletions discovery/discovery.pb.go

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions extensions/extension.pb.go

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

4 changes: 2 additions & 2 deletions lib/gnostic.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
"time"

"github.com/golang/protobuf/proto"
openapi_v2 "github.com/googleapis/gnostic/OpenAPIv2"
openapi_v3 "github.com/googleapis/gnostic/OpenAPIv3"
openapi_v2 "github.com/googleapis/gnostic/openapiv2"
openapi_v3 "github.com/googleapis/gnostic/openapiv3"
"github.com/googleapis/gnostic/compiler"
discovery_v1 "github.com/googleapis/gnostic/discovery"
"github.com/googleapis/gnostic/jsonwriter"
Expand Down
2 changes: 1 addition & 1 deletion linters/go/gnostic-lint-descriptions/linter_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package main

import (
openapi "github.com/googleapis/gnostic/OpenAPIv2"
openapi "github.com/googleapis/gnostic/openapiv2"
plugins "github.com/googleapis/gnostic/plugins"
)

Expand Down
2 changes: 1 addition & 1 deletion linters/go/gnostic-lint-descriptions/linter_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package main

import (
openapi "github.com/googleapis/gnostic/OpenAPIv3"
openapi "github.com/googleapis/gnostic/openapiv3"
plugins "github.com/googleapis/gnostic/plugins"
)

Expand Down
4 changes: 2 additions & 2 deletions linters/go/gnostic-lint-descriptions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ package main

import (
"github.com/golang/protobuf/proto"
openapiv2 "github.com/googleapis/gnostic/OpenAPIv2"
openapiv3 "github.com/googleapis/gnostic/OpenAPIv3"
openapiv2 "github.com/googleapis/gnostic/openapiv2"
openapiv3 "github.com/googleapis/gnostic/openapiv3"
plugins "github.com/googleapis/gnostic/plugins"
)

Expand Down
4 changes: 2 additions & 2 deletions linters/go/gnostic-lint-paths/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package main

import (
"github.com/golang/protobuf/proto"
openapiv2 "github.com/googleapis/gnostic/OpenAPIv2"
openapiv3 "github.com/googleapis/gnostic/OpenAPIv3"
openapiv2 "github.com/googleapis/gnostic/openapiv2"
openapiv3 "github.com/googleapis/gnostic/openapiv3"
plugins "github.com/googleapis/gnostic/plugins"
)

Expand Down
File renamed without changes.
Loading

2 comments on commit 896953e

@alanconway
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the case of the package path and breaks a whole bunch of stuff. Packages names are supposed to be case insensitive, but not all the go tools respect that. For example:

Code with dependencies on the old name doesn't build:

go mod tidy
go: finding github.com/googleapis/gnostic/OpenAPIv2 latest
github.com/alanconway/forwarder/cmd/manager imports
	github.com/operator-framework/operator-sdk/pkg/k8sutil imports
	k8s.io/client-go/discovery imports
	github.com/googleapis/gnostic/OpenAPIv2: module github.com/googleapis/gnostic@latest found (v0.4.1), but does not contain package github.com/googleapis/gnostic/OpenAPIv2

Updating the packages from the old name gives an error:

~/go/src/github.com/googleapis/gnostic/
go get -u
package github.com/googleapis/gnostic/openapiv2: case-insensitive import collision: "github.com/googleapis/gnostic/openapiv2" and "github.com/googleapis/gnostic/OpenAPIv2"
package github.com/googleapis/gnostic/openapiv3: case-insensitive import collision: "github.com/googleapis/gnostic/openapiv3" and "github.com/googleapis/gnostic/OpenAPIv3"

@timfallmk
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alanconway As a number of people have opened issues related to this in k8s.io/client-go I've created another tracking issue for it (kubernetes/kubernetes#88183). The maintainers seem to just point to the "pin the old version" solution (and close any issues), but that doesn't seem to be a "fix".

(Incomplete) sampling of issues:

I should have a PR out shortly for it, but the protobuf code in client-go is ancient and I'm running into some issues.

My issues:
golang/protobuf#607

Please sign in to comment.