Skip to content

Commit

Permalink
fix: use float64 internally instead int64 (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis committed Jun 11, 2024
1 parent fa2b2fd commit 6489368
Show file tree
Hide file tree
Showing 29 changed files with 516 additions and 368 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
go-version: 1.22.x
- name: Restore Go cache
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
with:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
go-version: 1.22.x
- name: Restore Go cache
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
with:
Expand All @@ -120,7 +120,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
go-version: 1.22.x
- name: Restore Go cache
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
with:
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
go-version: 1.22.x
- name: Setup Kubernetes
uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 #v0.5.0
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: '1.20'
go-version: '1.22'
- name: Docker Login
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
Expand Down Expand Up @@ -78,4 +78,4 @@ jobs:
repository=$(echo "${{ github.repository_owner }}" | tr [:upper:] [:lower:])
helm push ${{ github.workspace }}/chart/growthbook-controller-*.tgz oci://ghcr.io/$repository/charts |& tee .digest
cosign login --username ${GITHUB_ACTOR} --password ${{ secrets.GITHUB_TOKEN }} ghcr.io
cosign sign --yes ghcr.io/$repository/charts/growthbook-controller@$(cat .digest | awk -F "[, ]+" '/Digest/{print $NF}')
cosign sign --yes ghcr.io/$repository/charts/growthbook-controller@$(cat .digest | awk -F "[, ]+" '/Digest/{print $NF}')
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
CONTROLLER_GEN = $(GOBIN)/controller-gen
.PHONY: controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.0)
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0)

GOLANGCI_LINT = $(GOBIN)/golangci-lint
.PHONY: golangci-lint
Expand Down
12 changes: 6 additions & 6 deletions api/v1beta1/growthbookfeature_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ type FeatureRule struct {
TrackingKey string `json:"trackingKey,omitempty"`
FallbackAttribute *string `json:"fallbackAttribute,omitempty"`
DisableStickyBucketing *bool `json:"disableStickyBucketing,omitempty"`
BucketVersion *int64 `json:"bucketVersion,omitempty"`
MinBucketVersion *int64 `json:"minBucketVersion,omitempty"`
BucketVersion *string `json:"bucketVersion,omitempty"`
MinBucketVersion *string `json:"minBucketVersion,omitempty"`
Namespace *NamespaceValue `json:"namespace,omitempty"`
Values []ExperimentValue `json:"values,omitempty"`
ExperimentID string `json:"experimentId,omitempty"`
Expand Down Expand Up @@ -104,14 +104,14 @@ type SavedGroupTargeting struct {

type ExperimentValue struct {
Value string `json:"value,omitempty"`
Weight int64 `json:"weight,omitempty"`
Weight string `json:"weight,omitempty"`
Name *string `json:"name,omitempty"`
}

type NamespaceValue struct {
Enabled bool `json:"enabled,omitempty"`
Name string `json:"name,omitempty"`
Range []int64 `json:"range,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Name string `json:"name,omitempty"`
Range []string `json:"range,omitempty"`
}

// GetID returns the feature ID which is the resource name if not overwritten by spec.ID
Expand Down
7 changes: 3 additions & 4 deletions api/v1beta1/zz_generated.deepcopy.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 @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.0
controller-gen.kubebuilder.io/version: v0.15.0
name: growthbookclients.growthbook.infra.doodle.com
spec:
group: growthbook.infra.doodle.com
Expand All @@ -24,14 +24,19 @@ spec:
description: GrowthbookClient is the Schema for the GrowthbookClients API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.0
controller-gen.kubebuilder.io/version: v0.15.0
name: growthbookfeatures.growthbook.infra.doodle.com
spec:
group: growthbook.infra.doodle.com
Expand All @@ -24,14 +24,19 @@ spec:
description: GrowthbookFeature is the Schema for the GrowthbookFeatures API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand All @@ -57,8 +62,7 @@ spec:
items:
properties:
bucketVersion:
format: int64
type: integer
type: string
condition:
type: string
coverage:
Expand All @@ -76,8 +80,7 @@ spec:
hashAttribute:
type: string
minBucketVersion:
format: int64
type: integer
type: string
namespace:
properties:
enabled:
Expand All @@ -86,8 +89,7 @@ spec:
type: string
range:
items:
format: int64
type: integer
type: string
type: array
type: object
prerequisites:
Expand Down Expand Up @@ -142,8 +144,7 @@ spec:
value:
type: string
weight:
format: int64
type: integer
type: string
type: object
type: array
variations:
Expand Down
Loading

0 comments on commit 6489368

Please sign in to comment.