Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: generalize renovate configuration #495

Merged
merged 40 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7310b58
also include yml files
mowies Jun 27, 2023
90787c0
remove helm values regex managers since renovate covers helm values b…
mowies Jun 27, 2023
6668d7d
update renovate annotation to cover more kuttl files, remove specific…
mowies Jun 27, 2023
62a5c1d
test out new config by reducing flagd version
mowies Jun 27, 2023
35edb59
test out new config by reducing flagd version
mowies Jun 27, 2023
03aed0b
try escaping some chars
mowies Jun 27, 2023
5193ca8
try simplifying the annotation comment
mowies Jun 27, 2023
b16cead
fix renovate regex manager, go back to bog annotation comment
mowies Jun 27, 2023
fd9e2ee
try using github-tags datasource
mowies Jun 27, 2023
4dc0986
reduce another version
mowies Jun 27, 2023
acbc4c4
adjust yet another file
mowies Jun 27, 2023
3f9816e
try simpler versions
mowies Jun 27, 2023
1d22248
try adding package rules to extract the version correctly
mowies Jun 27, 2023
2b0d2aa
try removing one flagd
mowies Jun 27, 2023
5d3cb3d
try using github-tags datasource
mowies Jun 27, 2023
4d135bb
try adjusting extract version rules again
mowies Jun 27, 2023
36e281b
try more after first working version
mowies Jun 27, 2023
f1dbef2
debugging
mowies Jun 27, 2023
67a88cd
try if flagd-proxy gets picked up
mowies Jun 27, 2023
ba8c0da
try adding more matched packages to renovate config
mowies Jun 27, 2023
4b5869d
adjust files according to new config
mowies Jun 27, 2023
7b18bec
try more things
mowies Jun 27, 2023
a2b5d18
try even more things
mowies Jun 27, 2023
735cde4
try even more things
mowies Jun 27, 2023
4a37686
revert back to the correct versions and dep names
mowies Jun 27, 2023
f4dabc5
remove extractVersionTemplate from regex manager
mowies Jun 27, 2023
355995c
remove regex matchers for charts readme since they dont match anythin…
mowies Jun 27, 2023
4a8d821
generalize regex manager even more
mowies Jun 27, 2023
0f87b3b
move sections around
mowies Jun 27, 2023
d9a1ed8
simplify regex
mowies Jun 27, 2023
d6c0c1d
use general approach also for go file to update flagd-proxy version
mowies Jun 27, 2023
7dcfb31
fix regex
mowies Jun 27, 2023
9f896af
add go file to general manager
mowies Jun 27, 2023
8c402ff
use correct go file path
mowies Jun 27, 2023
da53b32
use correct go file path
mowies Jun 27, 2023
426fcb9
fix quotes in regex
mowies Jun 27, 2023
6d36af1
fix quotes in regex
mowies Jun 27, 2023
0d6e343
add flagsource config v1alpha1 to general regex manger
mowies Jun 27, 2023
97894a0
test new changes
mowies Jun 27, 2023
af880f5
revert change after confirming that new config works
mowies Jun 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 32 additions & 31 deletions apis/core/v1alpha1/flagsourceconfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,33 @@ import (
type SyncProviderType string

const (
SidecarEnvVarPrefix string = "SIDECAR_ENV_VAR_PREFIX"
InputConfigurationEnvVarPrefix string = "SIDECAR"
SidecarMetricPortEnvVar string = "METRICS_PORT"
SidecarPortEnvVar string = "PORT"
SidecarSocketPathEnvVar string = "SOCKET_PATH"
SidecarEvaluatorEnvVar string = "EVALUATOR"
SidecarImageEnvVar string = "IMAGE"
SidecarVersionEnvVar string = "TAG"
SidecarProviderArgsEnvVar string = "PROVIDER_ARGS"
SidecarDefaultSyncProviderEnvVar string = "SYNC_PROVIDER"
SidecarLogFormatEnvVar string = "LOG_FORMAT"
SidecarProbesEnabledVar string = "PROBES_ENABLED"
defaultSidecarEnvVarPrefix string = "FLAGD"
DefaultMetricPort int32 = 8014
defaultPort int32 = 8013
defaultSocketPath string = ""
defaultEvaluator string = "json"
defaultImage string = "ghcr.io/open-feature/flagd"
defaultTag string = "v0.5.4"
defaultLogFormat string = "json"
defaultProbesEnabled bool = true
SyncProviderKubernetes SyncProviderType = "kubernetes"
SyncProviderFilepath SyncProviderType = "filepath"
SyncProviderHttp SyncProviderType = "http"
SyncProviderGrpc SyncProviderType = "grpc"
SyncProviderFlagdProxy SyncProviderType = "flagd-proxy"
SidecarEnvVarPrefix string = "SIDECAR_ENV_VAR_PREFIX"
InputConfigurationEnvVarPrefix string = "SIDECAR"
SidecarMetricPortEnvVar string = "METRICS_PORT"
SidecarPortEnvVar string = "PORT"
SidecarSocketPathEnvVar string = "SOCKET_PATH"
SidecarEvaluatorEnvVar string = "EVALUATOR"
SidecarImageEnvVar string = "IMAGE"
SidecarVersionEnvVar string = "TAG"
SidecarProviderArgsEnvVar string = "PROVIDER_ARGS"
SidecarDefaultSyncProviderEnvVar string = "SYNC_PROVIDER"
SidecarLogFormatEnvVar string = "LOG_FORMAT"
SidecarProbesEnabledVar string = "PROBES_ENABLED"
defaultSidecarEnvVarPrefix string = "FLAGD"
DefaultMetricPort int32 = 8014
defaultPort int32 = 8013
defaultSocketPath string = ""
defaultEvaluator string = "json"
defaultImage string = "ghcr.io/open-feature/flagd"
// renovate: datasource=github-tags depName=open-feature/flagd/flagd
defaultTag string = "v0.5.4"
defaultLogFormat string = "json"
defaultProbesEnabled bool = true
SyncProviderKubernetes SyncProviderType = "kubernetes"
SyncProviderFilepath SyncProviderType = "filepath"
SyncProviderHttp SyncProviderType = "http"
SyncProviderGrpc SyncProviderType = "grpc"
SyncProviderFlagdProxy SyncProviderType = "flagd-proxy"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
Expand Down Expand Up @@ -164,10 +165,10 @@ type FlagSourceConfigurationStatus struct {
// Important: Run "make" to regenerate code after modifying this file
}

//+kubebuilder:resource:shortName="fsc"
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:storageversion
// +kubebuilder:resource:shortName="fsc"
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion

// FlagSourceConfiguration is the Schema for the FlagSourceConfigurations API
type FlagSourceConfiguration struct {
Expand All @@ -178,7 +179,7 @@ type FlagSourceConfiguration struct {
Status FlagSourceConfigurationStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true
// +kubebuilder:object:root=true

// FlagSourceConfigurationList contains a list of FlagSourceConfiguration
type FlagSourceConfigurationList struct {
Expand Down
11 changes: 6 additions & 5 deletions controllers/common/flagd-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ import (
)

const (
ManagedByAnnotationValue = "open-feature-operator"
FlagdProxyDeploymentName = "flagd-proxy"
FlagdProxyServiceAccountName = "open-feature-operator-flagd-proxy"
FlagdProxyServiceName = "flagd-proxy-svc"
DefaultFlagdProxyTag = "v0.2.2" //FLAGD_PROXY_TAG_RENOVATE
ManagedByAnnotationValue = "open-feature-operator"
FlagdProxyDeploymentName = "flagd-proxy"
FlagdProxyServiceAccountName = "open-feature-operator-flagd-proxy"
FlagdProxyServiceName = "flagd-proxy-svc"
// renovate: datasource=github-tags depName=open-feature/flagd/flagd-proxy
DefaultFlagdProxyTag = "v0.2.2"
DefaultFlagdProxyImage = "ghcr.io/open-feature/flagd-proxy"
DefaultFlagdProxyPort = 8015
DefaultFlagdProxyMetricsPort = 8016
Expand Down
92 changes: 20 additions & 72 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
],
"kubernetes": {
"fileMatch": [
"^chart/templates/rendered\\.yaml$",
"^config/default/.*-patch\\.yaml$",
"^chart/templates/rendered\\.ya?ml$",
"^config/default/.*-patch\\.ya?ml$",
"test\\/.*\\.ya?ml$"
]
},
Expand All @@ -22,34 +22,26 @@
"^.*open-feature/flagd.*$"
],
"groupName": "open-feature/flagd"
}
],
"regexManagers": [
{
"fileMatch": ["^apis/core/.*/flagsourceconfiguration_types.go$"],
"matchStrings": ["defaultTag\\s*string\\s*= \"(?<currentValue>.*?)\"\\s"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd/(?<version>.*)$"
},
{
"fileMatch": ["^chart/open-feature-operator/values.yaml$"],
"matchStrings": ["repository: \"ghcr\\.io\/open-feature\/flagd\"\\n\\s*tag: (?<currentValue>.*?)\\s"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd/(?<version>.*)$"
"matchDepNames": [
"open-feature/flagd",
"open-feature/flagd/flagd"
],
"extractVersion": "^flagd/(?<version>.*?)$"
},
{
"fileMatch": ["^chart/open-feature-operator/README.md$"],
"matchStrings": ["current flagd version: \\`(?<currentValue>.*?)\\`"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd/(?<version>.*)$"
},
"matchDepNames": [
"open-feature/flagd-proxy",
"open-feature/flagd/flagd-proxy"
],
"extractVersion": "^flagd-proxy/(?<version>.*?)$"
}
],
"regexManagers": [
{
"fileMatch": [
"^docs/getting_started.md$",
"^test/e2e/kuttl/inject-flagd/01-assert.yaml$"
"^docs/getting_started.md$"
],
"matchStrings": ["ghcr\\.io\\/open-feature\\/flagd:(?<currentValue>.*?)\\s"],
"depNameTemplate": "open-feature/flagd",
Expand All @@ -62,57 +54,13 @@
"(^|\\/)Dockerfile",
"(^|\\/).*\\.ya?ml$",
"(^|\\/).*\\.toml$",
"(^|\\/).*\\.sh$"
"(^|\\/).*\\.sh$",
"^controllers/common/flagd-proxy.go$",
"^apis/core/.*/flagsourceconfiguration_types.go$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)\\s.*?_VERSION ?(\\??=|\\: ?) ?\\\"?(?<currentValue>.+?)?\\\"?\\s"
"(#|\\/\\/) renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)\\s.*?(?<separator>\\??=|\\: ?) ?\\\"?(?<currentValue>.+?)?\\\"?\\s"
]
},
{
"fileMatch": ["^controllers/core/flagsourceconfiguration/flagd-proxy.go$"],
"matchStrings": ["\"(?<currentValue>.*?)\" \\/\\/FLAGD_PROXY_TAG_RENOVATE"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
},
{
"fileMatch": ["^chart/open-feature-operator/values.yaml$"],
"matchStrings": ["repository: \"ghcr\\.io\/open-feature\/flagd-proxy\"\\n\\s*tag: (?<currentValue>.*?)\\s"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
},
{
"fileMatch": ["^chart/open-feature-operator/README.md$"],
"matchStrings": ["current flagd-proxy version: \\`(?<currentValue>.*?)\\`"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
},
{
"fileMatch": [
mowies marked this conversation as resolved.
Show resolved Hide resolved
"^test/e2e/kuttl/fsconfig-flagd-proxy-sync/00-install.yaml$",
"^test/e2e/kuttl/fsconfig-flagd-proxy-sync/01-assert.yaml$",
"^test/e2e/kuttl/fsconfig-k8s-sync/00-install.yaml$",
"^test/e2e/kuttl/fsconfig-k8s-sync/01-assert.yaml$",
"^test/e2e/kuttl/fsconfig-file-sync/00-install.yaml$",
"^test/e2e/kuttl/fsconfig-file-sync/01-assert.yaml$"
],
"matchStrings": ["image: ghcr\\.io\/open-feature\/flagd:(?<currentValue>.*?)\\s"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
},
{
"fileMatch": [
"^test/e2e/kuttl/fsconfig-flagd-proxy-sync/00-install.yaml$",
"^test/e2e/kuttl/fsconfig-k8s-sync/00-install.yaml$",
"^test/e2e/kuttl/fsconfig-file-sync/00-install.yaml$"
],
"matchStrings": ["tag: (?<currentValue>.*?)\\s"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
}
]
}
1 change: 1 addition & 0 deletions test/e2e/kuttl/fsconfig-file-sync/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ spec:
metricsPort: 8080
evaluator: json
defaultSyncProvider: filepath
# renovate: datasource=github-tags depName=open-feature/flagd/flagd
tag: v0.5.4
sources:
- source: end-to-end-test
Expand Down
1 change: 1 addition & 0 deletions test/e2e/kuttl/fsconfig-flagd-proxy-sync/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ spec:
metricsPort: 8080
evaluator: json
defaultSyncProvider: flagd-proxy
# renovate: datasource=github-tags depName=open-feature/flagd/flagd
tag: v0.5.4
sources:
- source: end-to-end-test
Expand Down
1 change: 1 addition & 0 deletions test/e2e/kuttl/fsconfig-k8s-sync/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ spec:
metricsPort: 8080
evaluator: json
defaultSyncProvider: kubernetes
# renovate: datasource=github-tags depName=open-feature/flagd/flagd
tag: v0.5.4
sources:
- source: end-to-end-test
Expand Down