Skip to content

Commit

Permalink
Update go package references and artifacts on cel-spec (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
TristonianJones authored Aug 28, 2024
1 parent fe3a882 commit aa4eb92
Show file tree
Hide file tree
Showing 22 changed files with 445 additions and 61 deletions.
13 changes: 11 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ module cel.dev/expr
go 1.18

require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237
google.golang.org/protobuf v1.33.0
github.com/bazelbuild/rules_go v0.49.0
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7
google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
)

require (
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
)
23 changes: 17 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
github.com/bazelbuild/rules_go v0.49.0 h1:5vCbuvy8Q11g41lseGJDc5vxhDjJtfxr6nM/IC4VmqM=
github.com/bazelbuild/rules_go v0.49.0/go.mod h1:Dhcz716Kqg1RHNWos+N6MlXNkjNP2EwZQ0LukRKJfMs=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 h1:YcyjlL1PRr2Q17/I0dPk2JmYS5CDXfcdb2Z3YRioEbw=
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
2 changes: 1 addition & 1 deletion proto/test/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ go_proto_library(
":envcheck_proto",
":simple_proto",
],
importpath = "github.com/google/cel-spec/proto/test/v1/testpb",
importpath = "cel.dev/expr/proto/test/v1/testpb",
deps = [
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
],
Expand Down
2 changes: 1 addition & 1 deletion proto/test/v1/envcheck.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ syntax = "proto3";
package google.api.expr.test.v1;

// Note, run regen_go_proto.sh after making modifications to this file.
option go_package = "github.com/google/cel-spec/test/v1/testpb";
option go_package = "cel.dev/expr/test/v1/testpb";

import "google/api/expr/v1alpha1/checked.proto";

