Skip to content

Commit 1ed5040

Browse files
Merge branch 'main' into add-k8s-secret-retriever
2 parents eb5dd36 + 39f1169 commit 1ed5040

File tree

166 files changed

+2250
-1259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+2250
-1259
lines changed
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
#!/bin/bash
2+
3+
# Script to bump Helm chart version and appVersion in Chart.yaml
4+
# Usage: ./bump-helm-chart.sh <version>
5+
# Examples: ./bump-helm-chart.sh v1.2.3 or ./bump-helm-chart.sh 1.2.3
6+
7+
set -euo pipefail
8+
9+
# Colors for output
10+
RED='\033[0;31m'
11+
GREEN='\033[0;32m'
12+
YELLOW='\033[1;33m'
13+
NC='\033[0m' # No Color
14+
15+
# Function to print colored output
16+
print_error() {
17+
echo -e "${RED}Error: $1${NC}" >&2
18+
}
19+
20+
print_success() {
21+
echo -e "${GREEN}$1${NC}"
22+
}
23+
24+
print_warning() {
25+
echo -e "${YELLOW}$1${NC}"
26+
}
27+
28+
# Function to show usage
29+
show_usage() {
30+
echo "Usage: $0 <version>"
31+
echo ""
32+
echo "Examples:"
33+
echo " $0 v1.2.3"
34+
echo " $0 1.2.3"
35+
echo ""
36+
echo "The script will update both 'version' and 'appVersion' in Chart.yaml"
37+
echo " - version: semver without 'v' prefix (e.g., 1.2.3)"
38+
echo " - appVersion: string with 'v' prefix (e.g., \"v1.2.3\")"
39+
}
40+
41+
# Function to validate semver format
42+
validate_semver() {
43+
local version="$1"
44+
# Check if version matches semver pattern (major.minor.patch with optional pre-release and build)
45+
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$ ]]; then
46+
return 1
47+
fi
48+
return 0
49+
}
50+
51+
# Function to parse version input
52+
parse_version() {
53+
local input_version="$1"
54+
local version
55+
56+
# Remove 'v' prefix if present
57+
if [[ "$input_version" =~ ^v(.+)$ ]]; then
58+
version="${BASH_REMATCH[1]}"
59+
else
60+
version="$input_version"
61+
fi
62+
63+
# Validate the version format
64+
if ! validate_semver "$version"; then
65+
print_error "Invalid version format: '$input_version'. Expected format: v1.2.3 or 1.2.3"
66+
return 1
67+
fi
68+
69+
echo "$version"
70+
}
71+
72+
# Function to update Chart.yaml
73+
update_chart_yaml() {
74+
local chart_file="$1"
75+
local version="$2"
76+
local app_version="v$version"
77+
78+
# Check if Chart.yaml exists
79+
if [[ ! -f "$chart_file" ]]; then
80+
print_error "Chart.yaml not found at: $chart_file"
81+
return 1
82+
fi
83+
84+
# Update version and appVersion using sed
85+
# Update version (semver without v)
86+
sed -i.tmp "s/^version: .*$/version: $version/" "$chart_file"
87+
88+
# Update appVersion (string with v)
89+
sed -i.tmp "s/^appVersion: .*$/appVersion: \"$app_version\"/" "$chart_file"
90+
91+
# Remove temporary file created by sed
92+
rm -f "${chart_file}.tmp"
93+
94+
print_success "Updated Chart.yaml:"
95+
print_success " version: $version"
96+
print_success " appVersion: \"$app_version\""
97+
}
98+
99+
# Main script logic
100+
main() {
101+
# Check if version argument is provided
102+
if [[ $# -eq 0 ]]; then
103+
print_error "No version provided"
104+
show_usage
105+
exit 1
106+
fi
107+
108+
# Check for help flag
109+
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
110+
show_usage
111+
exit 0
112+
fi
113+
114+
local input_version="$1"
115+
local chart_file="cmd/relayproxy/helm-charts/relay-proxy/Chart.yaml"
116+
117+
# Parse and validate version
118+
local parsed_version
119+
if ! parsed_version=$(parse_version "$input_version"); then
120+
exit 1
121+
fi
122+
123+
print_success "Parsed version: $parsed_version"
124+
125+
# Update Chart.yaml
126+
if ! update_chart_yaml "$chart_file" "$parsed_version"; then
127+
exit 1
128+
fi
129+
130+
print_success "Helm chart version bump completed successfully! 🦁"
131+
}
132+
133+
# Run main function with all arguments
134+
main "$@"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
".": "1.46.1",
3+
"openfeature/providers/python-provider": "0.4.4",
4+
"openfeature/providers/kotlin-provider": "0.3.0",
5+
"modules/evaluation": "0.1.2",
6+
"modules/core": "0.1.4"
7+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"bootstrap-sha": "bac636bf553bb3ee8fd44470fbd21d164ecc39e4",
3+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
4+
"monorepo-tags": true,
5+
"separate-pull-requests": true,
6+
"include-v-in-tag": true,
7+
"tag-separator": "/",
8+
"commit-search-depth": 400,
9+
"changelog-sections": [
10+
{
11+
"type": "fix",
12+
"section": "🐛 Bug Fixes"
13+
},
14+
{
15+
"type": "feat",
16+
"section": "🚀 New Features"
17+
},
18+
{
19+
"type": "chore",
20+
"section": "🔧 Chores"
21+
},
22+
{
23+
"type": "docs",
24+
"section": "📚 Documentation"
25+
}
26+
],
27+
"packages": {
28+
".": {
29+
"release-type": "go",
30+
"include-component-in-tag": false,
31+
"changelog-path": ".github/release-please/CHANGELOG.md",
32+
"path": ".",
33+
"component": "go-feature-flag",
34+
"exclude-paths": [
35+
"modules/evaluation",
36+
"modules/core",
37+
"openfeature/providers/kotlin-provider",
38+
"openfeature/providers/python-provider",
39+
".github/release-please"
40+
]
41+
},
42+
"modules/evaluation": {
43+
"release-type": "go",
44+
"path": "modules/evaluation",
45+
"include-component-in-tag": true,
46+
"component": "modules/evaluation",
47+
"changelog-path": "CHANGELOG.md"
48+
},
49+
"modules/core": {
50+
"release-type": "go",
51+
"path": "modules/core",
52+
"include-component-in-tag": true,
53+
"component": "modules/core",
54+
"changelog-path": "CHANGELOG.md"
55+
},
56+
"openfeature/providers/kotlin-provider": {
57+
"release-type": "java",
58+
"path": "openfeature/providers/kotlin-provider",
59+
"include-component-in-tag": true,
60+
"component": "openfeature/providers/kotlin-provider",
61+
"changelog-path": "CHANGELOG.md",
62+
"skip-snapshot": true,
63+
"extra-files": [
64+
"gradle.properties",
65+
"build.gradle.kts",
66+
"README.md"
67+
]
68+
},
69+
"openfeature/providers/python-provider": {
70+
"release-type": "python",
71+
"path": "openfeature/providers/python-provider",
72+
"include-component-in-tag": true,
73+
"component": "openfeature/providers/python-provider",
74+
"changelog-path": "CHANGELOG.md",
75+
"extra-files": [
76+
"pyproject.toml",
77+
"README.md"
78+
]
79+
}
80+
}
81+
}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,4 @@ jobs:
202202
runs-on: ubuntu-latest
203203
steps:
204204
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
205-
- uses: gradle/actions/wrapper-validation@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
205+
- uses: gradle/actions/wrapper-validation@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0

.github/workflows/close-stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
issues: write
1313
pull-requests: write
1414
steps:
15-
- uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
15+
- uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
1616
with:
1717
stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days."
1818
stale-pr-message: "This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days."
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# ---------------------------------------
2+
# Bump module dependency is a workflow that bumps the dependency of a module to the latest version.
3+
# This is a reusable workflow and is used by the release-please workflow to bump the dependency of the module to the latest version.
4+
# ---------------------------------------
5+
name: bump module dependency
6+
permissions:
7+
actions: read
8+
contents: read
9+
10+
on:
11+
workflow_call:
12+
inputs:
13+
modulePath: { type: string, required: true }
14+
version: { type: string, required: true }
15+
goModDirectoryPath: { type: string, required: false, default: "." }
16+
secrets:
17+
token: { required: true }
18+
19+
jobs:
20+
bump-module:
21+
name: Bump module dependency ${{ inputs.modulePath }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
27+
- name: Setup go
28+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
29+
with:
30+
go-version-file: ${{ inputs.goModDirectoryPath }}/go.mod
31+
check-latest: true
32+
33+
- name: Update internal module
34+
env:
35+
VERSION: ${{ inputs.version }}
36+
MODULE_PATH: ${{ inputs.modulePath }}
37+
GO_MOD_DIRECTORY_PATH: ${{ inputs.goModDirectoryPath }}
38+
run: |
39+
cd ${GO_MOD_DIRECTORY_PATH}
40+
export GOWORK=off
41+
go get github.com/thomaspoignant/go-feature-flag/${MODULE_PATH}@v${VERSION}
42+
go mod tidy
43+
go mod vendor
44+
go mod verify
45+
46+
- name: Create Pull Request to bump module
47+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
48+
env:
49+
VERSION: ${{ inputs.version }}
50+
MODULE_PATH: ${{ inputs.modulePath }}
51+
with:
52+
branch: bump-module-${{ env.MODULE_PATH}}-${{ env.VERSION }}
53+
title: "chore(dependency): Bump module ${{ env.MODULE_PATH }} ${{ env.VERSION }}"
54+
body: |
55+
Automated pull request to bump module ${{ env.MODULE_PATH}} ${{ env.VERSION }}
56+
commit-message: "chore(dependency): Bump module ${MODULE_PATH} ${VERSION}"
57+
assignees: thomaspoignant
58+
draft: false
59+
signoff: true
60+
delete-branch: true
61+
base: main
62+
labels: automerge
63+
token: ${{ secrets.token }}

.github/workflows/release-kotlin-provider.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
name: Release Kotlin Provider to Sonatype
22
on:
3-
push:
4-
tags:
5-
- kotlin-provider-v*
3+
workflow_call:
4+
inputs:
5+
version: { type: string, required: false }
6+
secrets:
7+
OSSRH_USERNAME: { required: true }
8+
OSSRH_PASSWORD: { required: true }
9+
GPG_SIGNING_KEY: { required: true }
10+
GPG_SIGNING_KEY_PASSWORD: { required: true }
11+
GPG_SIGNING_KEY_ID: { required: true }
612

7-
permissions: read-all
13+
permissions:
14+
actions: read
15+
contents: read
816

917
jobs:
1018
kotlin-release:
@@ -20,13 +28,6 @@ jobs:
2028
restore-keys: |
2129
${{ runner.os }}-gradle-
2230
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23-
- name: Bump version
24-
run: |
25-
FULL_TAG_NAME=${{ github.ref_name }}
26-
VERSION=${FULL_TAG_NAME:17}
27-
awk '/^ ext\[\"version\"\]/ { print " ext[\"version\"] = \"'${FULL_TAG_NAME:17}'\""; next; }; { print; }' ./openfeature/providers/kotlin-provider/build.gradle.kts > temp
28-
mv temp ./openfeature/providers/kotlin-provider/build.gradle.kts
29-
3031
- name: Import GPG key
3132
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0
3233
with:

0 commit comments

Comments
 (0)