From f3107bafdb33eaf1c351b7a3c0d288f906000ea2 Mon Sep 17 00:00:00 2001 From: Suneha Bose <123775811+bosesuneha@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:27:22 +0000 Subject: [PATCH 1/6] release v0.17.2 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e2506b88..4f41291b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [0.17.2] - 2025-01-27 +- [476](https://github.com/Azure/draft/pull/476) Add default value for CLUSTERRESOURCETYPE in draft.yaml +- [477](https://github.com/Azure/draft/pull/477) Explicitly require jobs for each language to allow failure to be reported and prevent PR merging in case of a failure + ## [0.17.1] - 2025-01-24 ### Added From 17fd3a0f62aec45d2f21d7ffbaf15187b8f23bb7 Mon Sep 17 00:00:00 2001 From: Suneha Bose <123775811+bosesuneha@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:27:22 +0000 Subject: [PATCH 2/6] release v0.17.2 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e2506b88..4f41291b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [0.17.2] - 2025-01-27 +- [476](https://github.com/Azure/draft/pull/476) Add default value for CLUSTERRESOURCETYPE in draft.yaml +- [477](https://github.com/Azure/draft/pull/477) Explicitly require jobs for each language to allow failure to be reported and prevent PR merging in case of a failure + ## [0.17.1] - 2025-01-24 ### Added From 652224224365ff9f0a0a2224b4a29a2c577e195b Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 17:04:53 -0500 Subject: [PATCH 3/6] cluster resource type default enforcement (#476) --- .github/workflows/integration-per-language.yml | 15 ++++++++++++--- pkg/config/draftconfig_template_test.go | 1 + template/workflows/helm/draft.yaml | 8 ++++++++ template/workflows/kustomize/draft.yaml | 8 ++++++++ template/workflows/manifests/draft.yaml | 8 ++++++++ 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index b635f6ae2..6eb6d4a91 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -158,7 +158,6 @@ jobs: --variable CONTAINERNAME=someContainer \ --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup \ --variable CLUSTERNAME=someAksCluster \ - --variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters \ --variable DOCKERFILE=./Dockerfile \ --variable BUILDCONTEXTPATH=. \ --variable NAMESPACE=default @@ -332,7 +331,6 @@ jobs: --variable CONTAINERNAME=someContainer \ --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup \ --variable CLUSTERNAME=someAksCluster \ - --variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters \ --variable DOCKERFILE=./Dockerfile \ --variable BUILDCONTEXTPATH=. \ --variable NAMESPACE=default @@ -486,7 +484,18 @@ jobs: curl -m 3 $SERVICEIP:${{env.serviceport}} sleep 5 kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type manifests --variable WORKFLOWNAME=someWorkflow --variable BRANCHNAME=main --variable ACRRESOURCEGROUP=someAcrResourceGroup --variable AZURECONTAINERREGISTRY=someRegistry --variable CONTAINERNAME=someContainer --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup --variable CLUSTERNAME=someAksCluster --variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters --variable DOCKERFILE=./Dockerfile --variable BUILDCONTEXTPATH=. --variable NAMESPACE=default + - run: ./draft -v generate-workflow\ + --deploy-type manifests\ + --variable WORKFLOWNAME=someWorkflow \ + --variable BRANCHNAME=main \ + --variable ACRRESOURCEGROUP=someAcrResourceGroup \ + --variable AZURECONTAINERREGISTRY=someRegistry \ + --variable CONTAINERNAME=someContainer \ + --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup \ + --variable CLUSTERNAME=someAksCluster \ + --variable DOCKERFILE=./Dockerfile \ + --variable BUILDCONTEXTPATH=. \ + --variable NAMESPACE=default # Validate generated workflow yaml - name: Install action-validator with asdf uses: asdf-vm/actions/install@v1 diff --git a/pkg/config/draftconfig_template_test.go b/pkg/config/draftconfig_template_test.go index b798a4a1d..f5251ba56 100644 --- a/pkg/config/draftconfig_template_test.go +++ b/pkg/config/draftconfig_template_test.go @@ -39,6 +39,7 @@ var validVariableKinds = map[string]bool{ "azureServiceConnection": true, "containerImageName": true, "containerImageVersion": true, + "clusterResourceType": true, "dirPath": true, "dockerFileName": true, "envVarMap": true, diff --git a/template/workflows/helm/draft.yaml b/template/workflows/helm/draft.yaml index 987874936..912a9f1ca 100644 --- a/template/workflows/helm/draft.yaml +++ b/template/workflows/helm/draft.yaml @@ -94,3 +94,11 @@ variables: value: "false" description: "enable creation of target namespace if it does not exist" versions: ">=0.0.1" + - name: "CLUSTERRESOURCETYPE" + type: "string" + kind: "clusterResourceType" + default: + disablePrompt: true + value: "Microsoft.ContainerService/managedClusters" + description: "ARM resource type for cluster" + versions: ">=0.0.1" diff --git a/template/workflows/kustomize/draft.yaml b/template/workflows/kustomize/draft.yaml index 47bda64bf..2137fa144 100644 --- a/template/workflows/kustomize/draft.yaml +++ b/template/workflows/kustomize/draft.yaml @@ -78,3 +78,11 @@ variables: value: "false" description: "enable creation of target namespace if it does not exist" versions: ">=0.0.1" + - name: "CLUSTERRESOURCETYPE" + type: "string" + kind: "clusterResourceType" + default: + disablePrompt: true + value: "Microsoft.ContainerService/managedClusters" + description: "ARM resource type for cluster" + versions: ">=0.0.1" diff --git a/template/workflows/manifests/draft.yaml b/template/workflows/manifests/draft.yaml index b94698e70..f9c1b3e8a 100644 --- a/template/workflows/manifests/draft.yaml +++ b/template/workflows/manifests/draft.yaml @@ -78,3 +78,11 @@ variables: value: "false" description: "enable creation of target namespace if it does not exist" versions: ">=0.0.1" + - name: "CLUSTERRESOURCETYPE" + type: "string" + kind: "clusterResourceType" + default: + disablePrompt: true + value: "Microsoft.ContainerService/managedClusters" + description: "ARM resource type for cluster" + versions: ">=0.0.1" From 0a8caafa5007c9101c483089a5bb4b5a482ba9b0 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Mon, 27 Jan 2025 14:55:35 -0500 Subject: [PATCH 4/6] update status checks to always run, add deploytype check for manifests (#477) --- .../workflows/integration-per-language.yml | 6 +- .github/workflows/integration-tests.yml | 142 +++++++++++++----- 2 files changed, 112 insertions(+), 36 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 6eb6d4a91..b3fa82694 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -484,8 +484,10 @@ jobs: curl -m 3 $SERVICEIP:${{env.serviceport}} sleep 5 kill $tunnelPID - - run: ./draft -v generate-workflow\ - --deploy-type manifests\ + - run: | + ./draft -v generate-workflow \ + -d ./langtest/ \ + --deploy-type manifests \ --variable WORKFLOWNAME=someWorkflow \ --variable BRANCHNAME=main \ --variable ACRRESOURCEGROUP=someAcrResourceGroup \ diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 56fdc463c..922e866a7 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -62,46 +62,120 @@ jobs: name: check_windows_addon_kustomize path: ./test/check_windows_addon_kustomize.ps1 if-no-files-found: error - language-integration-test: - name: Matrix + gomodule: needs: - build-linux - build-windows - strategy: - matrix: - language: ["gomodule"] # we dont actually want a matrix here, so we include cases individually - repo: ["davidgamero/go_echo"] - include: - - language: "go" - repo: "davidgamero/go-echo-no-mod" - - language: "python" - repo: "OliverMKing/flask-hello-world" - - language: "rust" - repo: "OliverMKing/tiny-http-hello-world" - - language: "javascript" - repo: "davidgamero/express-hello-world" - - language: "ruby" - repo: "davidgamero/sinatra-hello-world" - - language: "csharp" - repo: "imiller31/csharp-simple-web-app" - - language: "java" - repo: "imiller31/simple-java-server" - - language: "gradle" - repo: "imiller31/simple-gradle-server" - - language: "swift" - repo: "OliverMKing/swift-hello-world" - - language: "erlang" - repo: "bfoley13/ErlangExample" - - language: "clojure" - repo: "imiller31/clojure-simple-http" uses: ./.github/workflows/integration-per-language.yml with: - language: ${{ matrix.language }} - repo: ${{ matrix.repo }} - linux-integration-summary: + language: gomodule + repo: davidgamero/go_echo + go: + needs: + - build-linux + - build-windows + uses: ./.github/workflows/integration-per-language.yml + with: + language: go + repo: "davidgamero/go-echo-no-mod" + python: + needs: + - build-linux + - build-windows + uses: ./.github/workflows/integration-per-language.yml + with: + language: "python" + repo: "OliverMKing/flask-hello-world" + rust: + needs: + - build-linux + - build-windows + uses: ./.github/workflows/integration-per-language.yml + with: + language: "rust" + repo: "OliverMKing/tiny-http-hello-world" + javascript: + needs: + - build-linux + - build-windows + uses: ./.github/workflows/integration-per-language.yml + with: + language: "javascript" + repo: "davidgamero/express-hello-world" + ruby: + needs: + - build-linux + - build-windows + uses: ./.github/workflows/integration-per-language.yml + with: + language: "ruby" + repo: "davidgamero/sinatra-hello-world" + csharp: + needs: + - build-linux + - build-windows + uses: ./.github/workflows/integration-per-language.yml + with: + language: "csharp" + repo: "imiller31/csharp-simple-web-app" + java: + needs: + - build-linux + - build-windows + uses: ./.github/workflows/integration-per-language.yml + with: + language: "java" + repo: "imiller31/simple-java-server" + gradle: + needs: + - build-linux + - build-windows + uses: ./.github/workflows/integration-per-language.yml + with: + language: "gradle" + repo: "imiller31/simple-gradle-server" + swift: + needs: + - build-linux + - build-windows + uses: ./.github/workflows/integration-per-language.yml + with: + language: "swift" + repo: "OliverMKing/swift-hello-world" + erlang: + needs: + - build-linux + - build-windows + uses: ./.github/workflows/integration-per-language.yml + with: + language: "erlang" + repo: "bfoley13/ErlangExample" + clojure: + needs: + - build-linux + - build-windows + uses: ./.github/workflows/integration-per-language.yml + with: + language: "clojure" + repo: "imiller31/clojure-simple-http" + linux-integration-fail: name: Integration Test Summary - needs: language-integration-test runs-on: ubuntu-latest + needs: + - gomodule + - go + - python + - rust + - javascript + - ruby + - csharp + - java + - gradle + - swift + - erlang + - clojure + if: ${{ cancelled() || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'failure') }} # i cant believe this is necessary https://github.com/actions/runner/issues/2566 steps: - run: | - echo "Success" + echo "Some workflows have failed!" + exit 1 From 8177a627f1d4862d67b330b3cd0d3277dbf03f5f Mon Sep 17 00:00:00 2001 From: David Gamero Date: Mon, 27 Jan 2025 20:43:09 -0500 Subject: [PATCH 5/6] dont wait on fleet type helm workflows (#479) --- .../helm/.github/workflows/azure-kubernetes-service-helm.yml | 4 +++- .../helm/.github/workflows/azure-kubernetes-service-helm.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml b/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml index 3b3f14a20..243b013a8 100644 --- a/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml +++ b/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml @@ -147,5 +147,7 @@ jobs: - name: Deploy application on public cluster if: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' }} + env: + WAIT_FLAG: ${{ (env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets') && '--wait') || '' }} # don't wait for fleet hubs run: | - helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} + helm upgrade ${{ env.WAIT_FLAG }} -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} diff --git a/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml b/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml index ba72ebefb..8979b70df 100644 --- a/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml +++ b/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml @@ -147,6 +147,8 @@ jobs: - name: Deploy application on public cluster if: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' }} + env: + WAIT_FLAG: ${{ (env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets') && '--wait') || '' }} # don't wait for fleet hubs run: | - helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} + helm upgrade ${{ env.WAIT_FLAG }} -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} `}} From 766380d0055e6aa92bb9cadcf70e640800fe72f8 Mon Sep 17 00:00:00 2001 From: Suneha Bose Date: Mon, 27 Jan 2025 18:33:16 -0800 Subject: [PATCH 6/6] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f41291b6..f1412ceaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [0.17.2] - 2025-01-27 - [476](https://github.com/Azure/draft/pull/476) Add default value for CLUSTERRESOURCETYPE in draft.yaml - [477](https://github.com/Azure/draft/pull/477) Explicitly require jobs for each language to allow failure to be reported and prevent PR merging in case of a failure +- [479](https://github.com/Azure/draft/pull/479) Remove helm `wait` flag for fleet clusters ## [0.17.1] - 2025-01-24