From 289d11bb73f00d899d9b1422b577f054ffe39af9 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 3 Dec 2024 14:38:53 +0000 Subject: [PATCH 01/42] first iteration --- .../test-extensions-creators-builds.sh | 69 +++++++++ .../test-extension-workflows-master.yml | 134 ++++++++++-------- 2 files changed, 145 insertions(+), 58 deletions(-) create mode 100755 .github/workflows/scripts/test-extensions-creators-builds.sh diff --git a/.github/workflows/scripts/test-extensions-creators-builds.sh b/.github/workflows/scripts/test-extensions-creators-builds.sh new file mode 100755 index 00000000000..68c28db0191 --- /dev/null +++ b/.github/workflows/scripts/test-extensions-creators-builds.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash + +set -eo pipefail + +validate_tagged_extension_creator() { + TAG=$1 + UPDATE="false" + + if [ -z "$2" ]; then + UPDATE="true" + fi + + DIR=$(mktemp -d) + pushd $DIR > /dev/null + + echo "*** Verifying extension creator for tag ::: ${TAG} ***" + echo "Using temporary directory ${DIR}" + + # TODO: change yarn create to use the new tag approach (jordon to tweak code upstream) + npm init @rancher/extension@${TAG} test-pkg --app-name test-app | cat + + pushd test-pkg > /dev/null + + yarn install + + yarn build-pkg test-pkg | cat + + +# if [ $UPDATE == "true" ]; then +# echo "*** Testing full update path for extensions ***" +# echo "Testing update from legacy-v1 to legacy-v2" + +# #TODO: test update paths when their are implemented +# yarn create @rancher/extension --update "legacy-v2" + +# rm -rf node_modules +# rm -rf yarn.lock + +# yarn install + +# yarn build-pkg test-pkg | cat + +# echo "Testing update from legacy-v2 to latest" + +# #TODO: test update paths when their are implemented +# yarn create @rancher/extension --update "latest" + +# rm -rf node_modules +# rm -rf yarn.lock + +# yarn install + +# yarn build-pkg test-pkg | cat +# fi + + echo "Cleaning temporary dir" + popd > /dev/null + + echo "Removing folder ${DIR}" + rm -rf ${DIR} +} + +# test creating an extension with latest shell releases + build +validate_tagged_extension_creator "legacy-v1" +validate_tagged_extension_creator "legacy-v2" +validate_tagged_extension_creator "latest" + +# test update paths + build +# validate_tagged_extension_creator "legacy-v1" "true" \ No newline at end of file diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 8683db8b665..3929951be25 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -1,8 +1,11 @@ name: Test Extension workflows on: - schedule: - - cron: "0 0 * * *" + # schedule: + # - cron: "0 0 * * *" + push: + branches: + - 12158-test-latest-published-versions-shell defaults: run: @@ -10,71 +13,86 @@ defaults: working-directory: ./ jobs: - retrieve-tags-master: + test-extensions-build: runs-on: ubuntu-latest - outputs: - SHELL_TAG: ${{ steps.retrieve-data.outputs.SHELL_TAG }} - CREATORS_TAG: ${{ steps.retrieve-data.outputs.CREATORS_TAG }} - ECI_TAG: ${{ steps.retrieve-data.outputs.ECI_TAG }} - EXTENSIONS_TAG: ${{ steps.retrieve-data.outputs.EXTENSIONS_TAG }} - CURR_JOB_ID: ${{ github.job }} - tags-job-status: ${{ job.status }} steps: - name: Checkout code uses: actions/checkout@v4 + + - name: Setup Nodejs with yarn caching + uses: actions/setup-node@v4 with: - ref: master + node-version: '20' - name: Retrieve Shell and Creators versions - run: source ./.github/workflows/scripts/retrieve-versions.sh - id: retrieve-data + run: source ./.github/workflows/scripts/test-extensions-creators-build.sh + id: test-extensions-and-creators shell: bash - test-build-extension-charts-master: - needs: retrieve-tags-master - uses: rancher/dashboard/.github/workflows/build-extension-charts.yml@master - permissions: - actions: write - contents: write - deployments: write - pages: write - with: - target_branch: 'gh-pages' - tagged_release: ${{ needs.retrieve-tags-master.outputs.EXTENSIONS_TAG }} - is_test: 'true' - test_ext_repo: 'ui-plugin-examples' - test_ext_branch: 'main' - test-build-extension-catalog-master: - needs: retrieve-tags-master - uses: rancher/dashboard/.github/workflows/build-extension-catalog.yml@master - permissions: - actions: write - contents: read - packages: write - with: - registry_target: ghcr.io - registry_user: ${{ github.actor }} - tagged_release: ${{ needs.retrieve-tags-master.outputs.ECI_TAG }} - is_test: 'true' - test_ext_repo: 'ui-plugin-examples' - test_ext_branch: 'main' - secrets: - registry_token: ${{ secrets.GITHUB_TOKEN }} - test-release-shell-pkg-master: - needs: retrieve-tags-master - uses: rancher/dashboard/.github/workflows/release-shell-pkg.yaml@master - with: - is_test: 'true' - test_branch: 'master' - tag: ${{ needs.retrieve-tags-master.outputs.SHELL_TAG }} - test-release-creators-pkg-master: - needs: retrieve-tags-master - uses: rancher/dashboard/.github/workflows/release-shell-pkg.yaml@master - with: - is_test: 'true' - test_branch: 'master' - tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} + # retrieve-tags-master: + # runs-on: ubuntu-latest + # outputs: + # SHELL_TAG: ${{ steps.retrieve-data.outputs.SHELL_TAG }} + # CREATORS_TAG: ${{ steps.retrieve-data.outputs.CREATORS_TAG }} + # ECI_TAG: ${{ steps.retrieve-data.outputs.ECI_TAG }} + # EXTENSIONS_TAG: ${{ steps.retrieve-data.outputs.EXTENSIONS_TAG }} + # CURR_JOB_ID: ${{ github.job }} + # tags-job-status: ${{ job.status }} + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # ref: master + + # - name: Retrieve Shell and Creators versions + # run: source ./.github/workflows/scripts/retrieve-versions.sh + # id: retrieve-data + # shell: bash + # test-build-extension-charts-master: + # needs: retrieve-tags-master + # uses: rancher/dashboard/.github/workflows/build-extension-charts.yml@master + # permissions: + # actions: write + # contents: write + # deployments: write + # pages: write + # with: + # target_branch: 'gh-pages' + # tagged_release: ${{ needs.retrieve-tags-master.outputs.EXTENSIONS_TAG }} + # is_test: 'true' + # test_ext_repo: 'ui-plugin-examples' + # test_ext_branch: 'main' + # test-build-extension-catalog-master: + # needs: retrieve-tags-master + # uses: rancher/dashboard/.github/workflows/build-extension-catalog.yml@master + # permissions: + # actions: write + # contents: read + # packages: write + # with: + # registry_target: ghcr.io + # registry_user: ${{ github.actor }} + # tagged_release: ${{ needs.retrieve-tags-master.outputs.ECI_TAG }} + # is_test: 'true' + # test_ext_repo: 'ui-plugin-examples' + # test_ext_branch: 'main' + # secrets: + # registry_token: ${{ secrets.GITHUB_TOKEN }} + # test-release-shell-pkg-master: + # needs: retrieve-tags-master + # uses: rancher/dashboard/.github/workflows/release-shell-pkg.yaml@master + # with: + # is_test: 'true' + # test_branch: 'master' + # tag: ${{ needs.retrieve-tags-master.outputs.SHELL_TAG }} + # test-release-creators-pkg-master: + # needs: retrieve-tags-master + # uses: rancher/dashboard/.github/workflows/release-shell-pkg.yaml@master + # with: + # is_test: 'true' + # test_branch: 'master' + # tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} - slack-message: + # slack-message: if: ${{ always() }} runs-on: ubuntu-latest needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master, test-release-shell-pkg-master, test-release-creators-pkg-master] From 8efc9ed7044b604c036dde882188f354c4df14a1 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 3 Dec 2024 14:45:53 +0000 Subject: [PATCH 02/42] comment out other workflows + set correct trigger for testing --- .github/workflows/check-plugins.yaml | 6 +++--- .github/workflows/docusaurus.yaml | 12 ++++++------ .github/workflows/storybook.yaml | 12 ++++++------ .../test-extension-workflows-master.yml | 3 ++- .github/workflows/test.yaml | 16 ++++++++-------- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/check-plugins.yaml b/.github/workflows/check-plugins.yaml index a8fbb48be66..0bece11f287 100644 --- a/.github/workflows/check-plugins.yaml +++ b/.github/workflows/check-plugins.yaml @@ -1,8 +1,8 @@ name: check-plugins-build on: - pull_request: - branches: - - master + # pull_request: + # branches: + # - master env: TEST_PERSIST_BUILD: true jobs: diff --git a/.github/workflows/docusaurus.yaml b/.github/workflows/docusaurus.yaml index 38056fe0316..fc9539c4c76 100644 --- a/.github/workflows/docusaurus.yaml +++ b/.github/workflows/docusaurus.yaml @@ -1,12 +1,12 @@ name: Publish Docusaurus on: - push: - branches: - - master - pull_request: - branches: - - master + # push: + # branches: + # - master + # pull_request: + # branches: + # - master jobs: build: name: Build diff --git a/.github/workflows/storybook.yaml b/.github/workflows/storybook.yaml index b71bc7a58c8..da3bc74f325 100644 --- a/.github/workflows/storybook.yaml +++ b/.github/workflows/storybook.yaml @@ -2,12 +2,12 @@ name: storybook env: STORYBOOK_TOKEN: ${{ secrets.STORYBOOK_TOKEN }} on: - push: - branches: - - master - pull_request: - branches: - - master + # push: + # branches: + # - master + # pull_request: + # branches: + # - master jobs: storybook: runs-on: ubuntu-latest diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 3929951be25..9ef0d8335e0 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -3,9 +3,10 @@ name: Test Extension workflows on: # schedule: # - cron: "0 0 * * *" - push: + pull_request: branches: - 12158-test-latest-published-versions-shell + - master defaults: run: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 102ebaae156..869e6635050 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,13 +1,13 @@ name: Tests on: - push: - branches: - - master - - 'release-*' - pull_request: - branches: - - master - - 'release-*' + # push: + # branches: + # - master + # - 'release-*' + # pull_request: + # branches: + # - master + # - 'release-*' workflow_dispatch: inputs: environment: From 6ad8c5235c1c4c13c4deb70cb0bb5d8cdab96503 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 3 Dec 2024 14:47:11 +0000 Subject: [PATCH 03/42] trigger update --- .github/workflows/test-extension-workflows-master.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 9ef0d8335e0..256517a2397 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -3,6 +3,10 @@ name: Test Extension workflows on: # schedule: # - cron: "0 0 * * *" + push: + branches: + - 12158-test-latest-published-versions-shell + - master pull_request: branches: - 12158-test-latest-published-versions-shell From 509b2791fcbc9533d052cb2cc73da35f1556259b Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 3 Dec 2024 14:48:39 +0000 Subject: [PATCH 04/42] update --- .../test-extension-workflows-master.yml | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 256517a2397..e8e71b40665 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -98,41 +98,41 @@ jobs: # tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} # slack-message: - if: ${{ always() }} - runs-on: ubuntu-latest - needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master, test-release-shell-pkg-master, test-release-creators-pkg-master] - steps: - - name: Slack message for workflow - if: always() - shell: bash - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} - run: | - OUTPUT_ARRAY=("${{ needs.retrieve-tags-master.outputs.tags-job-status }}" "${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" "${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" "${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" "${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}") + # if: ${{ always() }} + # runs-on: ubuntu-latest + # needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master, test-release-shell-pkg-master, test-release-creators-pkg-master] + # steps: + # - name: Slack message for workflow + # if: always() + # shell: bash + # env: + # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} + # run: | + # OUTPUT_ARRAY=("${{ needs.retrieve-tags-master.outputs.tags-job-status }}" "${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" "${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" "${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" "${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}") - if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then - MSG_PREFIX="Workflows testing for extensions failed! 🆘" - else - MSG_PREFIX="Workflows testing for extensions succedded! ✅" - fi + # if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then + # MSG_PREFIX="Workflows testing for extensions failed! 🆘" + # else + # MSG_PREFIX="Workflows testing for extensions succedded! ✅" + # fi - echo "message prefix ::: $MSG_PREFIX" + # echo "message prefix ::: $MSG_PREFIX" - TAGS_OUTPUT_STRING="status for retrieve-tags-master - build => ${{ needs.retrieve-tags-master.outputs.tags-job-status }}" - EXT_CHART_BUILD_OUTPUT_STRING="status for test-build-extension-charts-master - build => ${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" - EXT_CATALOG_BUILD_OUTPUT_STRING="status for test-build-extension-catalog-master - build => ${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" - RELEASE_SHELL_PKG_OUTPUT_STRING="status for test-release-shell-pkg-master - release => ${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" - RELEASE_CREATORS_PKG_OUTPUT_STRING="status for test-release-creators-pkg-master - release => ${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}" + # TAGS_OUTPUT_STRING="status for retrieve-tags-master - build => ${{ needs.retrieve-tags-master.outputs.tags-job-status }}" + # EXT_CHART_BUILD_OUTPUT_STRING="status for test-build-extension-charts-master - build => ${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" + # EXT_CATALOG_BUILD_OUTPUT_STRING="status for test-build-extension-catalog-master - build => ${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" + # RELEASE_SHELL_PKG_OUTPUT_STRING="status for test-release-shell-pkg-master - release => ${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" + # RELEASE_CREATORS_PKG_OUTPUT_STRING="status for test-release-creators-pkg-master - release => ${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}" - echo $TAGS_OUTPUT_STRING - echo $EXT_CHART_BUILD_OUTPUT_STRING - echo $EXT_CATALOG_BUILD_OUTPUT_STRING - echo $RELEASE_SHELL_PKG_OUTPUT_STRING - echo $RELEASE_CREATORS_PKG_OUTPUT_STRING + # echo $TAGS_OUTPUT_STRING + # echo $EXT_CHART_BUILD_OUTPUT_STRING + # echo $EXT_CATALOG_BUILD_OUTPUT_STRING + # echo $RELEASE_SHELL_PKG_OUTPUT_STRING + # echo $RELEASE_CREATORS_PKG_OUTPUT_STRING - MSG="$MSG_PREFIX ::: $TAGS_OUTPUT_STRING ::: $EXT_CHART_BUILD_OUTPUT_STRING ::: $EXT_CATALOG_BUILD_OUTPUT_STRING ::: $RELEASE_SHELL_PKG_OUTPUT_STRING ::: $RELEASE_CREATORS_PKG_OUTPUT_STRING" + # MSG="$MSG_PREFIX ::: $TAGS_OUTPUT_STRING ::: $EXT_CHART_BUILD_OUTPUT_STRING ::: $EXT_CATALOG_BUILD_OUTPUT_STRING ::: $RELEASE_SHELL_PKG_OUTPUT_STRING ::: $RELEASE_CREATORS_PKG_OUTPUT_STRING" - echo "message sent: $MSG" + # echo "message sent: $MSG" - curl -X POST -H 'Content-type: application/json; charset=utf-8' \ - --data "{\"branch\": \"master\", \"message\": \"$MSG\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK \ No newline at end of file + # curl -X POST -H 'Content-type: application/json; charset=utf-8' \ + # --data "{\"branch\": \"master\", \"message\": \"$MSG\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK \ No newline at end of file From 28e2f2836f859fdfb086f5d7f7c85787af1ae068 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 3 Dec 2024 14:49:21 +0000 Subject: [PATCH 05/42] update --- .github/workflows/test-extension-workflows-master.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index e8e71b40665..25b13291a36 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -7,10 +7,10 @@ on: branches: - 12158-test-latest-published-versions-shell - master - pull_request: - branches: - - 12158-test-latest-published-versions-shell - - master + # pull_request: + # branches: + # - 12158-test-latest-published-versions-shell + # - master defaults: run: From 39e1ea909c9e91cfc34bf93934b3a828e9695114 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 3 Dec 2024 14:50:05 +0000 Subject: [PATCH 06/42] update --- .github/workflows/test-extension-workflows-master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 25b13291a36..91aff243f4c 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -30,7 +30,7 @@ jobs: node-version: '20' - name: Retrieve Shell and Creators versions - run: source ./.github/workflows/scripts/test-extensions-creators-build.sh + run: yes | ./.github/workflows/scripts/test-extensions-creators-build.sh id: test-extensions-and-creators shell: bash # retrieve-tags-master: From 201cd4a2dd0e93af18894e155eb3a91da8819841 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 3 Dec 2024 15:14:13 +0000 Subject: [PATCH 07/42] update --- .github/workflows/test-extension-workflows-master.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 91aff243f4c..6f92d14b44e 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -23,6 +23,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + ref: 12158-test-latest-published-versions-shell - name: Setup Nodejs with yarn caching uses: actions/setup-node@v4 From 71b154f7916a521480b311866a3189106a16f411 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 3 Dec 2024 15:17:41 +0000 Subject: [PATCH 08/42] update --- .github/workflows/test-extension-workflows-master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 6f92d14b44e..17379801e24 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -32,7 +32,7 @@ jobs: node-version: '20' - name: Retrieve Shell and Creators versions - run: yes | ./.github/workflows/scripts/test-extensions-creators-build.sh + run: ls .github/workflows/scripts && yes | ./.github/workflows/scripts/test-extensions-creators-build.sh id: test-extensions-and-creators shell: bash # retrieve-tags-master: From ed076c3cacd119045fc25b515f243ab372e46d3b Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 3 Dec 2024 15:18:47 +0000 Subject: [PATCH 09/42] update --- .github/workflows/test-extension-workflows-master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 17379801e24..4de73d128d2 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -32,7 +32,7 @@ jobs: node-version: '20' - name: Retrieve Shell and Creators versions - run: ls .github/workflows/scripts && yes | ./.github/workflows/scripts/test-extensions-creators-build.sh + run: ls .github/workflows/scripts && yes | .github/workflows/scripts/test-extensions-creators-build.sh id: test-extensions-and-creators shell: bash # retrieve-tags-master: From 2f0281b8ea183f6cc132e655e35afebe9411c5d8 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 3 Dec 2024 15:21:22 +0000 Subject: [PATCH 10/42] update --- ...sions-creators-builds.sh => test-extensions-creators-build.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/scripts/{test-extensions-creators-builds.sh => test-extensions-creators-build.sh} (100%) diff --git a/.github/workflows/scripts/test-extensions-creators-builds.sh b/.github/workflows/scripts/test-extensions-creators-build.sh similarity index 100% rename from .github/workflows/scripts/test-extensions-creators-builds.sh rename to .github/workflows/scripts/test-extensions-creators-build.sh From 11beb3a2c1ea184151be63aafcf89efa2dbbffd0 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 3 Dec 2024 16:21:40 +0000 Subject: [PATCH 11/42] update --- .../scripts/test-extensions-creators-build.sh | 15 +++++++++++---- .../workflows/test-extension-workflows-master.yml | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 68c28db0191..7682b2a4602 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -2,9 +2,16 @@ set -eo pipefail +EXTERNAL_TAG=$1 +EXTERNAL_UPDATE=$2 + +if [ -z "${EXTERNAL_TAG}" ]; then + echo "Missing tag set on running this script! Cannot run without a tag!" + exit 1 +fi + validate_tagged_extension_creator() { TAG=$1 - UPDATE="false" if [ -z "$2" ]; then UPDATE="true" @@ -61,9 +68,9 @@ validate_tagged_extension_creator() { } # test creating an extension with latest shell releases + build -validate_tagged_extension_creator "legacy-v1" -validate_tagged_extension_creator "legacy-v2" -validate_tagged_extension_creator "latest" +validate_tagged_extension_creator ${EXTERNAL_TAG} ${EXTERNAL_UPDATE} +# validate_tagged_extension_creator "legacy-v2" +# validate_tagged_extension_creator "latest" # test update paths + build # validate_tagged_extension_creator "legacy-v1" "true" \ No newline at end of file diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 4de73d128d2..a95724ce091 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -18,7 +18,7 @@ defaults: working-directory: ./ jobs: - test-extensions-build: + test-extensions-build-legacy-v1: runs-on: ubuntu-latest steps: - name: Checkout code @@ -29,10 +29,10 @@ jobs: - name: Setup Nodejs with yarn caching uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '16' - name: Retrieve Shell and Creators versions - run: ls .github/workflows/scripts && yes | .github/workflows/scripts/test-extensions-creators-build.sh + run: .github/workflows/scripts/test-extensions-creators-build.sh legacy-v1 id: test-extensions-and-creators shell: bash # retrieve-tags-master: From 6b815b18dfa9803f9975a4394b47f028debfc9dd Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 10:46:46 +0000 Subject: [PATCH 12/42] add more tests + reformat slack message --- .../test-extension-workflows-master.yml | 150 ++++++++++++++---- 1 file changed, 115 insertions(+), 35 deletions(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index a95724ce091..de1b7897ccb 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -20,6 +20,8 @@ defaults: jobs: test-extensions-build-legacy-v1: runs-on: ubuntu-latest + outputs: + test-legacy-v1-job-status: ${{ job.status }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -35,6 +37,44 @@ jobs: run: .github/workflows/scripts/test-extensions-creators-build.sh legacy-v1 id: test-extensions-and-creators shell: bash + test-extensions-build-legacy-v2: + runs-on: ubuntu-latest + outputs: + test-legacy-v2-job-status: ${{ job.status }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: 12158-test-latest-published-versions-shell + + - name: Setup Nodejs with yarn caching + uses: actions/setup-node@v4 + with: + node-version: '16' + + - name: Retrieve Shell and Creators versions + run: .github/workflows/scripts/test-extensions-creators-build.sh legacy-v2 + id: test-extensions-and-creators + shell: bash + test-extensions-build-latest: + runs-on: ubuntu-latest + outputs: + test-latest-job-status: ${{ job.status }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: 12158-test-latest-published-versions-shell + + - name: Setup Nodejs with yarn caching + uses: actions/setup-node@v4 + with: + node-version: '16' + + - name: Retrieve Shell and Creators versions + run: .github/workflows/scripts/test-extensions-creators-build.sh latest + id: test-extensions-and-creators + shell: bash # retrieve-tags-master: # runs-on: ubuntu-latest # outputs: @@ -100,41 +140,81 @@ jobs: # tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} # slack-message: - # if: ${{ always() }} - # runs-on: ubuntu-latest - # needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master, test-release-shell-pkg-master, test-release-creators-pkg-master] - # steps: - # - name: Slack message for workflow - # if: always() - # shell: bash - # env: - # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} - # run: | - # OUTPUT_ARRAY=("${{ needs.retrieve-tags-master.outputs.tags-job-status }}" "${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" "${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" "${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" "${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}") - - # if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then - # MSG_PREFIX="Workflows testing for extensions failed! 🆘" - # else - # MSG_PREFIX="Workflows testing for extensions succedded! ✅" - # fi - - # echo "message prefix ::: $MSG_PREFIX" - - # TAGS_OUTPUT_STRING="status for retrieve-tags-master - build => ${{ needs.retrieve-tags-master.outputs.tags-job-status }}" - # EXT_CHART_BUILD_OUTPUT_STRING="status for test-build-extension-charts-master - build => ${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" - # EXT_CATALOG_BUILD_OUTPUT_STRING="status for test-build-extension-catalog-master - build => ${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" - # RELEASE_SHELL_PKG_OUTPUT_STRING="status for test-release-shell-pkg-master - release => ${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" - # RELEASE_CREATORS_PKG_OUTPUT_STRING="status for test-release-creators-pkg-master - release => ${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}" - - # echo $TAGS_OUTPUT_STRING - # echo $EXT_CHART_BUILD_OUTPUT_STRING - # echo $EXT_CATALOG_BUILD_OUTPUT_STRING - # echo $RELEASE_SHELL_PKG_OUTPUT_STRING - # echo $RELEASE_CREATORS_PKG_OUTPUT_STRING + # if: ${{ always() }} + # runs-on: ubuntu-latest + # needs: [test-extensions-build-legacy-v1, test-extensions-build-legacy-v2, test-extensions-build-latest, retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master, test-release-shell-pkg-master, test-release-creators-pkg-master] + # steps: + # - name: Slack message for workflow + # if: always() + # shell: bash + # env: + # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} + # run: | + # OUTPUT_ARRAY=("${{ needs.retrieve-tags-master.outputs.tags-job-status }}" "${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" "${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" "${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" "${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}") + + # if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then + # MSG_PREFIX="\nWorkflows testing for extensions failed! 🆘" + # else + # MSG_PREFIX="\nWorkflows testing for extensions succedded! ✅" + # fi + + # echo "message prefix ::: $MSG_PREFIX" + + # TAGS_OUTPUT_STRING="Status for retrieve-tags-master - build => ${{ needs.retrieve-tags-master.outputs.tags-job-status }}" + # EXT_CHART_BUILD_OUTPUT_STRING="Status for test-build-extension-charts-master - build => ${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" + # EXT_CATALOG_BUILD_OUTPUT_STRING="Status for test-build-extension-catalog-master - build => ${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" + # RELEASE_SHELL_PKG_OUTPUT_STRING="Status for test-release-shell-pkg-master - release => ${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" + # RELEASE_CREATORS_PKG_OUTPUT_STRING="Status for test-release-creators-pkg-master - release => ${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}" + + # echo $TAGS_OUTPUT_STRING + # echo $EXT_CHART_BUILD_OUTPUT_STRING + # echo $EXT_CATALOG_BUILD_OUTPUT_STRING + # echo $RELEASE_SHELL_PKG_OUTPUT_STRING + # echo $RELEASE_CREATORS_PKG_OUTPUT_STRING - # MSG="$MSG_PREFIX ::: $TAGS_OUTPUT_STRING ::: $EXT_CHART_BUILD_OUTPUT_STRING ::: $EXT_CATALOG_BUILD_OUTPUT_STRING ::: $RELEASE_SHELL_PKG_OUTPUT_STRING ::: $RELEASE_CREATORS_PKG_OUTPUT_STRING" + # MSG="$MSG_PREFIX \n::: $TAGS_OUTPUT_STRING \n::: $EXT_CHART_BUILD_OUTPUT_STRING \n::: $EXT_CATALOG_BUILD_OUTPUT_STRING \n::: $RELEASE_SHELL_PKG_OUTPUT_STRING \n::: $RELEASE_CREATORS_PKG_OUTPUT_STRING" + + # echo "message sent: $MSG" + + # curl -X POST -H 'Content-type: application/json; charset=utf-8' \ + # --data "{\"branch\": \"master\", \"message\": \"$MSG\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK + + slack-message: + if: ${{ always() }} + runs-on: ubuntu-latest + needs: [test-extensions-build-legacy-v1, test-extensions-build-legacy-v2, test-extensions-build-latest] + steps: + - name: Slack message for workflow + if: always() + shell: bash + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} + run: | + OUTPUT_ARRAY=("${{ needs.test-extensions-build-legacy-v1.outputs.test-legacy-v1-job-status }}" "${{ needs.test-extensions-build-legacy-v2.outputs.test-legacy-v2-job-status }}" "${{ needs.test-extensions-build-latest.outputs.test-latest-job-status }}") + JOB_NAME_ARRAY=("test-extensions-build-legacy-v1 job" "test-extensions-build-legacy-v2 job" "test-extensions-build-latest job") + + if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then + MSG_PREFIX="\nWorkflows testing for extensions failed! 🆘" + else + MSG_PREFIX="\nWorkflows testing for extensions succedded! ✅" + fi + + echo "message prefix ::: $MSG_PREFIX" + + MSG_OUTPUT="$MSG_PREFIX" + + for i in "${OUTPUT_ARRAY[@]}" + do + echo "$i" + if [[ ${OUTPUT_ARRAY[@]} = "failure" ]]; then + EMOJI="🆘" + else + EMOJI="✅" + fi + MSG_OUTPUT="$MSG_OUTPUT \n::: Status for ${JOB_NAME_ARRAY[$i]} => ${OUTPUT_ARRAY[$i]} $EMOJI" + done - # echo "message sent: $MSG" + echo "message sent: $MSG_OUTPUT" - # curl -X POST -H 'Content-type: application/json; charset=utf-8' \ - # --data "{\"branch\": \"master\", \"message\": \"$MSG\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK \ No newline at end of file + curl -X POST -H 'Content-type: application/json; charset=utf-8' \ + --data "{\"branch\": \"master\", \"message\": \"$MSG\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK \ No newline at end of file From 0eaed56682b3cd31907347cd337e0e572c2d19c1 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 10:49:34 +0000 Subject: [PATCH 13/42] update --- .github/workflows/test-extension-workflows-master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index de1b7897ccb..bd7eec62aed 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -206,7 +206,7 @@ jobs: for i in "${OUTPUT_ARRAY[@]}" do echo "$i" - if [[ ${OUTPUT_ARRAY[@]} = "failure" ]]; then + if [[ ${OUTPUT_ARRAY[$1]} = "failure" ]]; then EMOJI="🆘" else EMOJI="✅" From c4a96cb9a259968b6d6b2b390efe5d090af4af4b Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 10:50:00 +0000 Subject: [PATCH 14/42] update --- .github/workflows/test-extension-workflows-master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index bd7eec62aed..382d83ba7fe 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -69,7 +69,7 @@ jobs: - name: Setup Nodejs with yarn caching uses: actions/setup-node@v4 with: - node-version: '16' + node-version: '20' - name: Retrieve Shell and Creators versions run: .github/workflows/scripts/test-extensions-creators-build.sh latest From 69b44b57351640da39dfbdcd2fd7057296b1b49a Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 10:51:57 +0000 Subject: [PATCH 15/42] update --- .github/workflows/test-extension-workflows-master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 382d83ba7fe..bd7eec62aed 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -69,7 +69,7 @@ jobs: - name: Setup Nodejs with yarn caching uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '16' - name: Retrieve Shell and Creators versions run: .github/workflows/scripts/test-extensions-creators-build.sh latest From 94091f36be8163663c22260c1f58916a8f53ff67 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 10:56:51 +0000 Subject: [PATCH 16/42] update --- .github/workflows/test-extension-workflows-master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index bd7eec62aed..e2ef14bdce1 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -206,7 +206,7 @@ jobs: for i in "${OUTPUT_ARRAY[@]}" do echo "$i" - if [[ ${OUTPUT_ARRAY[$1]} = "failure" ]]; then + if [[ $OUTPUT_ARRAY[$1] == "failure" ]]; then EMOJI="🆘" else EMOJI="✅" From 19a3e37dbf48d2dea5bd958aedcb85bdb48c5815 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 10:59:57 +0000 Subject: [PATCH 17/42] update --- .github/workflows/test-extension-workflows-master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index e2ef14bdce1..177bf132374 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -211,7 +211,7 @@ jobs: else EMOJI="✅" fi - MSG_OUTPUT="$MSG_OUTPUT \n::: Status for ${JOB_NAME_ARRAY[$i]} => ${OUTPUT_ARRAY[$i]} $EMOJI" + MSG_OUTPUT="$MSG_OUTPUT \n::: Status for $JOB_NAME_ARRAY[$i] => $OUTPUT_ARRAY[$i] $EMOJI" done echo "message sent: $MSG_OUTPUT" From 8a8289acb793a1dfb23d91c6d5d433472fbf3a7d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 11:02:01 +0000 Subject: [PATCH 18/42] update --- .github/workflows/test-extension-workflows-master.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 177bf132374..a507cc2ea67 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -203,15 +203,15 @@ jobs: MSG_OUTPUT="$MSG_PREFIX" - for i in "${OUTPUT_ARRAY[@]}" + for index in "${!OUTPUT_ARRAY[@]}" do - echo "$i" - if [[ $OUTPUT_ARRAY[$1] == "failure" ]]; then + echo "$index" + if [[ ${OUTPUT_ARRAY[$index]} == "failure" ]]; then EMOJI="🆘" else EMOJI="✅" fi - MSG_OUTPUT="$MSG_OUTPUT \n::: Status for $JOB_NAME_ARRAY[$i] => $OUTPUT_ARRAY[$i] $EMOJI" + MSG_OUTPUT="$MSG_OUTPUT \n::: Status for ${JOB_NAME_ARRAY[$index]} => ${OUTPUT_ARRAY[$index]} $EMOJI" done echo "message sent: $MSG_OUTPUT" From b5d432a2d1da30e959f096ef38663cd467d4c95a Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 11:33:45 +0000 Subject: [PATCH 19/42] update --- .../scripts/test-extensions-creators-build.sh | 32 +++++++++---------- .../test-extension-workflows-master.yml | 3 +- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 7682b2a4602..fbe9088bbb1 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -33,32 +33,30 @@ validate_tagged_extension_creator() { yarn build-pkg test-pkg | cat -# if [ $UPDATE == "true" ]; then -# echo "*** Testing full update path for extensions ***" -# echo "Testing update from legacy-v1 to legacy-v2" + if [ $UPDATE == "true" ]; then + echo "*** Testing full update path for extensions ***" + echo "Testing update from legacy-v1 to legacy-v2" -# #TODO: test update paths when their are implemented -# yarn create @rancher/extension --update "legacy-v2" + npm init @rancher/extension@legacy-v2 -- --update -# rm -rf node_modules -# rm -rf yarn.lock + rm -rf node_modules + rm -rf yarn.lock -# yarn install + yarn install -# yarn build-pkg test-pkg | cat + yarn build-pkg test-pkg | cat -# echo "Testing update from legacy-v2 to latest" + echo "Testing update from legacy-v2 to latest" -# #TODO: test update paths when their are implemented -# yarn create @rancher/extension --update "latest" + npm init @rancher/extension -- --migrate -# rm -rf node_modules -# rm -rf yarn.lock + rm -rf node_modules + rm -rf yarn.lock -# yarn install + yarn install -# yarn build-pkg test-pkg | cat -# fi + yarn build-pkg test-pkg | cat + fi echo "Cleaning temporary dir" popd > /dev/null diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index a507cc2ea67..1179afd11e1 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -34,7 +34,7 @@ jobs: node-version: '16' - name: Retrieve Shell and Creators versions - run: .github/workflows/scripts/test-extensions-creators-build.sh legacy-v1 + run: .github/workflows/scripts/test-extensions-creators-build.sh legacy-v1 true id: test-extensions-and-creators shell: bash test-extensions-build-legacy-v2: @@ -205,7 +205,6 @@ jobs: for index in "${!OUTPUT_ARRAY[@]}" do - echo "$index" if [[ ${OUTPUT_ARRAY[$index]} == "failure" ]]; then EMOJI="🆘" else From db5cd91fd71536874e460e0832aa647f3e813776 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 11:37:26 +0000 Subject: [PATCH 20/42] update --- .github/workflows/scripts/test-extensions-creators-build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index fbe9088bbb1..119754a8240 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -13,7 +13,8 @@ fi validate_tagged_extension_creator() { TAG=$1 - if [ -z "$2" ]; then + if [ -n "$2" ]; then + echo "will also cover the update path and migration on this run" UPDATE="true" fi From 011e558597072aba35063ba37a546110e8943586 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 15:41:35 +0000 Subject: [PATCH 21/42] update --- .../scripts/test-extensions-creators-build.sh | 39 +++-- .../test-extension-workflows-master.yml | 151 ++++++++++++------ 2 files changed, 128 insertions(+), 62 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 119754a8240..de6451e5e8d 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -2,19 +2,14 @@ set -eo pipefail -EXTERNAL_TAG=$1 -EXTERNAL_UPDATE=$2 - -if [ -z "${EXTERNAL_TAG}" ]; then - echo "Missing tag set on running this script! Cannot run without a tag!" - exit 1 -fi validate_tagged_extension_creator() { TAG=$1 + NODE_VERSION=$2 + UPDATE=$3 - if [ -n "$2" ]; then - echo "will also cover the update path and migration on this run" + if [ -n "$UPDATE" ]; then + echo "*** Will also cover the UPDATE path and MIGRATION on this run! ***" UPDATE="true" fi @@ -24,6 +19,11 @@ validate_tagged_extension_creator() { echo "*** Verifying extension creator for tag ::: ${TAG} ***" echo "Using temporary directory ${DIR}" + echo "=> Setting up node version required for this env: ${NODE_VERSION}" + + nvm install ${NODE_VERSION} + nvm use ${NODE_VERSION} + # TODO: change yarn create to use the new tag approach (jordon to tweak code upstream) npm init @rancher/extension@${TAG} test-pkg --app-name test-app | cat @@ -35,10 +35,10 @@ validate_tagged_extension_creator() { if [ $UPDATE == "true" ]; then - echo "*** Testing full update path for extensions ***" - echo "Testing update from legacy-v1 to legacy-v2" + echo "*** Testing FULL UPGRADE path for extensions ***" + echo "Testing UPGRADE from legacy-v1 to legacy-v2" - npm init @rancher/extension@legacy-v2 -- --update + npm init @rancher/extension@legacy-v2 -- --update -f rm -rf node_modules rm -rf yarn.lock @@ -47,7 +47,12 @@ validate_tagged_extension_creator() { yarn build-pkg test-pkg | cat - echo "Testing update from legacy-v2 to latest" + echo "*** Testing UPGRADE from legacy-v2 to latest ***" + + echo "=> Updating node version required for last leg of upgrade path: v20" + + nvm install v20 + nvm use v20 npm init @rancher/extension -- --migrate @@ -67,9 +72,9 @@ validate_tagged_extension_creator() { } # test creating an extension with latest shell releases + build -validate_tagged_extension_creator ${EXTERNAL_TAG} ${EXTERNAL_UPDATE} -# validate_tagged_extension_creator "legacy-v2" -# validate_tagged_extension_creator "latest" +validate_tagged_extension_creator "legacy-v1" "v16" +validate_tagged_extension_creator "legacy-v2" "v16" +validate_tagged_extension_creator "latest" "v20" # test update paths + build -# validate_tagged_extension_creator "legacy-v1" "true" \ No newline at end of file +validate_tagged_extension_creator "legacy-v1" "v16" "true" \ No newline at end of file diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 1179afd11e1..5a69fa2c1d6 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -18,63 +18,82 @@ defaults: working-directory: ./ jobs: - test-extensions-build-legacy-v1: + test-extensions-creators-and-update-paths: runs-on: ubuntu-latest outputs: - test-legacy-v1-job-status: ${{ job.status }} + test-extensions-creators-and-update-paths-job-status: ${{ job.status }} steps: - name: Checkout code uses: actions/checkout@v4 with: ref: 12158-test-latest-published-versions-shell - - name: Setup Nodejs with yarn caching - uses: actions/setup-node@v4 - with: - node-version: '16' + # - name: Setup Nodejs with yarn caching + # uses: actions/setup-node@v4 + # with: + # node-version: '16' - name: Retrieve Shell and Creators versions - run: .github/workflows/scripts/test-extensions-creators-build.sh legacy-v1 true + run: .github/workflows/scripts/test-extensions-creators-build.sh id: test-extensions-and-creators shell: bash - test-extensions-build-legacy-v2: - runs-on: ubuntu-latest - outputs: - test-legacy-v2-job-status: ${{ job.status }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: 12158-test-latest-published-versions-shell + # test-extensions-build-legacy-v1: + # runs-on: ubuntu-latest + # outputs: + # test-legacy-v1-job-status: ${{ job.status }} + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # ref: 12158-test-latest-published-versions-shell - - name: Setup Nodejs with yarn caching - uses: actions/setup-node@v4 - with: - node-version: '16' + # - name: Setup Nodejs with yarn caching + # uses: actions/setup-node@v4 + # with: + # node-version: '16' - - name: Retrieve Shell and Creators versions - run: .github/workflows/scripts/test-extensions-creators-build.sh legacy-v2 - id: test-extensions-and-creators - shell: bash - test-extensions-build-latest: - runs-on: ubuntu-latest - outputs: - test-latest-job-status: ${{ job.status }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: 12158-test-latest-published-versions-shell + # - name: Retrieve Shell and Creators versions + # run: .github/workflows/scripts/test-extensions-creators-build.sh legacy-v1 true + # id: test-extensions-and-creators + # shell: bash + # test-extensions-build-legacy-v2: + # runs-on: ubuntu-latest + # outputs: + # test-legacy-v2-job-status: ${{ job.status }} + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # ref: 12158-test-latest-published-versions-shell - - name: Setup Nodejs with yarn caching - uses: actions/setup-node@v4 - with: - node-version: '16' + # - name: Setup Nodejs with yarn caching + # uses: actions/setup-node@v4 + # with: + # node-version: '16' - - name: Retrieve Shell and Creators versions - run: .github/workflows/scripts/test-extensions-creators-build.sh latest - id: test-extensions-and-creators - shell: bash + # - name: Retrieve Shell and Creators versions + # run: .github/workflows/scripts/test-extensions-creators-build.sh legacy-v2 + # id: test-extensions-and-creators + # shell: bash + # test-extensions-build-latest: + # runs-on: ubuntu-latest + # outputs: + # test-latest-job-status: ${{ job.status }} + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # ref: 12158-test-latest-published-versions-shell + + # - name: Setup Nodejs with yarn caching + # uses: actions/setup-node@v4 + # with: + # node-version: '16' + + # - name: Retrieve Shell and Creators versions + # run: .github/workflows/scripts/test-extensions-creators-build.sh latest + # id: test-extensions-and-creators + # shell: bash # retrieve-tags-master: # runs-on: ubuntu-latest # outputs: @@ -179,10 +198,52 @@ jobs: # curl -X POST -H 'Content-type: application/json; charset=utf-8' \ # --data "{\"branch\": \"master\", \"message\": \"$MSG\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK + ################### + # THIS ONE WORKS JUST FINE!!!!! + ################### + # slack-message: + # if: ${{ always() }} + # runs-on: ubuntu-latest + # needs: [test-extensions-build-legacy-v1, test-extensions-build-legacy-v2, test-extensions-build-latest] + # steps: + # - name: Slack message for workflow + # if: always() + # shell: bash + # env: + # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} + # run: | + # OUTPUT_ARRAY=("${{ needs.test-extensions-build-legacy-v1.outputs.test-legacy-v1-job-status }}" "${{ needs.test-extensions-build-legacy-v2.outputs.test-legacy-v2-job-status }}" "${{ needs.test-extensions-build-latest.outputs.test-latest-job-status }}") + # JOB_NAME_ARRAY=("test-extensions-build-legacy-v1 job" "test-extensions-build-legacy-v2 job" "test-extensions-build-latest job") + + # if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then + # MSG_PREFIX="\nWorkflows testing for extensions failed! 🆘" + # else + # MSG_PREFIX="\nWorkflows testing for extensions succedded! ✅" + # fi + + # echo "message prefix ::: $MSG_PREFIX" + + # MSG_OUTPUT="$MSG_PREFIX" + + # for index in "${!OUTPUT_ARRAY[@]}" + # do + # if [[ ${OUTPUT_ARRAY[$index]} == "failure" ]]; then + # EMOJI="🆘" + # else + # EMOJI="✅" + # fi + # MSG_OUTPUT="$MSG_OUTPUT \n::: Status for ${JOB_NAME_ARRAY[$index]} => ${OUTPUT_ARRAY[$index]} $EMOJI" + # done + + # echo "message sent: $MSG_OUTPUT" + + # curl -X POST -H 'Content-type: application/json; charset=utf-8' \ + # --data "{\"branch\": \"master\", \"message\": \"$MSG\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK + slack-message: if: ${{ always() }} runs-on: ubuntu-latest - needs: [test-extensions-build-legacy-v1, test-extensions-build-legacy-v2, test-extensions-build-latest] + needs: [test-extensions-creators-and-update-paths] steps: - name: Slack message for workflow if: always() @@ -190,8 +251,8 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | - OUTPUT_ARRAY=("${{ needs.test-extensions-build-legacy-v1.outputs.test-legacy-v1-job-status }}" "${{ needs.test-extensions-build-legacy-v2.outputs.test-legacy-v2-job-status }}" "${{ needs.test-extensions-build-latest.outputs.test-latest-job-status }}") - JOB_NAME_ARRAY=("test-extensions-build-legacy-v1 job" "test-extensions-build-legacy-v2 job" "test-extensions-build-latest job") + OUTPUT_ARRAY=("${{ needs.test-extensions-creators-and-update-paths-job-status.outputs.test-legacy-v1-job-status }}") + JOB_NAME_ARRAY=("test-extensions-creators-and-update-paths-job-status job") if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then MSG_PREFIX="\nWorkflows testing for extensions failed! 🆘" @@ -216,4 +277,4 @@ jobs: echo "message sent: $MSG_OUTPUT" curl -X POST -H 'Content-type: application/json; charset=utf-8' \ - --data "{\"branch\": \"master\", \"message\": \"$MSG\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK \ No newline at end of file + --data "{\"branch\": \"master\", \"message\": \"$MSG_OUTPUT\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK \ No newline at end of file From ec732125179b9b707eb786708fc01bf4ea5415d1 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 15:44:57 +0000 Subject: [PATCH 22/42] update --- .github/workflows/test-extension-workflows-master.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 5a69fa2c1d6..2b90cd0564e 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -28,10 +28,12 @@ jobs: with: ref: 12158-test-latest-published-versions-shell - # - name: Setup Nodejs with yarn caching - # uses: actions/setup-node@v4 - # with: - # node-version: '16' + - name: Sourcing NVM + shell: bash + run: | + export NVM_DIR=~/.nvm + source ~/.nvm/nvm.sh + npm --help - name: Retrieve Shell and Creators versions run: .github/workflows/scripts/test-extensions-creators-build.sh From 43a524f5cde336f586eb82a49676daf92e00978d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 15:45:54 +0000 Subject: [PATCH 23/42] update --- .github/workflows/test-extension-workflows-master.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 2b90cd0564e..943dbcfc657 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -33,7 +33,6 @@ jobs: run: | export NVM_DIR=~/.nvm source ~/.nvm/nvm.sh - npm --help - name: Retrieve Shell and Creators versions run: .github/workflows/scripts/test-extensions-creators-build.sh From ccbb87ef3ee742b9db7237b186cd594015007d88 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 15:47:14 +0000 Subject: [PATCH 24/42] update --- .github/workflows/scripts/test-extensions-creators-build.sh | 6 ++++++ .github/workflows/test-extension-workflows-master.yml | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index de6451e5e8d..feb542adfd9 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -13,6 +13,10 @@ validate_tagged_extension_creator() { UPDATE="true" fi + export NVM_DIR=~/.nvm + source ~/.nvm/nvm.sh + npm --help + DIR=$(mktemp -d) pushd $DIR > /dev/null @@ -21,6 +25,8 @@ validate_tagged_extension_creator() { echo "=> Setting up node version required for this env: ${NODE_VERSION}" + + nvm install ${NODE_VERSION} nvm use ${NODE_VERSION} diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 943dbcfc657..1862156e3e1 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -28,12 +28,6 @@ jobs: with: ref: 12158-test-latest-published-versions-shell - - name: Sourcing NVM - shell: bash - run: | - export NVM_DIR=~/.nvm - source ~/.nvm/nvm.sh - - name: Retrieve Shell and Creators versions run: .github/workflows/scripts/test-extensions-creators-build.sh id: test-extensions-and-creators From e08f032643ba3373309c261be92dcd929272a833 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 15:48:12 +0000 Subject: [PATCH 25/42] update --- .github/workflows/scripts/test-extensions-creators-build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index feb542adfd9..6480ea3ea0c 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -15,7 +15,6 @@ validate_tagged_extension_creator() { export NVM_DIR=~/.nvm source ~/.nvm/nvm.sh - npm --help DIR=$(mktemp -d) pushd $DIR > /dev/null From 22fcd3783541cfbe451f02fd1579a6c6fc814b04 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 16:06:41 +0000 Subject: [PATCH 26/42] update --- .../scripts/test-extensions-creators-build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 6480ea3ea0c..7edf1c93fd8 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -19,7 +19,9 @@ validate_tagged_extension_creator() { DIR=$(mktemp -d) pushd $DIR > /dev/null + echo "*** ***************************************** ***" echo "*** Verifying extension creator for tag ::: ${TAG} ***" + echo "*** ***************************************** ***" echo "Using temporary directory ${DIR}" echo "=> Setting up node version required for this env: ${NODE_VERSION}" @@ -40,10 +42,14 @@ validate_tagged_extension_creator() { if [ $UPDATE == "true" ]; then + echo "*** ***************************************** ***" echo "*** Testing FULL UPGRADE path for extensions ***" - echo "Testing UPGRADE from legacy-v1 to legacy-v2" + echo "*** ***************************************** ***" + echo "=> Testing UPGRADE from legacy-v1 to legacy-v2" - npm init @rancher/extension@legacy-v2 -- --update -f + git init + + npm init @rancher/extension@legacy-v2 -- --update rm -rf node_modules rm -rf yarn.lock @@ -52,7 +58,9 @@ validate_tagged_extension_creator() { yarn build-pkg test-pkg | cat + echo "*** ***************************************** ***" echo "*** Testing UPGRADE from legacy-v2 to latest ***" + echo "*** ***************************************** ***" echo "=> Updating node version required for last leg of upgrade path: v20" From b11724b307532a647f1e506354d8d547f71221ef Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 16:06:56 +0000 Subject: [PATCH 27/42] update --- .github/workflows/scripts/test-extensions-creators-build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 7edf1c93fd8..c6df0d741e5 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -85,9 +85,9 @@ validate_tagged_extension_creator() { } # test creating an extension with latest shell releases + build -validate_tagged_extension_creator "legacy-v1" "v16" -validate_tagged_extension_creator "legacy-v2" "v16" -validate_tagged_extension_creator "latest" "v20" +# validate_tagged_extension_creator "legacy-v1" "v16" +# validate_tagged_extension_creator "legacy-v2" "v16" +# validate_tagged_extension_creator "latest" "v20" # test update paths + build validate_tagged_extension_creator "legacy-v1" "v16" "true" \ No newline at end of file From 24d1b3e54ee21aedb01c9356f167d51b0a3e83b7 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 16:28:27 +0000 Subject: [PATCH 28/42] update --- .../scripts/test-extensions-creators-build.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index c6df0d741e5..f39ed98a712 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh set -eo pipefail @@ -13,6 +13,7 @@ validate_tagged_extension_creator() { UPDATE="true" fi + # these two commands will allow for NVM to work in bash, since it's included in ubuntu-latest export NVM_DIR=~/.nvm source ~/.nvm/nvm.sh @@ -26,18 +27,19 @@ validate_tagged_extension_creator() { echo "=> Setting up node version required for this env: ${NODE_VERSION}" - - + # setting up correct version of node nvm install ${NODE_VERSION} nvm use ${NODE_VERSION} - # TODO: change yarn create to use the new tag approach (jordon to tweak code upstream) + # generate skeleton app npm init @rancher/extension@${TAG} test-pkg --app-name test-app | cat pushd test-pkg > /dev/null + # install dependencies yarn install + # test build of pkg inside skeleton app yarn build-pkg test-pkg | cat From fe7bfb03f6df8d9b08773b11e4bc1027ad51fc58 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 16:32:29 +0000 Subject: [PATCH 29/42] update --- .../workflows/scripts/test-extensions-creators-build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index f39ed98a712..7f04df2b7db 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash set -eo pipefail @@ -34,7 +34,7 @@ validate_tagged_extension_creator() { # generate skeleton app npm init @rancher/extension@${TAG} test-pkg --app-name test-app | cat - pushd test-pkg > /dev/null + cd test-pkg # install dependencies yarn install @@ -44,6 +44,9 @@ validate_tagged_extension_creator() { if [ $UPDATE == "true" ]; then + pushd $DIR > /dev/null + cd test-pkg + echo "*** ***************************************** ***" echo "*** Testing FULL UPGRADE path for extensions ***" echo "*** ***************************************** ***" From 8a89219ad32aa8ae73d19a05fa887eb1694c8249 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 16:34:58 +0000 Subject: [PATCH 30/42] update --- .../workflows/scripts/test-extensions-creators-build.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 7f04df2b7db..88e36f2b730 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -34,7 +34,7 @@ validate_tagged_extension_creator() { # generate skeleton app npm init @rancher/extension@${TAG} test-pkg --app-name test-app | cat - cd test-pkg + pushd test-pkg > /dev/null # install dependencies yarn install @@ -44,14 +44,13 @@ validate_tagged_extension_creator() { if [ $UPDATE == "true" ]; then - pushd $DIR > /dev/null - cd test-pkg - echo "*** ***************************************** ***" echo "*** Testing FULL UPGRADE path for extensions ***" echo "*** ***************************************** ***" echo "=> Testing UPGRADE from legacy-v1 to legacy-v2" + yarn install + git init npm init @rancher/extension@legacy-v2 -- --update From d128722846028e8a93705a12cb17e77a102bdd4d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 16:37:33 +0000 Subject: [PATCH 31/42] update --- .github/workflows/scripts/test-extensions-creators-build.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 88e36f2b730..971634d3370 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -49,11 +49,9 @@ validate_tagged_extension_creator() { echo "*** ***************************************** ***" echo "=> Testing UPGRADE from legacy-v1 to legacy-v2" - yarn install - git init - npm init @rancher/extension@legacy-v2 -- --update + npm init @rancher/extension@legacy-v2 --update rm -rf node_modules rm -rf yarn.lock From 658ad072bd32982676f90960ff0ed85ee2333993 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 17:26:14 +0000 Subject: [PATCH 32/42] update --- .../scripts/test-extensions-creators-build.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 971634d3370..8496a2283a1 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -26,6 +26,10 @@ validate_tagged_extension_creator() { echo "Using temporary directory ${DIR}" echo "=> Setting up node version required for this env: ${NODE_VERSION}" + echo "=> Current dir 1:" + ls + echo "=> Current dir 2:" + pwd # setting up correct version of node nvm install ${NODE_VERSION} @@ -42,6 +46,10 @@ validate_tagged_extension_creator() { # test build of pkg inside skeleton app yarn build-pkg test-pkg | cat + echo "=> Current dir 3:" + ls + echo "=> Current dir 4:" + pwd if [ $UPDATE == "true" ]; then echo "*** ***************************************** ***" @@ -49,8 +57,18 @@ validate_tagged_extension_creator() { echo "*** ***************************************** ***" echo "=> Testing UPGRADE from legacy-v1 to legacy-v2" + echo "=> Current dir 5:" + ls + echo "=> Current dir 6:" + pwd + git init + echo "=> Current dir 7:" + ls + echo "=> Current dir 8:" + pwd + npm init @rancher/extension@legacy-v2 --update rm -rf node_modules From 3c840052df00bb549a2fa1ee1afea833a6dbeb4c Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 17:29:03 +0000 Subject: [PATCH 33/42] update --- .github/workflows/scripts/test-extensions-creators-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 8496a2283a1..223becb8fba 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -69,7 +69,7 @@ validate_tagged_extension_creator() { echo "=> Current dir 8:" pwd - npm init @rancher/extension@legacy-v2 --update + npm init @rancher/extension@legacy-v2 -- --update rm -rf node_modules rm -rf yarn.lock From 656d88ae27229c0bc4151fe21983e8e00b6c1e67 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 17:58:34 +0000 Subject: [PATCH 34/42] update --- .../scripts/test-extensions-creators-build.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 223becb8fba..e157b5bd408 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -27,8 +27,6 @@ validate_tagged_extension_creator() { echo "=> Setting up node version required for this env: ${NODE_VERSION}" echo "=> Current dir 1:" - ls - echo "=> Current dir 2:" pwd # setting up correct version of node @@ -46,9 +44,7 @@ validate_tagged_extension_creator() { # test build of pkg inside skeleton app yarn build-pkg test-pkg | cat - echo "=> Current dir 3:" - ls - echo "=> Current dir 4:" + echo "=> Current dir 2:" pwd if [ $UPDATE == "true" ]; then @@ -57,16 +53,14 @@ validate_tagged_extension_creator() { echo "*** ***************************************** ***" echo "=> Testing UPGRADE from legacy-v1 to legacy-v2" - echo "=> Current dir 5:" - ls - echo "=> Current dir 6:" + echo "=> Current dir 3:" pwd git init + #when doing git init, we are sent to .git folder + cd .. - echo "=> Current dir 7:" - ls - echo "=> Current dir 8:" + echo "=> Current dir 4:" pwd npm init @rancher/extension@legacy-v2 -- --update From e4988d3de4ba8e1cca54d9d5236335a28c247494 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 4 Dec 2024 18:04:42 +0000 Subject: [PATCH 35/42] update --- .github/workflows/scripts/test-extensions-creators-build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index e157b5bd408..c7c986c8b60 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -59,6 +59,7 @@ validate_tagged_extension_creator() { git init #when doing git init, we are sent to .git folder cd .. + cd test-pkg echo "=> Current dir 4:" pwd From adc4494c97a922958657c5a2503e22e13c8dbf69 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Thu, 5 Dec 2024 09:44:06 +0000 Subject: [PATCH 36/42] update --- .../scripts/test-extensions-creators-build.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index c7c986c8b60..8be56aabbe7 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -2,6 +2,8 @@ set -eo pipefail +SKELETON_APP_NAME="test-pkg" + validate_tagged_extension_creator() { TAG=$1 @@ -18,7 +20,7 @@ validate_tagged_extension_creator() { source ~/.nvm/nvm.sh DIR=$(mktemp -d) - pushd $DIR > /dev/null + cd $DIR echo "*** ***************************************** ***" echo "*** Verifying extension creator for tag ::: ${TAG} ***" @@ -34,15 +36,14 @@ validate_tagged_extension_creator() { nvm use ${NODE_VERSION} # generate skeleton app - npm init @rancher/extension@${TAG} test-pkg --app-name test-app | cat - - pushd test-pkg > /dev/null + npm init @rancher/extension@${TAG} ${SKELETON_APP_NAME} --app-name test-app | cat + cd ${SKELETON_APP_NAME} # install dependencies yarn install # test build of pkg inside skeleton app - yarn build-pkg test-pkg | cat + yarn build-pkg ${SKELETON_APP_NAME} | cat echo "=> Current dir 2:" pwd @@ -59,7 +60,7 @@ validate_tagged_extension_creator() { git init #when doing git init, we are sent to .git folder cd .. - cd test-pkg + cd ${SKELETON_APP_NAME} echo "=> Current dir 4:" pwd @@ -71,7 +72,7 @@ validate_tagged_extension_creator() { yarn install - yarn build-pkg test-pkg | cat + yarn build-pkg ${SKELETON_APP_NAME} | cat echo "*** ***************************************** ***" echo "*** Testing UPGRADE from legacy-v2 to latest ***" @@ -89,11 +90,11 @@ validate_tagged_extension_creator() { yarn install - yarn build-pkg test-pkg | cat + yarn build-pkg ${SKELETON_APP_NAME} | cat fi echo "Cleaning temporary dir" - popd > /dev/null + cd ${DIR} echo "Removing folder ${DIR}" rm -rf ${DIR} From 20ab51ae0a331b05d0eba3bed1d816fcb1afbd38 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Thu, 5 Dec 2024 10:17:26 +0000 Subject: [PATCH 37/42] update --- .../scripts/test-extensions-creators-build.sh | 167 +++++++++++++++--- .../test-extension-workflows-master.yml | 2 +- 2 files changed, 140 insertions(+), 29 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 8be56aabbe7..5393c8233e9 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -1,10 +1,9 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh -set -eo pipefail +set -e SKELETON_APP_NAME="test-pkg" - validate_tagged_extension_creator() { TAG=$1 NODE_VERSION=$2 @@ -15,12 +14,13 @@ validate_tagged_extension_creator() { UPDATE="true" fi - # these two commands will allow for NVM to work in bash, since it's included in ubuntu-latest - export NVM_DIR=~/.nvm - source ~/.nvm/nvm.sh + # These two commands will allow for NVM to work in sh + export NVM_DIR="$HOME/.nvm" + # shellcheck disable=SC1090 + . "$NVM_DIR/nvm.sh" DIR=$(mktemp -d) - cd $DIR + cd "$DIR" || exit 1 echo "*** ***************************************** ***" echo "*** Verifying extension creator for tag ::: ${TAG} ***" @@ -31,24 +31,24 @@ validate_tagged_extension_creator() { echo "=> Current dir 1:" pwd - # setting up correct version of node - nvm install ${NODE_VERSION} - nvm use ${NODE_VERSION} + # Setting up the correct version of Node + nvm install "${NODE_VERSION}" + nvm use "${NODE_VERSION}" - # generate skeleton app - npm init @rancher/extension@${TAG} ${SKELETON_APP_NAME} --app-name test-app | cat - cd ${SKELETON_APP_NAME} + # Generate skeleton app + npm init @rancher/extension@"${TAG}" "${SKELETON_APP_NAME}" --app-name test-app | cat + cd "${SKELETON_APP_NAME}" || exit 1 - # install dependencies + # Install dependencies yarn install - # test build of pkg inside skeleton app - yarn build-pkg ${SKELETON_APP_NAME} | cat + # Test build of pkg inside skeleton app + yarn build-pkg "${SKELETON_APP_NAME}" | cat echo "=> Current dir 2:" pwd - if [ $UPDATE == "true" ]; then + if [ "$UPDATE" = "true" ]; then echo "*** ***************************************** ***" echo "*** Testing FULL UPGRADE path for extensions ***" echo "*** ***************************************** ***" @@ -58,9 +58,9 @@ validate_tagged_extension_creator() { pwd git init - #when doing git init, we are sent to .git folder + # When doing git init, we are sent to the .git folder cd .. - cd ${SKELETON_APP_NAME} + cd "${SKELETON_APP_NAME}" || exit 1 echo "=> Current dir 4:" pwd @@ -68,11 +68,11 @@ validate_tagged_extension_creator() { npm init @rancher/extension@legacy-v2 -- --update rm -rf node_modules - rm -rf yarn.lock + rm -f yarn.lock yarn install - yarn build-pkg ${SKELETON_APP_NAME} | cat + yarn build-pkg "${SKELETON_APP_NAME}" | cat echo "*** ***************************************** ***" echo "*** Testing UPGRADE from legacy-v2 to latest ***" @@ -86,24 +86,135 @@ validate_tagged_extension_creator() { npm init @rancher/extension -- --migrate rm -rf node_modules - rm -rf yarn.lock + rm -f yarn.lock yarn install - yarn build-pkg ${SKELETON_APP_NAME} | cat + yarn build-pkg "${SKELETON_APP_NAME}" | cat fi echo "Cleaning temporary dir" - cd ${DIR} + cd "${DIR}" || exit 1 echo "Removing folder ${DIR}" - rm -rf ${DIR} + rm -rf "${DIR}" } -# test creating an extension with latest shell releases + build +# Test creating an extension with latest shell releases + build # validate_tagged_extension_creator "legacy-v1" "v16" # validate_tagged_extension_creator "legacy-v2" "v16" # validate_tagged_extension_creator "latest" "v20" -# test update paths + build -validate_tagged_extension_creator "legacy-v1" "v16" "true" \ No newline at end of file +# Test update paths + build +validate_tagged_extension_creator "legacy-v1" "v16" "true" + + +# #!/usr/bin/env bash + +# set -eo pipefail + +# SKELETON_APP_NAME="test-pkg" + + +# validate_tagged_extension_creator() { +# TAG=$1 +# NODE_VERSION=$2 +# UPDATE=$3 + +# if [ -n "$UPDATE" ]; then +# echo "*** Will also cover the UPDATE path and MIGRATION on this run! ***" +# UPDATE="true" +# fi + +# # these two commands will allow for NVM to work in bash, since it's included in ubuntu-latest +# export NVM_DIR=~/.nvm +# source ~/.nvm/nvm.sh + +# DIR=$(mktemp -d) +# cd $DIR + +# echo "*** ***************************************** ***" +# echo "*** Verifying extension creator for tag ::: ${TAG} ***" +# echo "*** ***************************************** ***" +# echo "Using temporary directory ${DIR}" + +# echo "=> Setting up node version required for this env: ${NODE_VERSION}" +# echo "=> Current dir 1:" +# pwd + +# # setting up correct version of node +# nvm install ${NODE_VERSION} +# nvm use ${NODE_VERSION} + +# # generate skeleton app +# npm init @rancher/extension@${TAG} ${SKELETON_APP_NAME} --app-name test-app | cat +# cd ${SKELETON_APP_NAME} + +# # install dependencies +# yarn install + +# # test build of pkg inside skeleton app +# yarn build-pkg ${SKELETON_APP_NAME} | cat + +# echo "=> Current dir 2:" +# pwd + +# if [ $UPDATE == "true" ]; then +# echo "*** ***************************************** ***" +# echo "*** Testing FULL UPGRADE path for extensions ***" +# echo "*** ***************************************** ***" +# echo "=> Testing UPGRADE from legacy-v1 to legacy-v2" + +# echo "=> Current dir 3:" +# pwd + +# git init +# #when doing git init, we are sent to .git folder +# cd .. +# cd ${SKELETON_APP_NAME} + +# echo "=> Current dir 4:" +# pwd + +# npm init @rancher/extension@legacy-v2 -- --update + +# rm -rf node_modules +# rm -rf yarn.lock + +# yarn install + +# yarn build-pkg ${SKELETON_APP_NAME} | cat + +# echo "*** ***************************************** ***" +# echo "*** Testing UPGRADE from legacy-v2 to latest ***" +# echo "*** ***************************************** ***" + +# echo "=> Updating node version required for last leg of upgrade path: v20" + +# nvm install v20 +# nvm use v20 + +# npm init @rancher/extension -- --migrate + +# rm -rf node_modules +# rm -rf yarn.lock + +# yarn install + +# yarn build-pkg ${SKELETON_APP_NAME} | cat +# fi + +# echo "Cleaning temporary dir" +# cd ${DIR} + +# echo "Removing folder ${DIR}" +# rm -rf ${DIR} +# } + +# # test creating an extension with latest shell releases + build +# # validate_tagged_extension_creator "legacy-v1" "v16" +# # validate_tagged_extension_creator "legacy-v2" "v16" +# # validate_tagged_extension_creator "latest" "v20" + +# # test update paths + build +# validate_tagged_extension_creator "legacy-v1" "v16" "true" \ No newline at end of file diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 1862156e3e1..70a65a57aa7 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -31,7 +31,7 @@ jobs: - name: Retrieve Shell and Creators versions run: .github/workflows/scripts/test-extensions-creators-build.sh id: test-extensions-and-creators - shell: bash + shell: sh # test-extensions-build-legacy-v1: # runs-on: ubuntu-latest # outputs: From 2bacac89ab8bbe3db5048a9d7a5bc591fe55fe4c Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Thu, 5 Dec 2024 10:30:32 +0000 Subject: [PATCH 38/42] convert back to bash --- .../scripts/test-extensions-creators-build.sh | 168 +++--------------- .../test-extension-workflows-master.yml | 2 +- 2 files changed, 30 insertions(+), 140 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 5393c8233e9..4eb434df480 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -1,9 +1,10 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash -set -e +set -eo pipefail SKELETON_APP_NAME="test-pkg" + validate_tagged_extension_creator() { TAG=$1 NODE_VERSION=$2 @@ -14,13 +15,12 @@ validate_tagged_extension_creator() { UPDATE="true" fi - # These two commands will allow for NVM to work in sh - export NVM_DIR="$HOME/.nvm" - # shellcheck disable=SC1090 - . "$NVM_DIR/nvm.sh" + # these two commands will allow for NVM to work in bash, since it's included in ubuntu-latest + export NVM_DIR=~/.nvm + source ~/.nvm/nvm.sh DIR=$(mktemp -d) - cd "$DIR" || exit 1 + cd $DIR echo "*** ***************************************** ***" echo "*** Verifying extension creator for tag ::: ${TAG} ***" @@ -31,24 +31,24 @@ validate_tagged_extension_creator() { echo "=> Current dir 1:" pwd - # Setting up the correct version of Node - nvm install "${NODE_VERSION}" - nvm use "${NODE_VERSION}" + # setting up correct version of node + nvm install ${NODE_VERSION} + nvm use ${NODE_VERSION} - # Generate skeleton app - npm init @rancher/extension@"${TAG}" "${SKELETON_APP_NAME}" --app-name test-app | cat - cd "${SKELETON_APP_NAME}" || exit 1 + # generate skeleton app + npm init @rancher/extension@${TAG} ${SKELETON_APP_NAME} --app-name test-app | cat + cd ${SKELETON_APP_NAME} - # Install dependencies + # install dependencies yarn install - # Test build of pkg inside skeleton app - yarn build-pkg "${SKELETON_APP_NAME}" | cat + # test build of pkg inside skeleton app + yarn build-pkg ${SKELETON_APP_NAME} | cat echo "=> Current dir 2:" pwd - if [ "$UPDATE" = "true" ]; then + if [ $UPDATE == "true" ]; then echo "*** ***************************************** ***" echo "*** Testing FULL UPGRADE path for extensions ***" echo "*** ***************************************** ***" @@ -58,9 +58,10 @@ validate_tagged_extension_creator() { pwd git init - # When doing git init, we are sent to the .git folder + #when doing git init, we are sent to .git folder cd .. - cd "${SKELETON_APP_NAME}" || exit 1 + cd ${SKELETON_APP_NAME} + cd pkg echo "=> Current dir 4:" pwd @@ -68,11 +69,11 @@ validate_tagged_extension_creator() { npm init @rancher/extension@legacy-v2 -- --update rm -rf node_modules - rm -f yarn.lock + rm -rf yarn.lock yarn install - yarn build-pkg "${SKELETON_APP_NAME}" | cat + yarn build-pkg ${SKELETON_APP_NAME} | cat echo "*** ***************************************** ***" echo "*** Testing UPGRADE from legacy-v2 to latest ***" @@ -86,135 +87,24 @@ validate_tagged_extension_creator() { npm init @rancher/extension -- --migrate rm -rf node_modules - rm -f yarn.lock + rm -rf yarn.lock yarn install - yarn build-pkg "${SKELETON_APP_NAME}" | cat + yarn build-pkg ${SKELETON_APP_NAME} | cat fi echo "Cleaning temporary dir" - cd "${DIR}" || exit 1 + cd ${DIR} echo "Removing folder ${DIR}" - rm -rf "${DIR}" + rm -rf ${DIR} } -# Test creating an extension with latest shell releases + build +# test creating an extension with latest shell releases + build # validate_tagged_extension_creator "legacy-v1" "v16" # validate_tagged_extension_creator "legacy-v2" "v16" # validate_tagged_extension_creator "latest" "v20" -# Test update paths + build -validate_tagged_extension_creator "legacy-v1" "v16" "true" - - -# #!/usr/bin/env bash - -# set -eo pipefail - -# SKELETON_APP_NAME="test-pkg" - - -# validate_tagged_extension_creator() { -# TAG=$1 -# NODE_VERSION=$2 -# UPDATE=$3 - -# if [ -n "$UPDATE" ]; then -# echo "*** Will also cover the UPDATE path and MIGRATION on this run! ***" -# UPDATE="true" -# fi - -# # these two commands will allow for NVM to work in bash, since it's included in ubuntu-latest -# export NVM_DIR=~/.nvm -# source ~/.nvm/nvm.sh - -# DIR=$(mktemp -d) -# cd $DIR - -# echo "*** ***************************************** ***" -# echo "*** Verifying extension creator for tag ::: ${TAG} ***" -# echo "*** ***************************************** ***" -# echo "Using temporary directory ${DIR}" - -# echo "=> Setting up node version required for this env: ${NODE_VERSION}" -# echo "=> Current dir 1:" -# pwd - -# # setting up correct version of node -# nvm install ${NODE_VERSION} -# nvm use ${NODE_VERSION} - -# # generate skeleton app -# npm init @rancher/extension@${TAG} ${SKELETON_APP_NAME} --app-name test-app | cat -# cd ${SKELETON_APP_NAME} - -# # install dependencies -# yarn install - -# # test build of pkg inside skeleton app -# yarn build-pkg ${SKELETON_APP_NAME} | cat - -# echo "=> Current dir 2:" -# pwd - -# if [ $UPDATE == "true" ]; then -# echo "*** ***************************************** ***" -# echo "*** Testing FULL UPGRADE path for extensions ***" -# echo "*** ***************************************** ***" -# echo "=> Testing UPGRADE from legacy-v1 to legacy-v2" - -# echo "=> Current dir 3:" -# pwd - -# git init -# #when doing git init, we are sent to .git folder -# cd .. -# cd ${SKELETON_APP_NAME} - -# echo "=> Current dir 4:" -# pwd - -# npm init @rancher/extension@legacy-v2 -- --update - -# rm -rf node_modules -# rm -rf yarn.lock - -# yarn install - -# yarn build-pkg ${SKELETON_APP_NAME} | cat - -# echo "*** ***************************************** ***" -# echo "*** Testing UPGRADE from legacy-v2 to latest ***" -# echo "*** ***************************************** ***" - -# echo "=> Updating node version required for last leg of upgrade path: v20" - -# nvm install v20 -# nvm use v20 - -# npm init @rancher/extension -- --migrate - -# rm -rf node_modules -# rm -rf yarn.lock - -# yarn install - -# yarn build-pkg ${SKELETON_APP_NAME} | cat -# fi - -# echo "Cleaning temporary dir" -# cd ${DIR} - -# echo "Removing folder ${DIR}" -# rm -rf ${DIR} -# } - -# # test creating an extension with latest shell releases + build -# # validate_tagged_extension_creator "legacy-v1" "v16" -# # validate_tagged_extension_creator "legacy-v2" "v16" -# # validate_tagged_extension_creator "latest" "v20" - -# # test update paths + build -# validate_tagged_extension_creator "legacy-v1" "v16" "true" \ No newline at end of file +# test update paths + build +validate_tagged_extension_creator "legacy-v1" "v16" "true" \ No newline at end of file diff --git a/.github/workflows/test-extension-workflows-master.yml b/.github/workflows/test-extension-workflows-master.yml index 70a65a57aa7..1862156e3e1 100644 --- a/.github/workflows/test-extension-workflows-master.yml +++ b/.github/workflows/test-extension-workflows-master.yml @@ -31,7 +31,7 @@ jobs: - name: Retrieve Shell and Creators versions run: .github/workflows/scripts/test-extensions-creators-build.sh id: test-extensions-and-creators - shell: sh + shell: bash # test-extensions-build-legacy-v1: # runs-on: ubuntu-latest # outputs: From ddae8eabfb32c4aa8fb1ac2e8cd2792dc0362ef4 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Thu, 5 Dec 2024 11:07:27 +0000 Subject: [PATCH 39/42] test after changing upgrade to bash --- .github/workflows/scripts/test-extensions-creators-build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 4eb434df480..8be56aabbe7 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -61,7 +61,6 @@ validate_tagged_extension_creator() { #when doing git init, we are sent to .git folder cd .. cd ${SKELETON_APP_NAME} - cd pkg echo "=> Current dir 4:" pwd From ed22966f95259649e18324e02ef909820082e68a Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Thu, 5 Dec 2024 11:16:05 +0000 Subject: [PATCH 40/42] debug package.jsons --- .../workflows/scripts/test-extensions-creators-build.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 8be56aabbe7..6bb0c57af6d 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -72,6 +72,9 @@ validate_tagged_extension_creator() { yarn install + cat package.json + cat /pkg/test-pkg/package.json + yarn build-pkg ${SKELETON_APP_NAME} | cat echo "*** ***************************************** ***" @@ -85,6 +88,10 @@ validate_tagged_extension_creator() { npm init @rancher/extension -- --migrate + # debug changes done via migration script + cat package.json + cat /pkg/test-pkg/package.json + rm -rf node_modules rm -rf yarn.lock From f52dfa579fca09414e855a6f471c1c0b65a0d0ad Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Thu, 5 Dec 2024 11:50:13 +0000 Subject: [PATCH 41/42] debug package.jsons --- .github/workflows/scripts/test-extensions-creators-build.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 6bb0c57af6d..3d323a0ba03 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -73,7 +73,6 @@ validate_tagged_extension_creator() { yarn install cat package.json - cat /pkg/test-pkg/package.json yarn build-pkg ${SKELETON_APP_NAME} | cat @@ -90,7 +89,6 @@ validate_tagged_extension_creator() { # debug changes done via migration script cat package.json - cat /pkg/test-pkg/package.json rm -rf node_modules rm -rf yarn.lock From 20728ca08071f12a7bb336a45b7ee5dfb6da1ce4 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Thu, 5 Dec 2024 12:37:21 +0000 Subject: [PATCH 42/42] run all script tests --- .github/workflows/scripts/test-extensions-creators-build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scripts/test-extensions-creators-build.sh b/.github/workflows/scripts/test-extensions-creators-build.sh index 3d323a0ba03..f4fccdd5ab0 100755 --- a/.github/workflows/scripts/test-extensions-creators-build.sh +++ b/.github/workflows/scripts/test-extensions-creators-build.sh @@ -106,9 +106,9 @@ validate_tagged_extension_creator() { } # test creating an extension with latest shell releases + build -# validate_tagged_extension_creator "legacy-v1" "v16" -# validate_tagged_extension_creator "legacy-v2" "v16" -# validate_tagged_extension_creator "latest" "v20" +validate_tagged_extension_creator "legacy-v1" "v16" +validate_tagged_extension_creator "legacy-v2" "v16" +validate_tagged_extension_creator "latest" "v20" # test update paths + build validate_tagged_extension_creator "legacy-v1" "v16" "true" \ No newline at end of file