Skip to content

Commit

Permalink
Merge branch 'master' into support-field-number-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
wenovus committed Nov 9, 2021
2 parents 179dfb6 + ef8f2a1 commit 4664808
Show file tree
Hide file tree
Showing 202 changed files with 248,360 additions and 207,096 deletions.
39 changes: 28 additions & 11 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,40 +67,57 @@ jobs:
working-directory: go/src/github.com/openconfig/ygot

- name: Check that Go integration test files compile
working-directory: go/src/github.com/openconfig/ygot/ygen/testdata
working-directory: go/src/github.com/openconfig/ygot
run: |
function test-go-build() {
cwd=$(pwd)
tmpdir=$(mktemp -d -p $cwd)
name=$(basename $1)
cp "$1" "$tmpdir"/"${name}.go"
for f in "$@"; do
name=$(basename $f)
cp "$f" "$tmpdir"/"${name}.go"
done
cd $tmpdir
goimports -w *.go
go build
cd $cwd
rm -r $tmpdir
}
expectFail=(
skipped=(
# fake ygot and ytype paths specified in generation options.
"openconfig-options-explicit.formatted-txt.go"
)
for f in structs/*.formatted-txt; do
if [[ ${expectFail[@]} =~ $(basename $f) ]]; then
for f in ygen/testdata/schema/*.formatted-txt; do
if [[ ${skipped[@]} =~ $(basename $f) ]]; then
continue
fi
test-go-build $f
done
expectFail=(
# fake ygot and ytype paths specified in generation options.
"openconfig-options-explicit.formatted-txt.go"
skipped=(
)
for f in schema/*.formatted-txt; do
if [[ ${expectFail[@]} =~ $(basename $f) ]]; then
for f in ygen/testdata/structs/*.formatted-txt; do
if [[ ${skipped[@]} =~ $(basename $f) ]]; then
continue
fi
test-go-build $f
done
skipped=(
# GoStructs in a separate package, harder to set-up.
"openconfig-augmented.path-txt"
"openconfig-withlist-separate-package.path-txt"
)
for f in ypathgen/testdata/structs/*.path-txt; do
if [[ ${skipped[@]} =~ $(basename $f) ]]; then
continue
fi
filename=$(basename $f)
f_prefix="${filename%%.*}"
ygen_file="ygen/testdata/structs/${f_prefix}.formatted-txt"
test-go-build $f $ygen_file
done
static_analysis:
name: Static Analysis
runs-on: ubuntu-latest
Expand Down
362 changes: 179 additions & 183 deletions demo/protobuf_getting_started/ribproto/openconfig/enums/enums.pb.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ syntax = "proto3";

package openconfig.enums;

import "github.com/openconfig/ygot/proto/ywrapper/ywrapper.proto";
import "github.com/openconfig/ygot/proto/yext/yext.proto";

option go_package = "github.com/openconfig/ygot/demo/protobuf_getting_started/ribproto/openconfig/enums";

// OpenconfigBgpTypesAFISAFITYPE represents an enumerated type generated for the YANG identity AFI_SAFI_TYPE.
enum OpenconfigBgpTypesAFISAFITYPE {
OPENCONFIGBGPTYPESAFISAFITYPE_UNSET = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package openconfig_enums is a protobuf package that is generated by
// Package enums is a protobuf package that is generated by
// ygot. This file ensures that build systems that assume the existence
// of the package can find it.

package openconfig_enums
package enums
52 changes: 24 additions & 28 deletions demo/protobuf_getting_started/ribproto/openconfig/openconfig.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
Expand Up @@ -9,10 +9,11 @@ syntax = "proto3";

package openconfig;

import "github.com/openconfig/ygot/proto/ywrapper/ywrapper.proto";
import "github.com/openconfig/ygot/proto/yext/yext.proto";
import "github.com/openconfig/ygot/demo/protobuf_getting_started/ribproto/openconfig/openconfig_rib_bgp/openconfig_rib_bgp.proto";

option go_package = "github.com/openconfig/ygot/demo/protobuf_getting_started/ribproto/openconfig";

message Device {
openconfig_rib_bgp.BgpRib bgp_rib = 314942212 [(yext.schemapath) = "/bgp-rib"];
}
Loading

0 comments on commit 4664808

Please sign in to comment.