diff --git a/.github/workflows/gha-publish-chart.yaml b/.github/workflows/gha-publish-chart.yaml index d7b4f51155..d3df1d083c 100644 --- a/.github/workflows/gha-publish-chart.yaml +++ b/.github/workflows/gha-publish-chart.yaml @@ -23,11 +23,21 @@ on: required: true type: boolean default: false + publish_gha_runner_scale_set_controller_experimental_chart: + description: "Publish new helm chart for gha-runner-scale-set-controller-experimental" + required: true + type: boolean + default: false publish_gha_runner_scale_set_chart: description: "Publish new helm chart for gha-runner-scale-set" required: true type: boolean default: false + publish_gha_runner_scale_set_experimental_chart: + description: "Publish new helm chart for gha-runner-scale-set-experimental" + required: true + type: boolean + default: false env: HELM_VERSION: v3.8.0 @@ -159,6 +169,54 @@ jobs: echo "- Short SHA: ${{ steps.resolve_parameters.outputs.short_sha }}" >> $GITHUB_STEP_SUMMARY echo "- gha-runner-scale-set-controller Chart version: ${{ env.GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG }}" >> $GITHUB_STEP_SUMMARY + publish-helm-chart-gha-runner-scale-set-controller-experimental: + if: ${{ inputs.publish_gha_runner_scale_set_controller_experimental_chart == true }} + needs: build-push-image + name: Publish Helm chart for gha-runner-scale-set-controller-experimental + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + # If inputs.ref is empty, it'll resolve to the default branch + ref: ${{ inputs.ref }} + + - name: Resolve parameters + id: resolve_parameters + run: | + resolvedRef="${{ inputs.ref }}" + if [ -z "$resolvedRef" ] + then + resolvedRef="${{ github.ref }}" + fi + echo "resolved_ref=$resolvedRef" >> $GITHUB_OUTPUT + echo "INFO: Resolving short SHA for $resolvedRef" + echo "short_sha=$(git rev-parse --short $resolvedRef)" >> $GITHUB_OUTPUT + echo "INFO: Normalizing repository name (lowercase)" + echo "repository_owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + + - name: Set up Helm + uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 + with: + version: ${{ env.HELM_VERSION }} + + - name: Publish new helm chart for gha-runner-scale-set-controller-experimental + run: | + echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin + GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG=$(cat charts/gha-runner-scale-set-controller-experimental/Chart.yaml | grep version: | cut -d " " -d '"' -f 2) + echo "GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG=${GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG}" >> $GITHUB_ENV + helm package charts/gha-runner-scale-set-controller-experimental/ --version="${GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG}" + helm push gha-runner-scale-set-controller-experimental-"${GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG}".tgz oci://ghcr.io/${{ steps.resolve_parameters.outputs.repository_owner }}/actions-runner-controller-charts + + - name: Job summary + run: | + echo "New helm chart for gha-runner-scale-set-controller-experimental published successfully!" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Parameters:**" >> $GITHUB_STEP_SUMMARY + echo "- Ref: ${{ steps.resolve_parameters.outputs.resolved_ref }}" >> $GITHUB_STEP_SUMMARY + echo "- Short SHA: ${{ steps.resolve_parameters.outputs.short_sha }}" >> $GITHUB_STEP_SUMMARY + echo "- gha-runner-scale-set-controller-experimental Chart version: ${{ env.GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG }}" >> $GITHUB_STEP_SUMMARY + publish-helm-chart-gha-runner-scale-set: if: ${{ inputs.publish_gha_runner_scale_set_chart == true }} needs: build-push-image @@ -206,3 +264,52 @@ jobs: echo "- Ref: ${{ steps.resolve_parameters.outputs.resolvedRef }}" >> $GITHUB_STEP_SUMMARY echo "- Short SHA: ${{ steps.resolve_parameters.outputs.short_sha }}" >> $GITHUB_STEP_SUMMARY echo "- gha-runner-scale-set Chart version: ${{ env.GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG }}" >> $GITHUB_STEP_SUMMARY + + publish-helm-chart-gha-runner-scale-set-experimental: + if: ${{ inputs.publish_gha_runner_scale_set_experimental_chart == true }} + needs: build-push-image + name: Publish Helm chart for gha-runner-scale-set-experimental + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + # If inputs.ref is empty, it'll resolve to the default branch + ref: ${{ inputs.ref }} + + - name: Resolve parameters + id: resolve_parameters + run: | + resolvedRef="${{ inputs.ref }}" + if [ -z "$resolvedRef" ] + then + resolvedRef="${{ github.ref }}" + fi + echo "resolved_ref=$resolvedRef" >> $GITHUB_OUTPUT + echo "INFO: Resolving short SHA for $resolvedRef" + echo "short_sha=$(git rev-parse --short $resolvedRef)" >> $GITHUB_OUTPUT + echo "INFO: Normalizing repository name (lowercase)" + echo "repository_owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + + - name: Set up Helm + uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 + with: + version: ${{ env.HELM_VERSION }} + + - name: Publish new helm chart for gha-runner-scale-set-experimental + run: | + echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin + + GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG=$(cat charts/gha-runner-scale-set-experimental/Chart.yaml | grep version: | cut -d " " -d '"' -f 2) + echo "GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG=${GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG}" >> $GITHUB_ENV + helm package charts/gha-runner-scale-set-experimental/ --version="${GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG}" + helm push gha-runner-scale-set-experimental-"${GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG}".tgz oci://ghcr.io/${{ steps.resolve_parameters.outputs.repository_owner }}/actions-runner-controller-charts + + - name: Job summary + run: | + echo "New helm chart for gha-runner-scale-set-experimental published successfully!" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Parameters:**" >> $GITHUB_STEP_SUMMARY + echo "- Ref: ${{ steps.resolve_parameters.outputs.resolved_ref }}" >> $GITHUB_STEP_SUMMARY + echo "- Short SHA: ${{ steps.resolve_parameters.outputs.short_sha }}" >> $GITHUB_STEP_SUMMARY + echo "- gha-runner-scale-set-experimental Chart version: ${{ env.GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG }}" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/gha-validate-chart.yaml b/.github/workflows/gha-validate-chart.yaml index 5fb3657646..46d7b0655d 100644 --- a/.github/workflows/gha-validate-chart.yaml +++ b/.github/workflows/gha-validate-chart.yaml @@ -140,3 +140,7 @@ jobs: run: go test ./charts/gha-runner-scale-set/... - name: Test gha-runner-scale-set-controller run: go test ./charts/gha-runner-scale-set-controller/... + - name: Test gha-runner-scale-set-experimental + run: go test ./charts/gha-runner-scale-set-experimental/... + - name: Test gha-runner-scale-set-controller-experimental + run: go test ./charts/gha-runner-scale-set-controller-experimental/... diff --git a/charts/gha-runner-scale-set-controller-experimental/Chart.yaml b/charts/gha-runner-scale-set-controller-experimental/Chart.yaml index 4d6cd0be14..9e52767f34 100644 --- a/charts/gha-runner-scale-set-controller-experimental/Chart.yaml +++ b/charts/gha-runner-scale-set-controller-experimental/Chart.yaml @@ -15,13 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.13.1 +version: 0.14.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.13.1" +appVersion: "0.14.0" home: https://github.com/actions/actions-runner-controller diff --git a/charts/gha-runner-scale-set-controller-experimental/tests/template_test.go b/charts/gha-runner-scale-set-controller-experimental/tests/template_test.go new file mode 100644 index 0000000000..80870ec350 --- /dev/null +++ b/charts/gha-runner-scale-set-controller-experimental/tests/template_test.go @@ -0,0 +1,52 @@ +package tests + +import ( + "os" + "path/filepath" + "strings" + "testing" + + "github.com/gruntwork-io/terratest/modules/helm" + "github.com/gruntwork-io/terratest/modules/k8s" + "github.com/gruntwork-io/terratest/modules/logger" + "github.com/gruntwork-io/terratest/modules/random" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v2" + appsv1 "k8s.io/api/apps/v1" +) + +type Chart struct { + Version string `yaml:"version"` + AppVersion string `yaml:"appVersion"` +} + +func TestTemplate_RenderedDeployment_UsesChartMetadataLabels(t *testing.T) { + t.Parallel() + + helmChartPath, err := filepath.Abs("../../gha-runner-scale-set-controller-experimental") + require.NoError(t, err) + + chartContent, err := os.ReadFile(filepath.Join(helmChartPath, "Chart.yaml")) + require.NoError(t, err) + + chart := new(Chart) + err = yaml.Unmarshal(chartContent, chart) + require.NoError(t, err) + + releaseName := "test-arc" + namespaceName := "test-" + strings.ToLower(random.UniqueId()) + + options := &helm.Options{ + Logger: logger.Discard, + KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName), + } + + output := helm.RenderTemplate(t, options, helmChartPath, releaseName, []string{"templates/deployment.yaml"}) + + var deployment appsv1.Deployment + helm.UnmarshalK8SYaml(t, output, &deployment) + + assert.Equal(t, "gha-rs-controller-"+chart.Version, deployment.Labels["helm.sh/chart"]) + assert.Equal(t, chart.AppVersion, deployment.Labels["app.kubernetes.io/version"]) +} diff --git a/charts/gha-runner-scale-set-controller/Chart.yaml b/charts/gha-runner-scale-set-controller/Chart.yaml index c7f45c2b7f..2c113a6835 100644 --- a/charts/gha-runner-scale-set-controller/Chart.yaml +++ b/charts/gha-runner-scale-set-controller/Chart.yaml @@ -15,13 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.13.1 +version: 0.14.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.13.1" +appVersion: "0.14.0" home: https://github.com/actions/actions-runner-controller diff --git a/charts/gha-runner-scale-set-experimental/Chart.yaml b/charts/gha-runner-scale-set-experimental/Chart.yaml index 4dbae1de5e..c7defdb0d3 100644 --- a/charts/gha-runner-scale-set-experimental/Chart.yaml +++ b/charts/gha-runner-scale-set-experimental/Chart.yaml @@ -15,13 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "0.13.1" +version: "0.14.0" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.13.1" +appVersion: "0.14.0" home: https://github.com/actions/actions-runner-controller diff --git a/charts/gha-runner-scale-set-experimental/tests/autoscaling_runner_set_labels_test.yaml b/charts/gha-runner-scale-set-experimental/tests/autoscaling_runner_set_labels_test.yaml index eae9536447..2b7a19ed6b 100644 --- a/charts/gha-runner-scale-set-experimental/tests/autoscaling_runner_set_labels_test.yaml +++ b/charts/gha-runner-scale-set-experimental/tests/autoscaling_runner_set_labels_test.yaml @@ -12,12 +12,7 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - - equal: - path: metadata.labels["helm.sh/chart"] - value: "gha-rs-0.13.1" - equal: path: metadata.labels["app.kubernetes.io/name"] value: "test-name" @@ -33,9 +28,9 @@ tests: - equal: path: metadata.labels["app.kubernetes.io/part-of"] value: "gha-rs" - - equal: + - notEqual: path: metadata.labels["app.kubernetes.io/version"] - value: "0.13.1" + value: "" - equal: path: metadata.labels["actions.github.com/scale-set-name"] value: "test-name" @@ -66,9 +61,6 @@ tests: - equal: path: metadata.labels["environment"] value: "production" - - equal: - path: metadata.labels["helm.sh/chart"] - value: "gha-rs-0.13.1" - equal: path: metadata.labels["app.kubernetes.io/name"] value: "test-name" @@ -84,9 +76,9 @@ tests: - equal: path: metadata.labels["app.kubernetes.io/part-of"] value: "gha-rs" - - equal: + - notEqual: path: metadata.labels["app.kubernetes.io/version"] - value: "0.13.1" + value: "" - equal: path: metadata.labels["actions.github.com/scale-set-name"] value: "test-name" @@ -117,9 +109,6 @@ tests: - equal: path: metadata.labels["owner"] value: "devops" - - equal: - path: metadata.labels["helm.sh/chart"] - value: "gha-rs-0.13.1" - equal: path: metadata.labels["app.kubernetes.io/name"] value: "test-name" @@ -135,9 +124,9 @@ tests: - equal: path: metadata.labels["app.kubernetes.io/part-of"] value: "gha-rs" - - equal: + - notEqual: path: metadata.labels["app.kubernetes.io/version"] - value: "0.13.1" + value: "" - equal: path: metadata.labels["actions.github.com/scale-set-name"] value: "test-name" @@ -176,9 +165,6 @@ tests: - equal: path: metadata.labels["environment"] value: "staging" - - equal: - path: metadata.labels["helm.sh/chart"] - value: "gha-rs-0.13.1" - equal: path: metadata.labels["app.kubernetes.io/name"] value: "test-name" @@ -194,9 +180,9 @@ tests: - equal: path: metadata.labels["app.kubernetes.io/part-of"] value: "gha-rs" - - equal: + - notEqual: path: metadata.labels["app.kubernetes.io/version"] - value: "0.13.1" + value: "" - equal: path: metadata.labels["actions.github.com/scale-set-name"] value: "test-name" diff --git a/charts/gha-runner-scale-set-experimental/tests/autoscaling_runner_set_runner_pod_metadata_test.yaml b/charts/gha-runner-scale-set-experimental/tests/autoscaling_runner_set_runner_pod_metadata_test.yaml index 96fe5ce787..37bdd7bd75 100644 --- a/charts/gha-runner-scale-set-experimental/tests/autoscaling_runner_set_runner_pod_metadata_test.yaml +++ b/charts/gha-runner-scale-set-experimental/tests/autoscaling_runner_set_runner_pod_metadata_test.yaml @@ -26,8 +26,6 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - equal: path: spec.template.metadata.labels["purpose"] @@ -35,12 +33,12 @@ tests: - equal: path: spec.template.metadata.labels["team"] value: "platform" - - equal: - path: spec.template.metadata.labels["helm.sh/chart"] - value: "gha-rs-0.13.1" - equal: path: spec.template.metadata.labels["app.kubernetes.io/name"] value: "test-name" + - notEqual: + path: spec.template.metadata.labels["app.kubernetes.io/version"] + value: "" - equal: path: spec.template.metadata.labels["app.kubernetes.io/managed-by"] value: "Helm" diff --git a/charts/gha-runner-scale-set-experimental/tests/github_secret_labels_test.yaml b/charts/gha-runner-scale-set-experimental/tests/github_secret_labels_test.yaml index fcd8c31a6d..a3dd08a892 100644 --- a/charts/gha-runner-scale-set-experimental/tests/github_secret_labels_test.yaml +++ b/charts/gha-runner-scale-set-experimental/tests/github_secret_labels_test.yaml @@ -10,12 +10,7 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - - equal: - path: metadata.labels["helm.sh/chart"] - value: "gha-rs-0.13.1" - equal: path: metadata.labels["app.kubernetes.io/name"] value: "test-name" @@ -31,9 +26,9 @@ tests: - equal: path: metadata.labels["app.kubernetes.io/part-of"] value: "gha-rs" - - equal: + - notEqual: path: metadata.labels["app.kubernetes.io/version"] - value: "0.13.1" + value: "" - equal: path: metadata.labels["actions.github.com/scale-set-name"] value: "test-name" @@ -109,9 +104,9 @@ tests: name: "test-name" namespace: "test-namespace" asserts: - - equal: + - notEqual: path: metadata.labels["helm.sh/chart"] - value: "gha-rs-0.13.1" + value: "bad" - equal: path: metadata.labels["app.kubernetes.io/name"] value: "test-name" diff --git a/charts/gha-runner-scale-set-experimental/tests/kube_mode_role_binding_test.yaml b/charts/gha-runner-scale-set-experimental/tests/kube_mode_role_binding_test.yaml index aea4e4df22..4374dc133f 100644 --- a/charts/gha-runner-scale-set-experimental/tests/kube_mode_role_binding_test.yaml +++ b/charts/gha-runner-scale-set-experimental/tests/kube_mode_role_binding_test.yaml @@ -12,8 +12,6 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - equal: path: apiVersion @@ -159,12 +157,10 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - - equal: + - notEqual: path: metadata.labels["helm.sh/chart"] - value: "gha-rs-0.13.1" + value: "bad" - equal: path: metadata.labels["app.kubernetes.io/name"] value: "test-name" diff --git a/charts/gha-runner-scale-set-experimental/tests/kube_mode_role_test.yaml b/charts/gha-runner-scale-set-experimental/tests/kube_mode_role_test.yaml index a6372808e6..fcebc013ad 100644 --- a/charts/gha-runner-scale-set-experimental/tests/kube_mode_role_test.yaml +++ b/charts/gha-runner-scale-set-experimental/tests/kube_mode_role_test.yaml @@ -12,8 +12,6 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - equal: path: apiVersion diff --git a/charts/gha-runner-scale-set-experimental/tests/kube_mode_serviceaccount_test.yaml b/charts/gha-runner-scale-set-experimental/tests/kube_mode_serviceaccount_test.yaml index 2e5ccd310b..8508f17600 100644 --- a/charts/gha-runner-scale-set-experimental/tests/kube_mode_serviceaccount_test.yaml +++ b/charts/gha-runner-scale-set-experimental/tests/kube_mode_serviceaccount_test.yaml @@ -12,8 +12,6 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - equal: path: apiVersion @@ -144,12 +142,10 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - - equal: + - notEqual: path: metadata.labels["helm.sh/chart"] - value: "gha-rs-0.13.1" + value: "bad" - equal: path: metadata.labels["app.kubernetes.io/name"] value: "test-name" diff --git a/charts/gha-runner-scale-set-experimental/tests/manager_role_binding_labels_test.yaml b/charts/gha-runner-scale-set-experimental/tests/manager_role_binding_labels_test.yaml index a3f41de5e3..08b402a989 100644 --- a/charts/gha-runner-scale-set-experimental/tests/manager_role_binding_labels_test.yaml +++ b/charts/gha-runner-scale-set-experimental/tests/manager_role_binding_labels_test.yaml @@ -9,12 +9,7 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - - equal: - path: metadata.labels["helm.sh/chart"] - value: "gha-rs-0.13.1" - equal: path: metadata.labels["app.kubernetes.io/name"] value: "test-name" @@ -30,9 +25,9 @@ tests: - equal: path: metadata.labels["app.kubernetes.io/part-of"] value: "gha-rs" - - equal: + - notEqual: path: metadata.labels["app.kubernetes.io/version"] - value: "0.13.1" + value: "" - equal: path: metadata.labels["actions.github.com/scale-set-name"] value: "test-name" @@ -58,8 +53,6 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - equal: path: metadata.labels["owner"] @@ -83,8 +76,6 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - equal: path: metadata.labels["actions.github.com/scale-set-name"] diff --git a/charts/gha-runner-scale-set-experimental/tests/manager_role_extra_rules_test.yaml b/charts/gha-runner-scale-set-experimental/tests/manager_role_extra_rules_test.yaml index e50b7f4eb8..83904cc987 100644 --- a/charts/gha-runner-scale-set-experimental/tests/manager_role_extra_rules_test.yaml +++ b/charts/gha-runner-scale-set-experimental/tests/manager_role_extra_rules_test.yaml @@ -6,8 +6,6 @@ tests: release: name: "test-name" namespace: "test-namespace" - chart: - appVersion: "0.13.1" asserts: - equal: path: apiVersion diff --git a/charts/gha-runner-scale-set-experimental/tests/template_test.go b/charts/gha-runner-scale-set-experimental/tests/template_test.go new file mode 100644 index 0000000000..2a1aa6152b --- /dev/null +++ b/charts/gha-runner-scale-set-experimental/tests/template_test.go @@ -0,0 +1,61 @@ +package tests + +import ( + "os" + "path/filepath" + "strings" + "testing" + + v1alpha1 "github.com/actions/actions-runner-controller/apis/actions.github.com/v1alpha1" + "github.com/gruntwork-io/terratest/modules/helm" + "github.com/gruntwork-io/terratest/modules/k8s" + "github.com/gruntwork-io/terratest/modules/logger" + "github.com/gruntwork-io/terratest/modules/random" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v2" +) + +type Chart struct { + Version string `yaml:"version"` + AppVersion string `yaml:"appVersion"` +} + +func TestTemplate_RenderedAutoscalingRunnerSet_UsesChartMetadataLabels(t *testing.T) { + t.Parallel() + + helmChartPath, err := filepath.Abs("../../gha-runner-scale-set-experimental") + require.NoError(t, err) + + chartContent, err := os.ReadFile(filepath.Join(helmChartPath, "Chart.yaml")) + require.NoError(t, err) + + chart := new(Chart) + err = yaml.Unmarshal(chartContent, chart) + require.NoError(t, err) + + releaseName := "test-runners" + namespaceName := "test-" + strings.ToLower(random.UniqueId()) + + options := &helm.Options{ + Logger: logger.Discard, + SetValues: map[string]string{ + "scaleset.name": "test", + "auth.url": "https://github.com/actions", + "auth.githubToken": "gh_token12345", + "controllerServiceAccount.name": "arc", + "controllerServiceAccount.namespace": "arc-system", + }, + KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName), + } + + output := helm.RenderTemplate(t, options, helmChartPath, releaseName, []string{"templates/autoscalingrunnserset.yaml"}) + + var autoscalingRunnerSet v1alpha1.AutoscalingRunnerSet + helm.UnmarshalK8SYaml(t, output, &autoscalingRunnerSet) + + assert.Equal(t, "gha-rs-"+chart.Version, autoscalingRunnerSet.Labels["helm.sh/chart"]) + assert.Equal(t, chart.AppVersion, autoscalingRunnerSet.Labels["app.kubernetes.io/version"]) + assert.Equal(t, "gha-rs-"+chart.Version, autoscalingRunnerSet.Spec.Template.Labels["helm.sh/chart"]) + assert.Equal(t, chart.AppVersion, autoscalingRunnerSet.Spec.Template.Labels["app.kubernetes.io/version"]) +} diff --git a/charts/gha-runner-scale-set/Chart.yaml b/charts/gha-runner-scale-set/Chart.yaml index 487ce76987..2d0457dc5b 100644 --- a/charts/gha-runner-scale-set/Chart.yaml +++ b/charts/gha-runner-scale-set/Chart.yaml @@ -15,13 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.13.1 +version: 0.14.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.13.1" +appVersion: "0.14.0" home: https://github.com/actions/actions-runner-controller diff --git a/docs/gha-runner-scale-set-controller/README.md b/docs/gha-runner-scale-set-controller/README.md index fb43c087f7..e96b9ce347 100644 --- a/docs/gha-runner-scale-set-controller/README.md +++ b/docs/gha-runner-scale-set-controller/README.md @@ -43,6 +43,24 @@ You can follow [this troubleshooting guide](https://docs.github.com/en/actions/h ## Changelog +### 0.14.0 + +1. Fix ActivityId typo in error strings [#4359](https://github.com/actions/actions-runner-controller/pull/4359) +1. Include the HTTP status code in jit error [#4361](https://github.com/actions/actions-runner-controller/pull/4361) +1. Fix tests and generate mocks [#4384](https://github.com/actions/actions-runner-controller/pull/4384) +1. Switch client to scaleset library for the listener and update mocks [#4383](https://github.com/actions/actions-runner-controller/pull/4383) +1. feat: add default linux nodeSelector to listener pod [#4377](https://github.com/actions/actions-runner-controller/pull/4377) +1. Bump Go version [#4398](https://github.com/actions/actions-runner-controller/pull/4398) +1. Allow users to apply labels and annotations to internal resources [#4400](https://github.com/actions/actions-runner-controller/pull/4400) +1. Moving to scaleset client for the controller [#4390](https://github.com/actions/actions-runner-controller/pull/4390) +1. Introduce experimental chart release [#4373](https://github.com/actions/actions-runner-controller/pull/4373) +1. Manually bump dependencies since it needs fixes related to the controller runtime API [#4406](https://github.com/actions/actions-runner-controller/pull/4406) +1. Regenerate manifests for experimental charts [#4407](https://github.com/actions/actions-runner-controller/pull/4407) +1. Remove actions client [#4405](https://github.com/actions/actions-runner-controller/pull/4405) +1. Add chart-level API to customize internal resources [#4410](https://github.com/actions/actions-runner-controller/pull/4410) +1. Shutdown the scaleset when runner is deprecated [#4404](https://github.com/actions/actions-runner-controller/pull/4404) +1. Add multi-label support to scalesets [#4408](https://github.com/actions/actions-runner-controller/pull/4408) + ### 0.13.1 1. Make restart pod more flexible to different failure scenarios [#4340](https://github.com/actions/actions-runner-controller/pull/4340)