-
Notifications
You must be signed in to change notification settings - Fork 71
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 and add gNOI versions. #16
Conversation
* Remove all BUILD.bazel files from the repository, since there are no users currently. * Move types and common protos to separate directories to work with the standard Go build system. * Add a gnoi_version proto FileOption such that we can mark the version of all files, and assign 0.1.0 as the first version at this point.
@ejbrever @samribeiro @aashaikh -- PTAL, this PR makes some cleanups to the gNOI repository. One backwards incompatible change is moving types.proto -- please review the impact of this in your projects. |
common/common.proto
Outdated
@@ -18,7 +18,7 @@ syntax = "proto3"; | |||
|
|||
package gnoi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you consider changing package gnoi to package gnoi.common?
Also suggest to change types/types.proto package to gnoi.types.
Otherwise, one must use import identifier when importing both gnoi/types and gnoi/common in one module to avoid getting the following error: gnoi redeclared as imported package name" error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done -- renamed to types
and common
such that we don't have a gnoi
package at all.
Origin: "oc", | ||
Elem: []*gpb.PathElem{{Name: "interfaces", Key: map[string]string{"name": "Ethernet1/1/0"}}}, | ||
Elem: []*tpb.PathElem{{Name: "interfaces", Key: map[string]string{"name": "Ethernet1/1/0"}}}, | ||
}, | ||
want: "origin: \"oc\"\nelem: <\n name: \"interfaces\"\n key: <\n key: \"name\"\n value: \"Ethernet1/1/0\"\n >\n>\n", | ||
}, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you consider adding the test for system.SetPackage(RemoteDownload with Credentials)? This test requires simple_test.go to import both "gnoi/common" and "gnoi/types".
The code diff is listed below:
diff --git a/test/simple_test.go b/test/simple_test.go
index ecc708c..1b8405c 100644
--- a/test/simple_test.go
+++ b/test/simple_test.go
@@ -18,8 +18,10 @@ import (
"testing"
"github.com/golang/protobuf/proto"
- gpb "github.com/openconfig/gnoi"
bgppb "github.com/openconfig/gnoi/bgp"
+ "github.com/openconfig/gnoi/common"
+ gSystem "github.com/openconfig/gnoi/system"
+ gpb "github.com/openconfig/gnoi/types"
)
func TestGNOI(t *testing.T) {
@@ -34,6 +36,19 @@ func TestGNOI(t *testing.T) {
Elem: []*gpb.PathElem{{Name: "interfaces", Key: map[string]string{"name": "Ethernet1/1/0"}}},
},
want: "origin: \"oc\"\nelem: <\n name: \"interfaces\"\n key: <\n key: \"name\"\n value: \"Ethernet1/1/0\"\n >\n>\n",
+ }, {
+ desc: "system.SetPackage",
+ in: &gSystem.Package{
+ Filename: "filename",
+ RemoteDownload: &gnoi.RemoteDownload{
+ Path: "foo",
+ Protocol: gnoi.RemoteDownload_SCP,
+ Credentials: &gpb.Credentials{
+ Username: "bar",
+ },
+ },
+ },
+ want: "filename: \"filename\"\nremote_download: <\n path: \"foo\"\n protocol: SCP\n credentials: <\n username: \"bar\"\n >\n>\n",
}, {
desc: "gpb.HashType",
in: &gpb.HashType{
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this test case, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, updated my projects. I will let other reviewers approve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the reviews here folks. Comments addressed, so I'll merge after the newly-setup travis run completes. |
Clean up gNOI repository for clarity and standard Go build.