Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build environment following cncf/udpa -> cncf/xds migration. #5

Merged
merged 3 commits into from
Mar 12, 2021
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: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build:ci --announce_rc
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.0
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.pb.go linguist-generated=true
*.pb.go -diff -merge
*.pb.validate.go linguist-generated=true
*.pb.validate.go -diff -merge
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bazel-*
go.sum
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
workspace(name = "com_github_cncf_udpa")
workspace(name = "com_github_cncf_xds")

load("//bazel:repositories.bzl", "udpa_api_dependencies")

Expand Down
2 changes: 1 addition & 1 deletion bazel/api_build_system.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ _PY_PROTO_SUFFIX = "_py_proto"
_CC_PROTO_SUFFIX = "_cc_proto"
_CC_GRPC_SUFFIX = "_cc_grpc"
_GO_PROTO_SUFFIX = "_go_proto"
_GO_IMPORTPATH_PREFIX = "github.com/cncf/udpa/go/"
_GO_IMPORTPATH_PREFIX = "github.com/cncf/xds/go/"

_COMMON_PROTO_DEPS = [
"@com_google_protobuf//:any_proto",
Expand Down
2 changes: 1 addition & 1 deletion bazel/dependency_imports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def udpa_dependency_imports(go_version = GO_VERSION):
go = True,
grpc = True,
rules_override = {
"py_proto_library": "@com_github_cncf_udpa//bazel:api_build_system.bzl",
"py_proto_library": "@com_github_cncf_xds//bazel:api_build_system.bzl",
},
)

Expand Down
4 changes: 2 additions & 2 deletions ci/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ set -e

bazel test --config=ci //...

rm -rf go/udpa
rm -rf go/xds go/udpa

tools/generate_go_protobuf.py

git add go/udpa
git add go/xds go/udpa

echo "If this check fails, apply following diff:"
git diff HEAD
Expand Down
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cncf/udpa/go
module github.com/cncf/xds/go

go 1.11

Expand Down
2 changes: 1 addition & 1 deletion go/udpa/service/orca/v1/orca.pb.go

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

2 changes: 1 addition & 1 deletion go/xds/core/v3/authority.pb.go

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

2 changes: 1 addition & 1 deletion go/xds/core/v3/collection_entry.pb.go

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

2 changes: 1 addition & 1 deletion go/xds/core/v3/context_params.pb.go

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

2 changes: 1 addition & 1 deletion go/xds/core/v3/resource.pb.go

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

2 changes: 1 addition & 1 deletion go/xds/core/v3/resource_locator.pb.go

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

2 changes: 1 addition & 1 deletion go/xds/core/v3/resource_name.pb.go

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

8 changes: 4 additions & 4 deletions test/build/go_build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package go_build_test
import (
"testing"

_ "github.com/cncf/udpa/go/udpa/data/orca/v1"
_ "github.com/cncf/udpa/go/udpa/service/orca/v1"
_ "github.com/cncf/udpa/go/udpa/type/v1"
_ "github.com/cncf/xds/go/udpa/data/orca/v1"
_ "github.com/cncf/xds/go/udpa/service/orca/v1"
_ "github.com/cncf/xds/go/udpa/type/v1"
)

func TestNoop(t *testing.T) {
// Noop test that verifies the successful importation of UDPA protos
// Noop test that verifies the successful importation of xDS protos
}
2 changes: 1 addition & 1 deletion tools/generate_go_protobuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def generateProtobufs(output):
for rule in go_protos:
rule_dir, proto = rule.decode()[2:].rsplit(':', 1)
input_dir = os.path.join(bazel_bin, rule_dir, 'linux_amd64_stripped',
proto + '%', 'github.com/cncf/udpa/go', rule_dir)
proto + '%', 'github.com/cncf/xds/go', rule_dir)
input_files = glob.glob(os.path.join(input_dir, '*.go'))
output_dir = os.path.join(output, rule_dir)

Expand Down