Expand Down
2 changes: 1 addition & 1 deletion proto/test/v1/proto2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ java_proto_library(
go_proto_library(
name = "test_all_types_go_proto",
proto = ":test_all_types_proto",
importpath = "github.com/google/cel-spec/proto/test/v1/proto2/test_all_types",
importpath = "cel.dev/expr/proto/test/v1/proto2/test_all_types",
deps = [
"@org_golang_google_protobuf//types/known/anypb:go_default_library",
"@org_golang_google_protobuf//types/known/durationpb:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion proto/test/v1/proto2/test_all_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";

// Note, run regen_go_proto.sh after making modifications to this file.
option go_package = "github.com/google/cel-spec/test/v1/proto2/test_all_types";
option go_package = "cel.dev/expr/test/v1/proto2/test_all_types";
option cc_enable_arenas = true;
option java_outer_classname = "TestAllTypesProto";
option java_package = "com.google.api.expr.test.v1.proto2";
Expand Down
336 changes: 336 additions & 0 deletions proto/test/v1/proto2/test_all_types/test_all_types_extensions.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion proto/test/v1/proto2/test_all_types_extensions.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package google.api.expr.test.v1.proto2;

import "proto/test/v1/proto2/test_all_types.proto";

option go_package = "github.com/google/cel-spec/test/v1/proto2/test_all_types";
option go_package = "cel.dev/expr/test/v1/proto2/test_all_types";
option java_outer_classname = "TestAllTypesExtensions";
option java_package = "com.google.api.expr.test.v1.proto2";
option java_multiple_files = true;
Expand Down
2 changes: 1 addition & 1 deletion proto/test/v1/proto3/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ java_proto_library(
go_proto_library(
name = "test_all_types_go_proto",
proto = ":test_all_types_proto",
importpath = "github.com/google/cel-spec/proto/test/v1/proto3/test_all_types",
importpath = "cel.dev/expr/proto/test/v1/proto3/test_all_types",
deps = [
"@org_golang_google_protobuf//types/known/anypb:go_default_library",
"@org_golang_google_protobuf//types/known/durationpb:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion proto/test/v1/proto3/test_all_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";

// Note, run regen_go_proto.sh after making modifications to this file.
option go_package = "github.com/google/cel-spec/test/v1/proto3/test_all_types";
option go_package = "cel.dev/expr/test/v1/proto3/test_all_types";
option cc_enable_arenas = true;
option java_outer_classname = "TestAllTypesProto";
option java_package = "com.google.api.expr.test.v1.proto3";
Expand Down
2 changes: 1 addition & 1 deletion proto/test/v1/simple.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ syntax = "proto3";
package google.api.expr.test.v1;

// Note, run regen_go_proto.sh after making modifications to this file.
option go_package = "github.com/google/cel-spec/test/v1/testpb";
option go_package = "cel.dev/expr/test/v1/testpb";
option java_outer_classname = "SimpleProto";
option java_package = "com.google.api.expr.test.v1";

Expand Down
9 changes: 4 additions & 5 deletions proto/test/v1/testpb/envcheck.pb.go

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

7 changes: 3 additions & 4 deletions proto/test/v1/testpb/simple.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 tests/envcheck/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ go_library(
srcs = [
"envcheck.go",
],
importpath = "github.com/google/cel-spec/tests/envcheck",
importpath = "cel.dev/expr/tests/envcheck",
deps = [
"//tools/celrpc:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
Expand Down
41 changes: 20 additions & 21 deletions tests/envcheck/envcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,37 @@
// Identifier declarations are compiled to an expression of just that
// identifiers. For instance, the "int" type identifier produces:
//
// int
// int
//
// Function declarations are compiled to a separate expression for
// each overload. The expression is an invocation of the overload with
// "zeroish" arguments of the appropriate type. The zeroish arguments
// are:
//
// int 0
// uint 0u
// double 0.0
// bool false
// string ""
// bytes b""
// null_type null
// type type
// list<A> []
// map<A,B> {}
// enum E 0
// message M M{}
// int 0
// uint 0u
// double 0.0
// bool false
// string ""
// bytes b""
// null_type null
// type type
// list<A> []
// map<A,B> {}
// enum E 0
// message M M{}
//
// For instance, the "_/_" function with overloads
//
// _/_: (int, int) -> int
// _/_: (uint, uint) -> uint
// _/_: (double, double) -> double
// _/_: (int, int) -> int
// _/_: (uint, uint) -> uint
// _/_: (double, double) -> double
//
// compiles to the expressions
//
// (0)/(0)
// (0u)/(0u)
// (0.0)/(0.0)
// (0)/(0)
// (0u)/(0u)
// (0.0)/(0.0)
//
// which are then evaluated.
//
Expand All @@ -60,15 +60,14 @@
// error other than "no_matching_overload". For instance, the first
// two expressions for _/_ will generate division-by-zero errors, but
// this will pass the test.
//
package envcheck

import (
"context"
"fmt"
"testing"

"github.com/google/cel-spec/tools/celrpc"
"cel.dev/expr/tools/celrpc"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
4 changes: 2 additions & 2 deletions tests/envcheck/envcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"os"
"testing"

"github.com/google/cel-spec/tools/celrpc"
"cel.dev/expr/tools/celrpc"

"google.golang.org/protobuf/encoding/prototext"

envpb "github.com/google/cel-spec/proto/test/v1/testpb"
envpb "cel.dev/expr/proto/test/v1/testpb"
)

var (
Expand Down
18 changes: 17 additions & 1 deletion tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
module github.com/google/cel-spec/tests
module cel.dev/expr/tests

go 1.18

require (
cel.dev/expr v0.16.0
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7
google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
)

require (
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
)

replace cel.dev/expr => ./..
16 changes: 16 additions & 0 deletions tests/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
github.com/bazelbuild/rules_go v0.49.0 h1:5vCbuvy8Q11g41lseGJDc5vxhDjJtfxr6nM/IC4VmqM=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 h1:YcyjlL1PRr2Q17/I0dPk2JmYS5CDXfcdb2Z3YRioEbw=
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
2 changes: 1 addition & 1 deletion tests/simple/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ go_library(
srcs = [
"simple.go",
],
importpath = "github.com/google/cel-spec/tests/simple",
importpath = "cel.dev/expr/tests/simple",
deps = [
"//proto/test/v1:testpb_go_proto",
"//tools/celrpc:go_default_library",
Expand Down
9 changes: 4 additions & 5 deletions tests/simple/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Example test data:
expr: "1 + 1 == 2"
}
}
*/
package simple

Expand All @@ -41,11 +40,11 @@ import (
"context"
"fmt"

"github.com/google/cel-spec/tools/celrpc"
"cel.dev/expr/tools/celrpc"

"google.golang.org/protobuf/encoding/prototext"

spb "github.com/google/cel-spec/proto/test/v1/testpb"
spb "cel.dev/expr/proto/test/v1/testpb"

confpb "google.golang.org/genproto/googleapis/api/expr/conformance/v1alpha1"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
Expand Down Expand Up @@ -99,8 +98,8 @@ func Match(t *spb.SimpleTest, actual *exprpb.ExprValue) error {

// MatchValue returns whether the actual value is equal to the
// expected value, modulo the following normalization:
// 1) All floating-point NaN values are equal.
// 2) Map comparisons ignore order.
// 1. All floating-point NaN values are equal.
// 2. Map comparisons ignore order.
func MatchValue(tag string, expected *exprpb.Value, actual *exprpb.Value) error {
// TODO: make floating point NaN values compare equal.
switch expected.GetKind().(type) {
Expand Down
8 changes: 4 additions & 4 deletions tests/simple/simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ import (
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/proto"

"github.com/google/cel-spec/tools/celrpc"
"cel.dev/expr/tools/celrpc"

anypb "google.golang.org/protobuf/types/known/anypb"
structpb "google.golang.org/protobuf/types/known/structpb"

spb "github.com/google/cel-spec/proto/test/v1/testpb"
spb "cel.dev/expr/proto/test/v1/testpb"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"

// The following are needed to link in these proto libraries
// which are needed dynamically, despite not being explicitly
// used in the Go source.
_ "github.com/google/cel-spec/proto/test/v1/proto2/test_all_types"
_ "github.com/google/cel-spec/proto/test/v1/proto3/test_all_types"
_ "cel.dev/expr/proto/test/v1/proto2/test_all_types"
_ "cel.dev/expr/proto/test/v1/proto3/test_all_types"
)

type stringArray []string
Expand Down
2 changes: 1 addition & 1 deletion tools/celrpc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ go_library(
srcs = [
"celrpc.go",
],
importpath = "github.com/google/cel-spec/tools/celrpc",
importpath = "cel.dev/expr/tools/celrpc",
deps = [
"@org_golang_google_genproto_googleapis_api//expr/conformance/v1alpha1:go_default_library",
"@org_golang_google_grpc//:go_default_library",
Expand Down

0 comments on commit aa4eb92

Please sign in to comment.