Skip to content

Commit

Permalink
Adopt globally reserved field numbers for FieldOptions. (#762)
Browse files Browse the repository at this point in the history
* Adopt globally reserved field numbers for FieldOptions.

 * (M) proto/yext/yext.{proto,pb.go}
  - Ensure that we use globally reserved field numbers for the
    FieldOptions for these new annotations.

* Add update script and re-generate protobufs.

* Regenerate exschemapath.pb.go with new field numbers.
  • Loading branch information
robshakir authored Jan 11, 2023
1 parent 950f793 commit 9b74224
Show file tree
Hide file tree
Showing 8 changed files with 1,068 additions and 994 deletions.
16 changes: 8 additions & 8 deletions proto/yext/yext.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 proto/yext/yext.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ extend google.protobuf.FieldOptions {
// leaflist indicates that the field represents a YANG leaf-list. It is
// valid only for repeated fields, and can be used to determine that the
// generated field is a list of scalar values by any parsing code.
bool leaflist = 1041;
bool leaflist = 1179;
// leaflistunion indicates that hte field represents a YANG leaf-list
// of union types. It is valid only for repeated message fields and can be
// used to determine that specific leaf-list union handling is required.
bool leaflistunion = 1042;
bool leaflistunion = 1180;
}

extend google.protobuf.EnumValueOptions {
Expand Down
298 changes: 150 additions & 148 deletions protomap/integration_tests/testdata/gribi_aft/enums/enums.pb.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// - github.com/openconfig/gribi/v1/yang/deps/...
syntax = "proto3";

package gribi_aft.enums;
package ygot.protomap.tests.gribi_aft.enums;

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

Expand Down
1,694 changes: 869 additions & 825 deletions protomap/integration_tests/testdata/gribi_aft/gribi_aft.pb.go

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions protomap/integration_tests/testdata/gribi_aft/gribi_aft.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// gribi_aft is generated by proto_generator as a protobuf
// representation of a YANG schema.
// representation of a YANG schema. This version is used as an
// integration test for ygot..
//
// Input schema modules:
// - github.com/openconfig/gribi/v1/yang/gribi-aft.yang
Expand All @@ -8,11 +9,11 @@
// - github.com/openconfig/gribi/v1/yang/deps/...
syntax = "proto3";

package gribi_aft;
package ygot.protomap.tests.gribi_aft;

import "github.com/openconfig/ygot/proto/ywrapper/ywrapper.proto";
import "github.com/openconfig/ygot/proto/yext/yext.proto";
import "v1/proto/gribi_aft/enums/enums.proto";
import "github.com/openconfig/ygot/protomap/integration_tests/testdata/gribi_aft/enums/enums.proto";

option go_package = "github.com/openconfig/gribi/v1/proto/gribi_aft";

Expand Down
27 changes: 27 additions & 0 deletions protomap/integration_tests/testdata/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Copyright 2023 Google Inc.
#
# 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.

# To remove the dependency on GOPATH, we locally cache the protobufs that
# we need as dependencies during build time with the intended paths.

if [ -z $SRCDIR ]; then
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SRC_DIR=${THIS_DIR}/../../..
fi

cd ${SRC_DIR}
protoc -I${SRC_DIR} -I ${SRC_DIR}/../../.. --go_out=. --go_opt=paths=source_relative ${SRC_DIR}/protomap/integration_tests/testdata/gribi_aft/gribi_aft.proto
protoc -I${SRC_DIR} -I ${SRC_DIR}/../../.. --go_out=. --go_opt=paths=source_relative ${SRC_DIR}/protomap/integration_tests/testdata/gribi_aft/enums/enums.proto
14 changes: 7 additions & 7 deletions protomap/testdata/exschemapath/exschemapath.pb.go

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

0 comments on commit 9b74224

Please sign in to comment.