From 450b03e49e0893660868c1c8b446c59bd91e0123 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 16:38:13 -0500 Subject: [PATCH 01/14] cluster resource type --- .github/workflows/integration-per-language.yml | 1 - template/workflows/helm/draft.yaml | 8 ++++++++ template/workflows/kustomize/draft.yaml | 8 ++++++++ template/workflows/manifests/draft.yaml | 8 ++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index b635f6ae2..4286c4159 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 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 b3d06938995ba8942627fe653513b7aa10582f56 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 16:48:25 -0500 Subject: [PATCH 02/14] add cluster type handler --- pkg/config/draftconfig_template_test.go | 1 + 1 file changed, 1 insertion(+) 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, From a5b78a2fef5592d5288da2252099aea2bbbf0912 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 16:54:07 -0500 Subject: [PATCH 03/14] other deploy types --- .github/workflows/integration-per-language.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 4286c4159..6eb6d4a91 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -331,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 @@ -485,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 From 3b314c8d93ac43b867d0197f1495126d0475ab51 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 17:06:11 -0500 Subject: [PATCH 04/14] dir --- .github/workflows/integration-per-language.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 6eb6d4a91..6010adf20 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -485,6 +485,7 @@ jobs: sleep 5 kill $tunnelPID - run: ./draft -v generate-workflow\ + -d ./langtest/ \ --deploy-type manifests\ --variable WORKFLOWNAME=someWorkflow \ --variable BRANCHNAME=main \ From 9f1ac0ebc502919900c40fd1f778608f6539eb8c Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 17:13:43 -0500 Subject: [PATCH 05/14] always report integration test status --- .github/workflows/integration-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 56fdc463c..edbde0383 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -102,6 +102,7 @@ jobs: name: Integration Test Summary needs: language-integration-test runs-on: ubuntu-latest + if: ${{ always() }} # run even if needed jobs have failed steps: - run: | echo "Success" From 6bf180b60b03250e55beec8bf233df3527852485 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 17:39:39 -0500 Subject: [PATCH 06/14] fail on dependent job fail --- .github/workflows/integration-tests.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index edbde0383..f82d57a0e 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -98,11 +98,10 @@ jobs: with: language: ${{ matrix.language }} repo: ${{ matrix.repo }} - linux-integration-summary: + linux-integration-fail: name: Integration Test Summary - needs: language-integration-test - runs-on: ubuntu-latest - if: ${{ always() }} # run even if needed jobs have failed + needs: linux-integration-test + if: failure() || cancelled() # https://github.com/orgs/community/discussions/60792 steps: - - run: | - echo "Success" + - name: Fail + run: exit 1 From 0a98c381e91c73484bc444ccad3b06bd3410003f Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 17:47:52 -0500 Subject: [PATCH 07/14] runs on --- .github/workflows/integration-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index f82d57a0e..23bf153f0 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -100,6 +100,7 @@ jobs: repo: ${{ matrix.repo }} linux-integration-fail: name: Integration Test Summary + runs-on: ubuntu-latest needs: linux-integration-test if: failure() || cancelled() # https://github.com/orgs/community/discussions/60792 steps: From c9c8baa1698a8437d5d873ebb2566af7e31c9922 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 17:50:31 -0500 Subject: [PATCH 08/14] job id --- .github/workflows/integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 23bf153f0..d032669cc 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -101,7 +101,7 @@ jobs: linux-integration-fail: name: Integration Test Summary runs-on: ubuntu-latest - needs: linux-integration-test + needs: language-integration-test if: failure() || cancelled() # https://github.com/orgs/community/discussions/60792 steps: - name: Fail From 64e34ff30464186fcd5563900e06e24af561e13a Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 18:14:11 -0500 Subject: [PATCH 09/14] no more matrix it doesnt pass fail signal --- .github/workflows/integration-tests.yml | 142 ++++++++++++++++++------ 1 file changed, 107 insertions(+), 35 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index d032669cc..e42ad9f15 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -62,47 +62,119 @@ 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 }} + 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 runs-on: ubuntu-latest - needs: language-integration-test - if: failure() || cancelled() # https://github.com/orgs/community/discussions/60792 + needs: + - gomodule + - go + - python + - rust + - javascript + - ruby + - csharp + - java + - gradle + - swift + - erlang + - clojure steps: - - name: Fail - run: exit 1 + - name: Done + run: | + echo "Success" From 0b133e730a35e8d738914aaa666c0fc79ace753a Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 18:20:32 -0500 Subject: [PATCH 10/14] sequence to map --- .github/workflows/integration-tests.yml | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index e42ad9f15..3ea509ccc 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -84,80 +84,80 @@ jobs: - build-windows uses: ./.github/workflows/integration-per-language.yml with: - - language: "python" - - repo: "OliverMKing/flask-hello-world" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + language: "clojure" + repo: "imiller31/clojure-simple-http" linux-integration-fail: name: Integration Test Summary runs-on: ubuntu-latest From 67c4862ff700bdc56849a6f94a97e16c19eb60af Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 19:37:13 -0500 Subject: [PATCH 11/14] a single space was wrong --- .github/workflows/integration-per-language.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 6010adf20..62f1881f7 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -484,7 +484,7 @@ jobs: curl -m 3 $SERVICEIP:${{env.serviceport}} sleep 5 kill $tunnelPID - - run: ./draft -v generate-workflow\ + - run: ./draft -v generate-workflow \ -d ./langtest/ \ --deploy-type manifests\ --variable WORKFLOWNAME=someWorkflow \ From a72353fe6ba80b68eea5e9ad8972f71972c35bce Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 19:47:42 -0500 Subject: [PATCH 12/14] needs fail check workaround --- .github/workflows/integration-tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 3ea509ccc..922e866a7 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -174,7 +174,8 @@ jobs: - 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: - - name: Done - run: | - echo "Success" + - run: | + echo "Some workflows have failed!" + exit 1 From 84d8d6d81b0e55bb8d3c43a7e7fb69bc8805920e Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 20:00:45 -0500 Subject: [PATCH 13/14] one more space pls --- .github/workflows/integration-per-language.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 62f1881f7..5c47f5b2f 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -486,7 +486,7 @@ jobs: kill $tunnelPID - run: ./draft -v generate-workflow \ -d ./langtest/ \ - --deploy-type manifests\ + --deploy-type manifests \ --variable WORKFLOWNAME=someWorkflow \ --variable BRANCHNAME=main \ --variable ACRRESOURCEGROUP=someAcrResourceGroup \ From 99a85d10405187ad58404d7147bcb9b431ac3080 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 20:25:54 -0500 Subject: [PATCH 14/14] why --- .github/workflows/integration-per-language.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 5c47f5b2f..b3fa82694 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -484,7 +484,8 @@ jobs: curl -m 3 $SERVICEIP:${{env.serviceport}} sleep 5 kill $tunnelPID - - run: ./draft -v generate-workflow \ + - run: | + ./draft -v generate-workflow \ -d ./langtest/ \ --deploy-type manifests \ --variable WORKFLOWNAME=someWorkflow \