- 26 Oct, 2018 1 commit
-
-
Chris Roche authored
* Upgrade to PG* 0.4.3 * checkpoint * checkpoint
-
- 28 Sep, 2018 1 commit
-
-
Shouichi Kamiya authored
Go 1.9 introduced a standard format of generated code header. This change follows that header format. See https://golang.org/pkg/cmd/go/internal/generate/
-
- 27 Sep, 2018 2 commits
-
-
Sam Smith authored
This commit contains some miscellaneous Windows fixes discoverd while integrating PGV with Envoy - Remove incorrect comment about including "validate/validate.proto" - Always make sure WIN32 is defined when compiling *.pb.validate.cc - Include <google/protobuf/message.h> and <google/protobuf/util/time_util.h> in the *.pb.validate.cc file instead of validate.h. This is because these headers include <windows.h> which defines many macros (e.g. DELETE). If this header is then included before any code that has symbols by the same name, it will fail to compile - Use std::unordered_map instead of std::map because we don't care about traversing the keys in order - Remove the complicated windows.ps1 set up script and just run the bazel command Signed-off-by:
Amin Jamali <ajamali@pivotal.io>
-
Chris Roche authored
* PG* Update (sans BAZEL updates) * make protoc-gen-validate buildable * revert BUILD changes for tests/harness * checkpoint * checkpoint * BUILD changes * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * sort template functions
-
- 11 Sep, 2018 1 commit
-
-
Aliaksandr Skurydzin authored
* extend template to allow interface casting approach * address review comments
-
- 30 Aug, 2018 1 commit
-
-
Alex Konradi authored
The test code depends on auto-generated Go code that, if missing, will cause compilation errors. This can be generated via make, but doing so 1. is not hermetic 2. requires proto path variables to be set This PR updates the Bazel rules and targets so that bazel run //tests/harness/executor works again and runs the full test suite. The changes are limited to BUILD files (there are no code changes) so it should only affect Bazel-based builds.
-
- 21 Aug, 2018 1 commit
-
-
Sam Smith authored
* Add Windows support to PGV - bump rules_go and gazelle to 0.14.0 - bump google/protobuf to 3.6.1 - add powershell script that duplicates the Makefile - add workaround to test harness for how Bazel handles runfiles on Windows Signed-off-by:
Sam Smith <sesmith177@gmail.com> * Remove --features=pure As of rules_go 0.14.0, the go stdlib will not be built from source if we don't pass this flag * Bump google protobuf to pick up PR Signed-off-by:
Sam Smith <sesmith177@gmail.com>
-
- 08 Aug, 2018 2 commits
-
-
Alex Konradi authored
-
Sam Smith authored
* Break dependency on protobuf.bzl from google/protobuf for C++ This replaces the use of cc_proto_library / proto_gen from the @com_google_protobuf//:protobuf.bzl. The reason for doing so is that newer versions of google/protobuf have changed cc_proto_library + proto_gen so that they no longer work with pgv_cc_proto_library. pgv_proto_library now takes a proto_library containing the protos instead of a list of proto files. The approach for generating the protoc command line arguments was taken from bazelbuild/rules_go The py_proto_library imported from @com_google_protobuf//:protobuf.bzl is used by Envoy, so we left it in. Signed-off-by:
Andrew Keesler <akeesler@pivotal.io> Signed-off-by:
Amin Jamali <ajamali@pivotal.io> * Fix nits - change mnemonic to ProtoGenValidateCcGenerate - accept array of proto_library rules as argument Signed-off-by:
Sam Smith <sesmith177@gmail.com>
-
- 06 Aug, 2018 2 commits
-
-
Sam Smith authored
When compiling with MSVC, there is not an equivalent to__attribute__(weak). In order for cross-package validation to work with MSVC, use static registration instead Signed-off-by:
Arjun Sreedharan <asreedharan@pivotal.io> Signed-off-by:
Sam Smith <sesmith177@gmail.com>
-
Stephan Renatus authored
The extra -I are needed to have the import "validate/validate.proto"; work -- and it needs to be imported like this because that's how the filedescriptor is registered, see https://github.com/lyft/protoc-gen-validate/blob/e60e7f91da4/validate/validate.pb.go#L3049 Also the proto file needs package, otherwise, you'll see protoc-gen-go: error:can't find object with type ..Person And those character classes in the regex don't seem to be supported? Using them, I ended up seeing example.proto:11:39: Invalid escape sequence in string literal. example.proto:11:41: Invalid escape sequence in string literal. example.proto:11:49: Invalid escape sequence in string literal. example.proto:11:51: Invalid escape sequence in string literal. This should fix #56. Signed-off-by:
Stephan Renatus <srenatus@chef.io>
-
- 31 Jul, 2018 1 commit
-
-
Sam Smith authored
This is to pick up fixes that allow rules_go to work on Windows. There are several required steps to make this work: 1. Remove fork of go_proto_library.bzl and rework pgv_go_proto_library to use proto rules from rules_go 2. Because of 1, bump dependencies in Gopkg.toml to match those in rules_go a. github.com/golang/protobuf -> v1.1.0 b. github.com/lyft/protoc-gen-star -> v0.3.7 c. github.com/gogo/protobuf -> v1.0.0 3. Correct location in Makefile for generated validate.pb.go 4. Update protos in tests/kitchensink to explicitly set go_package option. Without this option, the generated *.pb.validate.go files had empty package names (the regular *.pb.go files were fine) 5. Rerun "gazelle fix" in the vendor directory to regenerate BUILD.bazel files. Signed-off-by:
Sam Smith <sesmith177@gmail.com>
-
- 13 Jul, 2018 1 commit
-
-
Back Yu authored
* solve to #79. * fix CI failed for #80 * fix reviewing for #80 * add test cases for #80 * fix debug code for #80 * fix format bug for #80 * templates: improve by #80 * readme.md: fix comment to #80. * templates: fix for equal min/max for #80 Signed-off-by:
Back Yu <yhfszb@gmail.com> * tests: add cases to `equal min/max len` for #80 Signed-off-by:
Back Yu <yhfszb@gmail.com> * templates: improve for #80 Signed-off-by:
Back Yu <yhfszb@gmail.com> * fix readme for #79.
-
- 26 Jun, 2018 1 commit
-
-
Jose Ulises Nino Rivera authored
Nested in rules for repeated fields do not generate the necessary global mapping in the generated proto. This patch fixes the rule for string repeated fields and can be generalized for repeated fields of other types.
-
- 21 Jun, 2018 1 commit
-
-
htuch authored
* Bump Bazel dep for @com_github_golang_protobuf to 1.0 to match the Gopkg.toml used by the make build. * Use pure Bazel external dep for @com_github_golang_protobuf to avoid having a combination of Bazel dep and vendored files. Signed-off-by:
Harvey Tuch <htuch@google.com>
-
- 24 Apr, 2018 1 commit
-
-
htuch authored
Previously, if the duration field was missing, it would short circuit evaluation of following fields in the message the template was embedded in. This triggered the server config proto fuzz tests for Envoy. Signed-off-by:
Harvey Tuch <htuch@google.com>
-
- 03 Apr, 2018 1 commit
-
-
Chris Roche authored
-
- 27 Mar, 2018 1 commit
-
-
Kuat authored
* Initial prototype Signed-off-by:
Kuat Yessenov <kuat@google.com> * add test Signed-off-by:
Kuat Yessenov <kuat@google.com> * tests Signed-off-by:
Kuat Yessenov <kuat@google.com> * remove test gogo files Signed-off-by:
Kuat Yessenov <kuat@google.com> * edit proto fields Signed-off-by:
Kuat Yessenov <kuat@google.com> * fixing tests Signed-off-by:
Kuat Yessenov <kuat@google.com> * fixing tests Signed-off-by:
Kuat Yessenov <kuat@google.com> * add gogo harness Signed-off-by:
Kuat Yessenov <kuat@google.com> * add gogo harness Signed-off-by:
Kuat Yessenov <kuat@google.com> * missing file Signed-off-by:
Kuat Yessenov <kuat@google.com> * vendor gogo Signed-off-by:
Kuat Yessenov <kuat@google.com> * bazelify Signed-off-by:
Kuat Yessenov <kuat@google.com> * use local gogofast Signed-off-by:
Kuat Yessenov <kuat@google.com> * separate templates Signed-off-by:
Kuat Yessenov <kuat@google.com> * separate templates Signed-off-by:
Kuat Yessenov <kuat@google.com> * respond to review Signed-off-by:
Kuat Yessenov <kuat@google.com>
-
- 14 Mar, 2018 1 commit
-
-
Stephan Renatus authored
* move module into its own package (fix #62) Signed-off-by:
Stephan Renatus <srenatus@chef.io> * fix make comment output Signed-off-by:
Stephan Renatus <srenatus@chef.io> * update bazel rules For future reference: I had issues with this on my machine, so I've resorted to using docker: docker build -t protoc-gen-validate . docker run -it -v $(pwd):/go/src/github.com/lyft/protoc-gen-validate \ protoc-gen-validate gazelle Signed-off-by:
Stephan Renatus <srenatus@chef.io> * undo/fix gazelle rules (manually) Signed-off-by:
Stephan Renatus <srenatus@chef.io>
-
- 21 Feb, 2018 1 commit
-
-
Kent Wang authored
* Fix pattern rule in repeated and map field Add pattern variable declaration when repeated.items, map.keys or map.values contains string rule with pattern. * Add test cases to executor
-
- 15 Feb, 2018 1 commit
-
-
Chris Roche authored
* update vendored dependencies * fix sha * no build files in gen'd go directories * gazelle added an extra go_binary rule
-
- 14 Feb, 2018 1 commit
-
-
Snow Pettersen authored
This updates the version of rules_go to 0.9.0. The BUILD files changes were necessary to work around a linking error that happens under 0.9.0. The fix was based on bazelbuild/buildtools#201, but I don't really know much about the go build chain, so I don't really know what's happening, nor do I know if there's any specific motivation behind structuring the BUILD file the way it was. I'd be happy to file a bug against rules_go if this change seems like it should unnecessary, but I figured I'd put this up in case we're okay with the workaround. This update also adds these deprecation warnings: DEBUG: /private/var/tmp/_bazel_snowp/3bae0aee9d5211471587d3b4956c9db7/external/io_bazel_rules_go/go/private/rules/wrappers.bzl:79:5: DEPRECATED: //vendor/github.com/lyft/protoc-gen-star:go_default_test : the library attribute on go_test is deprecated. Please migrate to embed.
-
- 08 Feb, 2018 1 commit
-
-
Snow Pettersen authored
The native git_repository rule does not honor git's proxy settings (https://github.com/bazelbuild/bazel/issues/3893), so this means that anything that depend on protoc-gen-validate will fail when building while behind a proxy.
-
- 16 Jan, 2018 1 commit
-
-
Alex Konradi authored
Use all available cores by default, allow for overriding from the command line.
-
- 08 Jan, 2018 1 commit
-
-
Alex Konradi authored
The package names don't match the import paths so it's hard to tell where `cases` and `other_package` are actually defined.
-
- 05 Jan, 2018 1 commit
-
-
Alex Konradi authored
These got missed in PR#44. This changes the signature of the validation functions in a compatible way, since pgv::ValidationMsg is an alias for std::string.
-
- 04 Jan, 2018 1 commit
-
-
Alex Konradi authored
Use pgv::ValidationMsg instead of std::string to make it easier to change or extend error message types.
-
- 03 Jan, 2018 1 commit
-
-
Alex Konradi authored
Add missing #include in generated C++ Clean up 'using' declarations in the C++ harness
-
- 21 Dec, 2017 1 commit
-
-
Piotr Sikora authored
Signed-off-by:
Piotr Sikora <piotrsikora@google.com>
-
- 08 Dec, 2017 1 commit
-
-
Alex Konradi authored
-
- 04 Dec, 2017 1 commit
-
-
htuch authored
* Fix some namespace issues, previously wasn't qualifying embedded message. * Switched from template (compile-time) to weak link (link-time) Check function definition. This allows us to resolve #39. * To support the above, switched away from inlining and header only generation for C++ to a split header/implementation structure. Fixes #39. Signed-off-by:
Harvey Tuch <htuch@google.com>
-
- 02 Dec, 2017 2 commits
-
-
akonradi authored
and add a test (that really only checks compilation) to ensure that multiple compilation units that include the validation code can be linked together.
-
Chris Roche authored
This patch addresses an issue (in both Go and C++) where messages embedded in a repeated field would not be validated unless the repeated field itself had validation rules applied. Additionally, the skip rule on messages embedded in repeated fields caused compilation errors due to unused variables for the elements. The current solution here still leaves the loop (which hopefully gets optimized out by the compiler); a later fix should ensure the loop is not emitted. Finally, some cleanup to some of the bazel rules to properly run the test harness. Later on, may convert the harness to utilize the Go test framework for better portability (and limiting which test cases are executed).
-
- 01 Dec, 2017 2 commits
-
-
htuch authored
* template: some C++ fixups to support Envoy data-plane-api. With these changes, Envoy data-plane-api protos now pass the C++ compile time checks: * Fix duration temporary variable scoping. * #pragma once the header files. * Fix code generation for repeated messages. Turns out we didn't have any test for this, so added to catch regression. Signed-off-by:
Harvey Tuch <htuch@google.com> * Push prefix stripping closer to generating code. Signed-off-by:
Harvey Tuch <htuch@google.com> * Stricter copts to match Envoy, unused params fixups. Signed-off-by:
Harvey Tuch <htuch@google.com>
-
htuch authored
* templates: C++ Duration support. This is a bit hackier than the equivalent Go supports, since we don't have ptypes.Duration to do nice things like equality and validity checking. Instead, we treat Duration as an integer representing nanoseconds and implement the validity constraints documented in https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto . Signed-off-by:
Harvey Tuch <htuch@google.com> * Add TODO for large test. Signed-off-by:
Harvey Tuch <htuch@google.com>
-
- 30 Nov, 2017 4 commits
-
-
akonradi authored
-
akonradi authored
* Implement unique constraint C++ generation * Fix inType for C++ templates * Test C++ repeated field validation * Use unordered set for C++ repeated unique checks
-
akonradi authored
* Start working on C++ string constraint support * Mark other C++ string validations as unimplemented * Enable oneof validation tests in C++ Now that most of the string validation code template is written, the oneof tests produce code that compiles and passes all the tests.
-
htuch authored
Need to use workspace qualified names to support pgv_proto_library use across repos. Signed-off-by:
Harvey Tuch <htuch@google.com>
-
- 29 Nov, 2017 1 commit
-
-
akonradi authored
* Make C++ error messages more like the Go ones * Bugfix: field named 'const' has accessor 'const_' A field named "const" is accessed as "m.const_()", so generate code appropriately. * Predeclare Validate() functions to support nesting * Use correct message name in C++ output * Add C++ validation library * Use fully-qualified C++ message class names * Implement nested validation in C++ This is ugly, because we don't necessarily generate a validation function for every proto message type (ex: the well-known google::protobuf::Any type). Use some template metaprogramming to work around this, where each validation function is invoked if it exists, and a default fallback version is provided as well.
-