From 9d7259a65085fa88d0a277f273ede00904612ff9 Mon Sep 17 00:00:00 2001 From: Tolga Ozen Date: Mon, 31 Jul 2023 14:08:40 +0300 Subject: [PATCH 1/3] fix: better way to parse int --- pkg/attribute/attribute.go | 2 +- pkg/attribute/attribute_test.go | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pkg/attribute/attribute.go b/pkg/attribute/attribute.go index 126e73602..33b7d5309 100644 --- a/pkg/attribute/attribute.go +++ b/pkg/attribute/attribute.go @@ -73,7 +73,7 @@ func Attribute(attribute string) (*base.Attribute, error) { wrapped = wrapperspb.Double(doubleVal) // In case of integer case "integer": - intVal, err := strconv.Atoi(v[1]) + intVal, err := strconv.ParseInt(v[1], 10, 32) if err != nil { return nil, fmt.Errorf("failed to parse integer: %v", err) } diff --git a/pkg/attribute/attribute_test.go b/pkg/attribute/attribute_test.go index 4e705bcbc..a8a78cd61 100644 --- a/pkg/attribute/attribute_test.go +++ b/pkg/attribute/attribute_test.go @@ -22,6 +22,7 @@ var _ = Describe("attribute", func() { Context("Attribute", func() { isPublic, _ := anypb.New(wrapperspb.Bool(true)) double, _ := anypb.New(wrapperspb.Double(100)) + integer, _ := anypb.New(wrapperspb.Int32(45)) It("ToString", func() { tests := []struct { @@ -88,6 +89,18 @@ var _ = Describe("attribute", func() { Value: double, }, }, + { + target: "user:1#age@integer:45", + attribute: &base.Attribute{ + Entity: &base.Entity{ + Type: "user", + Id: "1", + }, + Attribute: "age", + Type: "integer", + Value: integer, + }, + }, } for _, tt := range tests { From 4805947d484e39017e19c5623152bd524cca028b Mon Sep 17 00:00:00 2001 From: Tolga Ozen Date: Mon, 31 Jul 2023 14:51:40 +0300 Subject: [PATCH 2/3] fix: depth added to validate action --- pkg/cmd/validate.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cmd/validate.go b/pkg/cmd/validate.go index f5e34f9ff..4104bb750 100644 --- a/pkg/cmd/validate.go +++ b/pkg/cmd/validate.go @@ -405,6 +405,7 @@ func validate() func(cmd *cobra.Command, args []string) error { Metadata: &base.PermissionLookupSubjectRequestMetadata{ SchemaVersion: version, SnapToken: token.NewNoopToken().Encode().String(), + Depth: 100, }, SubjectReference: subjectReference, Permission: permission, From 44311cd309a624188d7a07d0f4fc3e3b252b5e19 Mon Sep 17 00:00:00 2001 From: Tolga Ozen Date: Mon, 31 Jul 2023 14:52:11 +0300 Subject: [PATCH 3/3] build: nightly release manual dispatch added --- .github/workflows/nightly.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 91faae0a4..7a12c8f5d 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -3,6 +3,7 @@ name: "Nightly Release" on: schedule: - cron: "0 0 * * *" + workflow_dispatch: # This allows manual triggering permissions: contents: write packages: write