From 1288a51c7889ad48ee70b85675dd6eeb456fd03a Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 11:59:48 +0000 Subject: [PATCH 01/84] iterate --- .github/workflows/build-extension-charts.yml | 24 +- .github/workflows/check-plugins.yaml | 38 --- .github/workflows/docusaurus.yaml | 54 ---- .github/workflows/storybook.yaml | 27 -- .../workflows/test-extension-workflows.yml | 26 ++ .github/workflows/test.yaml | 258 ------------------ 6 files changed, 47 insertions(+), 380 deletions(-) delete mode 100644 .github/workflows/check-plugins.yaml delete mode 100644 .github/workflows/docusaurus.yaml delete mode 100644 .github/workflows/storybook.yaml create mode 100644 .github/workflows/test-extension-workflows.yml delete mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 0cb43d4408d..cbe7306e084 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -9,6 +9,15 @@ on: tagged_release: required: true type: string + is_test: + required: false + type: string + test_repo: + required: false + type: string + test_branch: + required: false + type: string env: ACTIONS_RUNNER_DEBUG: false @@ -27,7 +36,16 @@ jobs: actions: write contents: read steps: - - name: Checkout + - if: is_test == 'true' + name: Checkout (test flow) + uses: actions/checkout@v4 + with: + repository: rancher/${{ inputs.test_repo }} + ref: ${{ inputs.test_branch }} + fetch-depth: 0 + + - if: is_test != 'true' + name: Checkout (normal flow) uses: actions/checkout@v4 with: fetch-depth: 0 @@ -83,7 +101,7 @@ jobs: release: name: Release Build - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test != 'true' needs: build-extension-artifact runs-on: ubuntu-latest permissions: @@ -119,4 +137,4 @@ jobs: charts_dir: ./charts/* env: CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - CR_SKIP_EXISTING: true + CR_SKIP_EXISTING: true \ No newline at end of file diff --git a/.github/workflows/check-plugins.yaml b/.github/workflows/check-plugins.yaml deleted file mode 100644 index a8fbb48be66..00000000000 --- a/.github/workflows/check-plugins.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: check-plugins-build -on: - pull_request: - branches: - - master -env: - TEST_PERSIST_BUILD: true -jobs: - validate: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Enable Corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'yarn' - - - name: Validate Plugin build system - run: ./shell/scripts/test-plugins-build.sh - shell: bash - - - name: Upload files - uses: actions/upload-artifact@v3 - if: failure() - with: - name: test - path: | - /tmp/tmp.**/test-app - !/tmp/tmp.**/test-app/dist/js/*.map - !/tmp/tmp.**/test-app/node_modules/ - !/tmp/tmp.**/test-app/pkg/test-pkg/node_modules/ - retention-days: 2 diff --git a/.github/workflows/docusaurus.yaml b/.github/workflows/docusaurus.yaml deleted file mode 100644 index 38056fe0316..00000000000 --- a/.github/workflows/docusaurus.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: Publish Docusaurus - -on: - push: - branches: - - master - pull_request: - branches: - - master -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: yarn - - - name: Install dependencies - run: cd docusaurus/ && yarn install:ci - - name: Build website - run: cd docusaurus/ && yarn build - - name: Add CNAME - run: | - echo "extensions.rancher.io" > ./docusaurus/build/CNAME - - - name: Upload artifact - if: ${{ github.event_name == 'push' && github.repository_owner == 'rancher' }} - uses: actions/upload-pages-artifact@v3 - with: - path: ./docusaurus/build - retention-days: 10 - compression-level: 9 - - # Seperate the deploy job to isolate write permissions - deploy: - name: Publish - if: ${{ github.event_name == 'push' && github.repository_owner == 'rancher' }} - runs-on: ubuntu-latest - needs: build - - # This is required to avoid https://github.com/actions/deploy-pages/issues/271 - environment: - name: github-pages - - permissions: - pages: write - id-token: write - - steps: - - name: Deploy to GitHub Pages - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/storybook.yaml b/.github/workflows/storybook.yaml deleted file mode 100644 index b71bc7a58c8..00000000000 --- a/.github/workflows/storybook.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: storybook -env: - STORYBOOK_TOKEN: ${{ secrets.STORYBOOK_TOKEN }} -on: - push: - branches: - - master - pull_request: - branches: - - master -jobs: - storybook: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - - name: Install packages - run: yarn install - - name: Build Storybook - run: | - yarn build-storybook - - name: Publish Storybook - if: ${{ github.event_name == 'push' && github.repository_owner == 'rancher'}} - run: .github/workflows/scripts/publish-storybook diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml new file mode 100644 index 00000000000..989b8d22a79 --- /dev/null +++ b/.github/workflows/test-extension-workflows.yml @@ -0,0 +1,26 @@ +name: Test Extension workflows + +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + +defaults: + run: + shell: bash + working-directory: ./ + +jobs: + test: + uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests + permissions: + actions: write + contents: write + deployments: write + pages: write + with: + target_branch: 'gh-pages' + tagged_release: 'clock-0.3.2' + is_test: 'true' + test_repo: 'ui-plugin-examples' + test_branch: 'main' \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index e0f265c5c25..00000000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,258 +0,0 @@ -name: Tests -on: - push: - branches: - - master - - 'release-*' - pull_request: - branches: - - master - - 'release-*' - workflow_dispatch: - inputs: - environment: - description: 'Environment to run tests against' - type: environment - required: true - -env: - TEST_USERNAME: admin - TEST_PASSWORD: password - CATTLE_BOOTSTRAP_PASSWORD: password - TEST_BASE_URL: https://127.0.0.1/dashboard - API: https://127.0.0.1 - TEST_PROJECT_ID: rancher-dashboard - CYPRESS_API_URL: http://139.59.134.103:1234/ - TEST_RUN_ID: ${{github.run_number}}-${{github.run_attempt}}-${{github.event.pull_request.title || github.event.head_commit.message}} - # Build the dashboard to use in tests. When set to false it will grab `latest` from CDN (useful for running e2e tests quickly) - BUILD_DASHBOARD: true - - E2E_BUILD_DIST_NAME: dist - E2E_BUILD_DIST_DIR: dist - E2E_BUILD_DIST_EMBER_NAME: dist_ember - E2E_BUILD_DIST_EMBER_DIR: dist_ember - -jobs: - e2e-ui-build: - if: "!contains( github.event.pull_request.labels.*.name, 'ci/skip-e2e')" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - name: Setup env - uses: ./.github/actions/setup - - name: Build e2e - run: yarn e2e:build - - name: Upload e2e build - uses: actions/upload-artifact@v4 - with: - name: ${{ env.E2E_BUILD_DIST_NAME }} - path: ${{ env.E2E_BUILD_DIST_DIR }}/ - if-no-files-found: error - retention-days: 10 - compression-level: 9 - - name: Upload e2e build ember - uses: actions/upload-artifact@v4 - with: - name: ${{ env.E2E_BUILD_DIST_EMBER_NAME }} - path: ${{ env.E2E_BUILD_DIST_EMBER_DIR }}/ - if-no-files-found: error - retention-days: 10 - compression-level: 9 - - - e2e-test: - if: "!contains( github.event.pull_request.labels.*.name, 'ci/skip-e2e')" - needs: e2e-ui-build - strategy: - fail-fast: false - matrix: - role: [ - { username: 'admin', tag: '@adminUser' }, - { username: 'standard_user', tag: '@standardUser' } - ] - features: [ - ['@navigation', '@extensions'], - ['@charts'], - ['@explorer'], - ['@explorer2'], - ['@fleet'], - ['@generic', '@globalSettings'], - ['@manager'], - ['@userMenu', '@usersAndAuths'], - ['@components'], - ['@vai'] - ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - name: Setup env - uses: ./.github/actions/setup - - # Installing fixed version of Chrome since latest version does not work (128 didn't work) - # Leaving this here again in case we need to pin to a specific Chrome version in the future - - name: Install Chrome 127 - run: | - sudo apt-get install -y wget - cd /tmp - wget -q http://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/google-chrome-stable_127.0.6533.72-1_amd64.deb - sudo apt-get install -y --allow-downgrades ./google-chrome-stable_127.0.6533.72-1_amd64.deb - google-chrome --version - - - name: Download e2e build - uses: actions/download-artifact@v4 - with: - name: ${{ env.E2E_BUILD_DIST_NAME }} - path: ${{ env.E2E_BUILD_DIST_DIR }} - - name: Download e2e build ember - uses: actions/download-artifact@v4 - with: - name: ${{ env.E2E_BUILD_DIST_EMBER_NAME }} - path: ${{ env.E2E_BUILD_DIST_EMBER_DIR }} - - - name: Run Rancher - run: yarn e2e:docker - - - name: Setup Rancher and user - run: | - yarn e2e:prod - env: - GREP_TAGS: ${{ matrix.role.tag }}Setup+${{ matrix.features[0] }} --@jenkins ${{ matrix.role.tag }}Setup+${{ matrix.features[1] || matrix.features[0] }} --@jenkins - TEST_USERNAME: admin - TEST_ONLY: setup - - name: Run user tests - run: | - yarn e2e:prod - [ "$BUILD_DASHBOARD" != "false" ] || exit 0 - env: - TEST_SKIP: setup - GREP_TAGS: ${{ matrix.role.tag }}+${{ matrix.features[0] }} --@jenkins ${{ matrix.role.tag }}+${{ matrix.features[1] || matrix.features[0] }} --@jenkins - TEST_USERNAME: ${{ matrix.role.username }} - - - name: Upload screenshots - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: ${{github.run_number}}-${{github.run_attempt}}-screenshots-${{ matrix.role.tag }}+${{ matrix.features[0] }} - path: cypress/screenshots - - - unit-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Run tests - uses: ./.github/actions/unit-tests - - - name: Collect Coverage - run: | - mkdir -p coverage-artifacts/coverage - cp coverage/unit/coverage-final.json coverage-artifacts/coverage/coverage-unit.json - cp -r coverage/unit/ coverage-artifacts/coverage/unit/ - - - name: Upload coverage - uses: actions/upload-artifact@v4 - with: - name: ${{github.run_number}}-${{github.run_attempt}}-coverage - path: coverage-artifacts/**/* - - - i18n: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Run i18n lint - uses: ./.github/actions/i18n-lint - - - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Run tests - uses: ./.github/actions/lint - - - check-i18n: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - - - name: Install packages - run: yarn install:ci - - - name: Run i18n string check - run: | - # Falure won't fail the job (remove -x when all current issues are fixed) - ./scripts/check-i18n -s -x - - check-i18n-links: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - - - name: Install packages - run: yarn install:ci - - - name: Run check of all http links in the i18n files (broken link check) - run: | - ./scripts/check-i18n-links - - # coverage: - # runs-on: ubuntu-latest - # needs: - # - unit-test - # steps: - # - uses: actions/checkout@v3 - # with: - # fetch-depth: 1 - - # - uses: actions/setup-node@v4 - # with: - # node-version-file: '.nvmrc' - - # - name: Download Coverage Artifacts - # uses: actions/download-artifact@v3 - # with: - # name: ${{github.run_number}}-${{github.run_attempt}}-coverage - - # - name: Install Codecov CLI - # run : .github/workflows/scripts/install-codecov.sh - - # - name: Upload tests coverage report to Codecov - # run: ./codecov --verbose upload-process -t ${{ secrets.CODECOV_TOKEN }} -n ${{github.run_number}}-${{github.run_attempt}}-coverage -F unit -f ./coverage/coverage-unit.json - - check-e2e-tags: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - - name: Check e2e tags - run: | - ./scripts/check-e2e-tests-for-tags From 3a333cc5a321dacbd8c3983b73dc3395bfef507d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 12:03:19 +0000 Subject: [PATCH 02/84] iterate --- .github/workflows/test-extension-workflows.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 989b8d22a79..7372bfca2ea 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -2,6 +2,9 @@ name: Test Extension workflows on: workflow_dispatch: + push: + branches: + - 12032-reusable-wf-tests-2 schedule: - cron: "0 0 * * *" @@ -12,7 +15,7 @@ defaults: jobs: test: - uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests + uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests-2 permissions: actions: write contents: write From 18a3adce38de655627eb094c177926f935b3c172 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 12:05:05 +0000 Subject: [PATCH 03/84] iterate --- .github/workflows/build-extension-charts.yml | 8 ++++---- .github/workflows/test-extension-workflows.yml | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index cbe7306e084..2730a846018 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -14,7 +14,7 @@ on: type: string test_repo: required: false - type: string + type: boolean test_branch: required: false type: string @@ -36,7 +36,7 @@ jobs: actions: write contents: read steps: - - if: is_test == 'true' + - if: is_test == true name: Checkout (test flow) uses: actions/checkout@v4 with: @@ -44,7 +44,7 @@ jobs: ref: ${{ inputs.test_branch }} fetch-depth: 0 - - if: is_test != 'true' + - if: is_test != true name: Checkout (normal flow) uses: actions/checkout@v4 with: @@ -101,7 +101,7 @@ jobs: release: name: Release Build - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test != 'true' + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test != true needs: build-extension-artifact runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 7372bfca2ea..077eac2e185 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -22,8 +22,8 @@ jobs: deployments: write pages: write with: - target_branch: 'gh-pages' - tagged_release: 'clock-0.3.2' - is_test: 'true' - test_repo: 'ui-plugin-examples' - test_branch: 'main' \ No newline at end of file + target_branch: gh-pages + tagged_release: clock-0.3.2 + is_test: true + test_repo: ui-plugin-examples + test_branch: main \ No newline at end of file From e607c4a18e8ce2e90e07abe92a3159b8e5d8d06d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 12:06:45 +0000 Subject: [PATCH 04/84] iterate --- .github/workflows/build-extension-charts.yml | 10 +++++----- .github/workflows/test-extension-workflows.yml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 2730a846018..bfb8bc1519d 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -9,12 +9,12 @@ on: tagged_release: required: true type: string - is_test: + inputs.is_test: required: false type: string test_repo: required: false - type: boolean + type: string test_branch: required: false type: string @@ -36,7 +36,7 @@ jobs: actions: write contents: read steps: - - if: is_test == true + - if: inputs.is_test == "true" name: Checkout (test flow) uses: actions/checkout@v4 with: @@ -44,7 +44,7 @@ jobs: ref: ${{ inputs.test_branch }} fetch-depth: 0 - - if: is_test != true + - if: inputs.is_test != "true" name: Checkout (normal flow) uses: actions/checkout@v4 with: @@ -101,7 +101,7 @@ jobs: release: name: Release Build - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test != true + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.inputs.is_test != "true" needs: build-extension-artifact runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 077eac2e185..1a47ef96131 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -22,8 +22,8 @@ jobs: deployments: write pages: write with: - target_branch: gh-pages - tagged_release: clock-0.3.2 - is_test: true - test_repo: ui-plugin-examples - test_branch: main \ No newline at end of file + target_branch: "gh-pages" + tagged_release: "clock-0.3.2" + is_test: "true" + test_repo: "ui-plugin-examples" + test_branch: "main" \ No newline at end of file From 368719ef1a8f1d2190dad779173679753dc36cca Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 12:08:29 +0000 Subject: [PATCH 05/84] iterate --- .github/workflows/build-extension-charts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index bfb8bc1519d..cf519b41fc4 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -9,7 +9,7 @@ on: tagged_release: required: true type: string - inputs.is_test: + is_test: required: false type: string test_repo: From 2a325290b1ad3c015bd6250ab0994c5a551ec847 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 12:09:21 +0000 Subject: [PATCH 06/84] iterate --- .github/workflows/build-extension-charts.yml | 6 +++--- .github/workflows/test-extension-workflows.yml | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index cf519b41fc4..c922a3d1c7b 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -36,7 +36,7 @@ jobs: actions: write contents: read steps: - - if: inputs.is_test == "true" + - if: inputs.is_test == 'true' name: Checkout (test flow) uses: actions/checkout@v4 with: @@ -44,7 +44,7 @@ jobs: ref: ${{ inputs.test_branch }} fetch-depth: 0 - - if: inputs.is_test != "true" + - if: inputs.is_test != 'true' name: Checkout (normal flow) uses: actions/checkout@v4 with: @@ -101,7 +101,7 @@ jobs: release: name: Release Build - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.inputs.is_test != "true" + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.inputs.is_test != 'true' needs: build-extension-artifact runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 1a47ef96131..7372bfca2ea 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -22,8 +22,8 @@ jobs: deployments: write pages: write with: - target_branch: "gh-pages" - tagged_release: "clock-0.3.2" - is_test: "true" - test_repo: "ui-plugin-examples" - test_branch: "main" \ No newline at end of file + target_branch: 'gh-pages' + tagged_release: 'clock-0.3.2' + is_test: 'true' + test_repo: 'ui-plugin-examples' + test_branch: 'main' \ No newline at end of file From 3b591a72685e984b506437a3ceced18c836ac601 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 12:12:51 +0000 Subject: [PATCH 07/84] iterate --- .github/workflows/build-extension-charts.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index c922a3d1c7b..31cf9a2fc34 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -90,6 +90,10 @@ jobs: publish="$publish -t ${{ inputs.tagged_release }}" fi + if [[ -n "${{ inputs.is_test }}" ]]; then + publish="$publish -f" + fi + $publish - name: Upload charts artifact From c6f517bf9c678a6290df0ef2b4fd0fd299a134fe Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 12:21:28 +0000 Subject: [PATCH 08/84] iterate --- .github/workflows/build-extension-charts.yml | 4 ++-- .github/workflows/test-extension-workflows.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 31cf9a2fc34..82b3b8a0741 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -73,7 +73,7 @@ jobs: run: yarn - name: Parse Extension Name - if: github.ref_type == 'tag' + if: github.ref_type == 'tag' || inputs.inputs.is_test == 'true' id: parsed-name env: GH_TOKEN: ${{ github.token }} @@ -97,7 +97,7 @@ jobs: $publish - name: Upload charts artifact - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.inputs.is_test == 'true' uses: actions/upload-artifact@v3 with: name: charts diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 7372bfca2ea..454cba0db3f 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -2,9 +2,9 @@ name: Test Extension workflows on: workflow_dispatch: - push: - branches: - - 12032-reusable-wf-tests-2 + # push: + # branches: + # - 12032-reusable-wf-tests-2 schedule: - cron: "0 0 * * *" From ac2d7ec0814b81f5351dc593472212546101536d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 12:22:27 +0000 Subject: [PATCH 09/84] iterate --- .github/workflows/test-extension-workflows.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 454cba0db3f..ab564c363e3 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -1,10 +1,9 @@ name: Test Extension workflows on: - workflow_dispatch: - # push: - # branches: - # - 12032-reusable-wf-tests-2 + push: + branches: + - 12032-reusable-wf-tests-2 schedule: - cron: "0 0 * * *" From fa2f1c019ff2ca8df4e51fca8923f8f036a9c605 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 12:25:20 +0000 Subject: [PATCH 10/84] iterate --- .github/workflows/build-extension-charts.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 82b3b8a0741..c7b603cfe40 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -73,7 +73,7 @@ jobs: run: yarn - name: Parse Extension Name - if: github.ref_type == 'tag' || inputs.inputs.is_test == 'true' + if: github.ref_type == 'tag' || inputs.is_test == 'true' id: parsed-name env: GH_TOKEN: ${{ github.token }} @@ -97,7 +97,7 @@ jobs: $publish - name: Upload charts artifact - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.inputs.is_test == 'true' + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test == 'true' uses: actions/upload-artifact@v3 with: name: charts @@ -105,7 +105,7 @@ jobs: release: name: Release Build - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.inputs.is_test != 'true' + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test != 'true' needs: build-extension-artifact runs-on: ubuntu-latest permissions: From 92144e32af4b8b615e091dce72ef0f42a632da63 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 13:03:20 +0000 Subject: [PATCH 11/84] iterate --- .github/workflows/build-extension-catalog.yml | 29 ++++++++++++++++--- .github/workflows/build-extension-charts.yml | 2 +- .../workflows/test-extension-workflows.yml | 19 ++++++++++-- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-extension-catalog.yml b/.github/workflows/build-extension-catalog.yml index 2a81b51b361..ded45f29f87 100644 --- a/.github/workflows/build-extension-catalog.yml +++ b/.github/workflows/build-extension-catalog.yml @@ -12,6 +12,15 @@ on: tagged_release: required: false type: string + is_test: + required: false + type: string + test_repo: + required: false + type: string + test_branch: + required: false + type: string secrets: registry_token: required: true @@ -19,7 +28,7 @@ on: jobs: build-extension-catalog: name: Build container image - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test == 'true' runs-on: ubuntu-latest permissions: actions: write @@ -27,7 +36,15 @@ jobs: packages: write steps: - - name: Checkout repository + - if: inputs.is_test == 'true' + name: Checkout repository (test flow) + uses: actions/checkout@v4 + with: + repository: rancher/${{ inputs.test_repo }} + ref: ${{ inputs.test_branch }} + + - if: inputs.is_test != 'true' + name: Checkout repository (normal flow) uses: actions/checkout@v4 - name: Enable Corepack @@ -60,7 +77,7 @@ jobs: run: yarn - name: Parse Extension Name - if: github.ref_type == 'tag' + if: github.ref_type == 'tag' || inputs.is_test == 'true' id: parsed-name env: GH_TOKEN: ${{ github.token }} @@ -69,10 +86,14 @@ jobs: - name: Build and push UI image run: | - publish="yarn publish-pkgs -cp -r ${{ inputs.registry_target }} -o ${{ github.repository_owner }}" + publish="yarn publish-pkgs -c -r ${{ inputs.registry_target }} -o ${{ github.repository_owner }}" if [[ -n "${{ inputs.tagged_release }}" ]]; then publish="$publish -t ${{ inputs.tagged_release }}" fi + if [[ "${{ inputs.is_test }}" != "true" ]]; then + publish="$publish -p" + fi + $publish diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index c7b603cfe40..47c68b6a58b 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -90,7 +90,7 @@ jobs: publish="$publish -t ${{ inputs.tagged_release }}" fi - if [[ -n "${{ inputs.is_test }}" ]]; then + if [[ "${{ inputs.is_test }}" == "true" ]]; then publish="$publish -f" fi diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index ab564c363e3..bab75d4bb68 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -13,7 +13,7 @@ defaults: working-directory: ./ jobs: - test: + test-build-extension-charts: uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests-2 permissions: actions: write @@ -25,4 +25,19 @@ jobs: tagged_release: 'clock-0.3.2' is_test: 'true' test_repo: 'ui-plugin-examples' - test_branch: 'main' \ No newline at end of file + test_branch: 'main' + test-build-extension-catalog: + uses: aalves08/dashboard/.github/workflows/build-extension-catalog.yml@12032-reusable-wf-tests-2 + permissions: + actions: write + contents: read + packages: write + with: + registry_target: ghcr.io + registry_user: ${{ github.actor }} + tagged_release: 'ui-plugin-examples-0.1.0' + is_test: 'true' + test_repo: 'ui-plugin-examples' + test_branch: 'main' + secrets: + registry_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From f799c62eba3223366c65876eb5d73d3dea0b98a8 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 17:11:45 +0000 Subject: [PATCH 12/84] final changes to charts and catalog workflows + first test on release-shell-pkg workflow --- .github/workflows/build-extension-catalog.yml | 14 ++- .github/workflows/build-extension-charts.yml | 6 +- .github/workflows/release-shell-pkg.yaml | 110 ++++++++++-------- .../workflows/test-extension-workflows.yml | 20 +++- 4 files changed, 90 insertions(+), 60 deletions(-) diff --git a/.github/workflows/build-extension-catalog.yml b/.github/workflows/build-extension-catalog.yml index ded45f29f87..f231f808e25 100644 --- a/.github/workflows/build-extension-catalog.yml +++ b/.github/workflows/build-extension-catalog.yml @@ -28,7 +28,7 @@ on: jobs: build-extension-catalog: name: Build container image - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test == 'true' + if: github.ref_type == 'tag' || github.event_name != 'pull_request' || inputs.is_test == 'true' runs-on: ubuntu-latest permissions: actions: write @@ -86,14 +86,16 @@ jobs: - name: Build and push UI image run: | - publish="yarn publish-pkgs -c -r ${{ inputs.registry_target }} -o ${{ github.repository_owner }}" - - if [[ -n "${{ inputs.tagged_release }}" ]]; then - publish="$publish -t ${{ inputs.tagged_release }}" - fi + publish="yarn publish-pkgs -c" if [[ "${{ inputs.is_test }}" != "true" ]]; then publish="$publish -p" fi + publish="$publish -r ${{ inputs.registry_target }} -o ${{ github.repository_owner }}" + + if [[ -n "${{ inputs.tagged_release }}" ]]; then + publish="$publish -t ${{ inputs.tagged_release }}" + fi + $publish diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 47c68b6a58b..63b13bdef43 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -97,15 +97,15 @@ jobs: $publish - name: Upload charts artifact - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test == 'true' + if: github.ref_type == 'tag' || github.event_name != 'pull_request' || inputs.is_test == 'true' uses: actions/upload-artifact@v3 with: name: charts path: tmp - +## if test, check if artifacts are there... release: name: Release Build - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test != 'true' + if: github.ref_type == 'tag' || github.event_name != 'pull_request' || inputs.is_test != 'true' needs: build-extension-artifact runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index 9caef82bee0..93d170b8485 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -5,59 +5,75 @@ on: tags: - 'shell-pkg-v*' - 'creators-pkg-v*' + workflow_call: + inputs: + tag: + required: false + type: string jobs: + build: runs-on: ubuntu-latest permissions: contents: read packages: write + if: github.repository_owner == 'aalves08' && github.repository == 'dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}')) steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Enable Corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'yarn' - - - name: Check Tags Version Matching - env: - TAG: ${{github.ref_name}} - run: ./.github/workflows/scripts/check-package-tag-version.sh - shell: bash - - - name: Validate Plugin build system - run: ./shell/scripts/test-plugins-build.sh - shell: bash - - # Reset the local (ci) repository state because - # The previous step (Validate Plugin build system) changes - # the version number on package.json for Shell in order - # to release it in verdaccio for it's tests - - name: Reset repository (file system) + # TODO: this step is only for debug purposes... to be deleted + - name: Echo some variables run: | - git reset --hard HEAD - echo $NPM_REGISTRY - cat ./shell/package.json - - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - registry-url: 'https://registry.npmjs.org' - scope: '@rancher' - - - name: Install packages - run: yarn install --frozen-lockfile - - - name: Publish Shell Package to npm - run: ./shell/scripts/publish-shell.sh --npm - env: - TAG: ${{github.ref_name}} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + echo "github.repository_owner ::: ${github.repository_owner}" + echo "github.repository ::: ${github.repository}" + echo "github.event_name ::: ${github.event_name}" + echo "github.event.ref ::: ${github.event.ref}" + echo "github.ref_name ::: ${github.ref_name}" + echo "inputs.tag ::: ${inputs.tag}" + # - uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # persist-credentials: false + + # - name: Enable Corepack + # run: corepack enable + + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # node-version-file: '.nvmrc' + # cache: 'yarn' + + # - name: Check Tags Version Matching + # env: + # TAG: ${{ inputs.tag || github.ref_name }} + # run: ./.github/workflows/scripts/check-package-tag-version.sh + # shell: bash + + # - name: Validate Plugin build system + # run: ./shell/scripts/test-plugins-build.sh + # shell: bash + + # # Reset the local (ci) repository state because + # # The previous step (Validate Plugin build system) changes + # # the version number on package.json for Shell in order + # # to release it in verdaccio for it's tests + # - name: Reset repository (file system) + # run: | + # git reset --hard HEAD + # echo $NPM_REGISTRY + # cat ./shell/package.json + + # - uses: actions/setup-node@v4 + # with: + # node-version-file: '.nvmrc' + # registry-url: 'https://registry.npmjs.org' + # scope: '@rancher' + + # - name: Install packages + # run: yarn install --frozen-lockfile + + # - name: Publish Shell Package to npm + # run: ./shell/scripts/publish-shell.sh --npm + # env: + # TAG: ${{ inputs.tag || github.ref_name }} + # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index bab75d4bb68..d102fca51dc 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -4,15 +4,16 @@ on: push: branches: - 12032-reusable-wf-tests-2 - schedule: - - cron: "0 0 * * *" + # schedule: + # - cron: "0 0 * * *" defaults: run: shell: bash working-directory: ./ - +# TODO: get latest versions from each branch for shell + creators + get version of latest clock and ui-plugin-examples root package.json version jobs: + # test building helm chart test-build-extension-charts: uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests-2 permissions: @@ -26,6 +27,7 @@ jobs: is_test: 'true' test_repo: 'ui-plugin-examples' test_branch: 'main' + # test building catalog image test-build-extension-catalog: uses: aalves08/dashboard/.github/workflows/build-extension-catalog.yml@12032-reusable-wf-tests-2 permissions: @@ -40,4 +42,14 @@ jobs: test_repo: 'ui-plugin-examples' test_branch: 'main' secrets: - registry_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + registry_token: ${{ secrets.GITHUB_TOKEN }} + # test releasing shell package + test-release-shell-pkg: + uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yml@12032-reusable-wf-tests-2 + with: + tag: shell-pkg-v3.0.0 + # test releasing creators package + test-release-creators-pkg: + uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yml@12032-reusable-wf-tests-2 + with: + tag: creators-pkg-v1.0.0 \ No newline at end of file From 78bbf1593987d078e6b94b9cc3147f8c6883006d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 17:12:49 +0000 Subject: [PATCH 13/84] fix yaml path --- .github/workflows/test-extension-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index d102fca51dc..83c759203c8 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -50,6 +50,6 @@ jobs: tag: shell-pkg-v3.0.0 # test releasing creators package test-release-creators-pkg: - uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yml@12032-reusable-wf-tests-2 + uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 with: tag: creators-pkg-v1.0.0 \ No newline at end of file From c83f4ed15d98ed3a7b064af972ba013a87e53983 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 17:13:18 +0000 Subject: [PATCH 14/84] fix yaml path --- .github/workflows/test-extension-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 83c759203c8..44798d73ba5 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -45,7 +45,7 @@ jobs: registry_token: ${{ secrets.GITHUB_TOKEN }} # test releasing shell package test-release-shell-pkg: - uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yml@12032-reusable-wf-tests-2 + uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 with: tag: shell-pkg-v3.0.0 # test releasing creators package From 3cbe3d15a3d2a708752b0d68490859805cd17cf1 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 17:14:39 +0000 Subject: [PATCH 15/84] fix echos --- .github/workflows/release-shell-pkg.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index 93d170b8485..5ef1befb541 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -23,12 +23,12 @@ jobs: # TODO: this step is only for debug purposes... to be deleted - name: Echo some variables run: | - echo "github.repository_owner ::: ${github.repository_owner}" - echo "github.repository ::: ${github.repository}" - echo "github.event_name ::: ${github.event_name}" - echo "github.event.ref ::: ${github.event.ref}" - echo "github.ref_name ::: ${github.ref_name}" - echo "inputs.tag ::: ${inputs.tag}" + echo "github.repository_owner ::: ${{github.repository_owner}}" + echo "github.repository ::: ${{github.repository}}" + echo "github.event_name ::: ${{github.event_name}}" + echo "github.event.ref ::: ${{github.event}.ref}" + echo "github.ref_name ::: ${{github.ref_name}}" + echo "inputs.tag ::: ${{inputs.tag}}" # - uses: actions/checkout@v3 # with: # fetch-depth: 0 From bd7ec91c32d9e36ff6df6c7a7a503488e54fde3f Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 17:15:13 +0000 Subject: [PATCH 16/84] fix echos --- .github/workflows/release-shell-pkg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index 5ef1befb541..e476e755294 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -26,7 +26,7 @@ jobs: echo "github.repository_owner ::: ${{github.repository_owner}}" echo "github.repository ::: ${{github.repository}}" echo "github.event_name ::: ${{github.event_name}}" - echo "github.event.ref ::: ${{github.event}.ref}" + echo "github.event.ref ::: ${{github.event.ref}}" echo "github.ref_name ::: ${{github.ref_name}}" echo "inputs.tag ::: ${{inputs.tag}}" # - uses: actions/checkout@v3 From d72912831d5983dfedf92695f7dbc4bc6b4dfad3 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 17:26:56 +0000 Subject: [PATCH 17/84] fix test more of the workflow --- .github/workflows/release-shell-pkg.yaml | 90 +++++++++++-------- .../workflows/test-extension-workflows.yml | 4 + 2 files changed, 57 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index e476e755294..ca64a2d75b4 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -10,6 +10,12 @@ on: tag: required: false type: string + is_test: + required: false + type: string + test_branch: + required: false + type: string jobs: @@ -18,59 +24,69 @@ jobs: permissions: contents: read packages: write - if: github.repository_owner == 'aalves08' && github.repository == 'dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}')) + if: github.repository == 'aalves08/dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}')) steps: # TODO: this step is only for debug purposes... to be deleted - name: Echo some variables run: | - echo "github.repository_owner ::: ${{github.repository_owner}}" echo "github.repository ::: ${{github.repository}}" echo "github.event_name ::: ${{github.event_name}}" echo "github.event.ref ::: ${{github.event.ref}}" echo "github.ref_name ::: ${{github.ref_name}}" echo "inputs.tag ::: ${{inputs.tag}}" - # - uses: actions/checkout@v3 - # with: - # fetch-depth: 0 - # persist-credentials: false - # - name: Enable Corepack - # run: corepack enable + - if: input.is_test == 'true' && inputs.test_branch != '' + name: Checkout (test flow) + uses: actions/checkout@v3 + with: + persist-credentials: false + ref: ${{ inputs.test_branch }} + fetch-depth: 0 + + - if: inputs.is_test != 'true' + name: Checkout (normal flow) + uses: actions/checkout@v3 + with: + fetch-depth: 0 + persist-credentials: false - # - name: Setup Node.js - # uses: actions/setup-node@v4 - # with: - # node-version-file: '.nvmrc' - # cache: 'yarn' + - name: Enable Corepack + run: corepack enable - # - name: Check Tags Version Matching - # env: - # TAG: ${{ inputs.tag || github.ref_name }} - # run: ./.github/workflows/scripts/check-package-tag-version.sh - # shell: bash + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'yarn' - # - name: Validate Plugin build system - # run: ./shell/scripts/test-plugins-build.sh - # shell: bash + - name: Check Tags Version Matching + env: + TAG: ${{ inputs.tag || github.ref_name }} + run: ./.github/workflows/scripts/check-package-tag-version.sh + shell: bash - # # Reset the local (ci) repository state because - # # The previous step (Validate Plugin build system) changes - # # the version number on package.json for Shell in order - # # to release it in verdaccio for it's tests - # - name: Reset repository (file system) - # run: | - # git reset --hard HEAD - # echo $NPM_REGISTRY - # cat ./shell/package.json + - name: Validate Plugin build system + run: ./shell/scripts/test-plugins-build.sh + shell: bash + + # Reset the local (ci) repository state because + # The previous step (Validate Plugin build system) changes + # the version number on package.json for Shell in order + # to release it in verdaccio for it's tests + - name: Reset repository (file system) + run: | + git reset --hard HEAD + echo $NPM_REGISTRY + cat ./shell/package.json - # - uses: actions/setup-node@v4 - # with: - # node-version-file: '.nvmrc' - # registry-url: 'https://registry.npmjs.org' - # scope: '@rancher' + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org' + scope: '@rancher' - # - name: Install packages - # run: yarn install --frozen-lockfile + - name: Install packages + run: yarn install --frozen-lockfile # - name: Publish Shell Package to npm # run: ./shell/scripts/publish-shell.sh --npm diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 44798d73ba5..d234feae62b 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -47,9 +47,13 @@ jobs: test-release-shell-pkg: uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 with: + is_test: 'true' + test_branch: 'master' tag: shell-pkg-v3.0.0 # test releasing creators package test-release-creators-pkg: uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 with: + is_test: 'true' + test_branch: 'master' tag: creators-pkg-v1.0.0 \ No newline at end of file From 1c35f6f37a9eec6bbd14a2a618842a5688a9ee68 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Fri, 8 Nov 2024 17:27:35 +0000 Subject: [PATCH 18/84] fix test more of the workflow --- .github/workflows/release-shell-pkg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index ca64a2d75b4..9ec611fe8ea 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -35,7 +35,7 @@ jobs: echo "github.ref_name ::: ${{github.ref_name}}" echo "inputs.tag ::: ${{inputs.tag}}" - - if: input.is_test == 'true' && inputs.test_branch != '' + - if: inputs.is_test == 'true' && inputs.test_branch != '' name: Checkout (test flow) uses: actions/checkout@v3 with: From 3bfc06490d8ee8dd0e9f4c6d7bebd366d320eb40 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 10:50:34 +0000 Subject: [PATCH 19/84] revert changes to charts and catalog workflows pull request condition as it is impacted negativelly by these tests + adapt publish shell script to allow for a dry-run --- .github/workflows/build-extension-catalog.yml | 2 +- .github/workflows/build-extension-charts.yml | 4 +- .github/workflows/release-shell-pkg.yaml | 32 ++++---- .../workflows/test-extension-workflows.yml | 80 ++++++++++--------- shell/scripts/publish-shell.sh | 5 ++ 5 files changed, 67 insertions(+), 56 deletions(-) diff --git a/.github/workflows/build-extension-catalog.yml b/.github/workflows/build-extension-catalog.yml index f231f808e25..63feccd535f 100644 --- a/.github/workflows/build-extension-catalog.yml +++ b/.github/workflows/build-extension-catalog.yml @@ -28,7 +28,7 @@ on: jobs: build-extension-catalog: name: Build container image - if: github.ref_type == 'tag' || github.event_name != 'pull_request' || inputs.is_test == 'true' + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test == 'true' runs-on: ubuntu-latest permissions: actions: write diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 63b13bdef43..4bf48de27d5 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -97,7 +97,7 @@ jobs: $publish - name: Upload charts artifact - if: github.ref_type == 'tag' || github.event_name != 'pull_request' || inputs.is_test == 'true' + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test == 'true' uses: actions/upload-artifact@v3 with: name: charts @@ -105,7 +105,7 @@ jobs: ## if test, check if artifacts are there... release: name: Release Build - if: github.ref_type == 'tag' || github.event_name != 'pull_request' || inputs.is_test != 'true' + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test != 'true' needs: build-extension-artifact runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index 9ec611fe8ea..6cf2ce819bc 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -27,13 +27,13 @@ jobs: if: github.repository == 'aalves08/dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}')) steps: # TODO: this step is only for debug purposes... to be deleted - - name: Echo some variables - run: | - echo "github.repository ::: ${{github.repository}}" - echo "github.event_name ::: ${{github.event_name}}" - echo "github.event.ref ::: ${{github.event.ref}}" - echo "github.ref_name ::: ${{github.ref_name}}" - echo "inputs.tag ::: ${{inputs.tag}}" + # - name: Echo some variables + # run: | + # echo "github.repository ::: ${{github.repository}}" + # echo "github.event_name ::: ${{github.event_name}}" + # echo "github.event.ref ::: ${{github.event.ref}}" + # echo "github.ref_name ::: ${{github.ref_name}}" + # echo "inputs.tag ::: ${{inputs.tag}}" - if: inputs.is_test == 'true' && inputs.test_branch != '' name: Checkout (test flow) @@ -65,9 +65,10 @@ jobs: run: ./.github/workflows/scripts/check-package-tag-version.sh shell: bash - - name: Validate Plugin build system - run: ./shell/scripts/test-plugins-build.sh - shell: bash + # TODO: Re-enable this step before completing PR + # - name: Validate Plugin build system + # run: ./shell/scripts/test-plugins-build.sh + # shell: bash # Reset the local (ci) repository state because # The previous step (Validate Plugin build system) changes @@ -88,8 +89,9 @@ jobs: - name: Install packages run: yarn install --frozen-lockfile - # - name: Publish Shell Package to npm - # run: ./shell/scripts/publish-shell.sh --npm - # env: - # TAG: ${{ inputs.tag || github.ref_name }} - # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish Shell Package to npm + run: ./shell/scripts/publish-shell.sh --npm + env: + TAG: ${{ inputs.tag || github.ref_name }} + DRY_RUN: ${{ inputs.is_test }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index d234feae62b..e28356ee019 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -13,47 +13,51 @@ defaults: working-directory: ./ # TODO: get latest versions from each branch for shell + creators + get version of latest clock and ui-plugin-examples root package.json version jobs: - # test building helm chart - test-build-extension-charts: - uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests-2 - permissions: - actions: write - contents: write - deployments: write - pages: write - with: - target_branch: 'gh-pages' - tagged_release: 'clock-0.3.2' - is_test: 'true' - test_repo: 'ui-plugin-examples' - test_branch: 'main' - # test building catalog image - test-build-extension-catalog: - uses: aalves08/dashboard/.github/workflows/build-extension-catalog.yml@12032-reusable-wf-tests-2 - permissions: - actions: write - contents: read - packages: write - with: - registry_target: ghcr.io - registry_user: ${{ github.actor }} - tagged_release: 'ui-plugin-examples-0.1.0' - is_test: 'true' - test_repo: 'ui-plugin-examples' - test_branch: 'main' - secrets: - registry_token: ${{ secrets.GITHUB_TOKEN }} - # test releasing shell package + ### test building helm chart for an extension + # test-build-extension-charts: + # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" + # uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests-2 + # permissions: + # actions: write + # contents: write + # deployments: write + # pages: write + # with: + # target_branch: 'gh-pages' + # tagged_release: 'clock-0.3.2' + # is_test: 'true' + # test_repo: 'ui-plugin-examples' + # test_branch: 'main' + # ### test building catalog image for extensions + # test-build-extension-catalog: + # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" + # uses: aalves08/dashboard/.github/workflows/build-extension-catalog.yml@12032-reusable-wf-tests-2 + # permissions: + # actions: write + # contents: read + # packages: write + # with: + # registry_target: ghcr.io + # registry_user: ${{ github.actor }} + # tagged_release: 'ui-plugin-examples-0.1.0' + # is_test: 'true' + # test_repo: 'ui-plugin-examples' + # test_branch: 'main' + # secrets: + # registry_token: ${{ secrets.GITHUB_TOKEN }} + ### test releasing shell package test-release-shell-pkg: + # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 with: is_test: 'true' test_branch: 'master' tag: shell-pkg-v3.0.0 - # test releasing creators package - test-release-creators-pkg: - uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 - with: - is_test: 'true' - test_branch: 'master' - tag: creators-pkg-v1.0.0 \ No newline at end of file + ### test releasing creators package + # test-release-creators-pkg: + # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) + # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + # with: + # is_test: 'true' + # test_branch: 'master' + # tag: creators-pkg-v1.0.0 \ No newline at end of file diff --git a/shell/scripts/publish-shell.sh b/shell/scripts/publish-shell.sh index e0e11671951..d6c78ccafe7 100755 --- a/shell/scripts/publish-shell.sh +++ b/shell/scripts/publish-shell.sh @@ -50,6 +50,11 @@ function publish() { PUBLISH_ARGS="--no-git-tag-version --access public --registry $NPM_REGISTRY --tag pre-release" fi + # when testing the workflow, we don't want to actually do an npm publish but only a dry run + if [ ${DRY_RUN} == "true" ]; then + PUBLISH_ARGS="--no-git-tag-version --access public --registry $NPM_REGISTRY --tag pre-release --dry-run" + fi + echo "Publishing ${NAME} from ${FOLDER}" pushd ${FOLDER} >/dev/null From b9c414376cec8b627074910932c5504907be02c2 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 10:55:44 +0000 Subject: [PATCH 20/84] echo publish args --- shell/scripts/publish-shell.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shell/scripts/publish-shell.sh b/shell/scripts/publish-shell.sh index d6c78ccafe7..d64e53d70c3 100755 --- a/shell/scripts/publish-shell.sh +++ b/shell/scripts/publish-shell.sh @@ -55,6 +55,8 @@ function publish() { PUBLISH_ARGS="--no-git-tag-version --access public --registry $NPM_REGISTRY --tag pre-release --dry-run" fi + echo "Publish to NPM - arguments ::: ${PUBLISH_ARGS}" + echo "Publishing ${NAME} from ${FOLDER}" pushd ${FOLDER} >/dev/null From 378fa1829487cb7fc098ade249793ec81f739dd9 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 11:32:57 +0000 Subject: [PATCH 21/84] change test branch --- .github/workflows/test-extension-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index e28356ee019..66c83268b69 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -51,7 +51,7 @@ jobs: uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 with: is_test: 'true' - test_branch: 'master' + test_branch: '12032-reusable-wf-tests-2' tag: shell-pkg-v3.0.0 ### test releasing creators package # test-release-creators-pkg: From 90ac48927f5f4ed9022ac38b4bcb9285dcd864f3 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 11:56:25 +0000 Subject: [PATCH 22/84] test script to get shell and creators versions --- .../workflows/test-extension-workflows.yml | 28 +++++++----- shell/scripts/retrieve-versions.sh | 43 +++++++++++++++++++ 2 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 shell/scripts/retrieve-versions.sh diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 66c83268b69..43bc2bb1ca4 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -13,7 +13,13 @@ defaults: working-directory: ./ # TODO: get latest versions from each branch for shell + creators + get version of latest clock and ui-plugin-examples root package.json version jobs: - ### test building helm chart for an extension + get-versions: + runs-on: ubuntu-latest + steps: + - name: Run Bash script + run: ./shell/scripts/retrieve-versions.sh + shell: bash + # ### test building helm chart for an extension # test-build-extension-charts: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" # uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests-2 @@ -45,19 +51,19 @@ jobs: # test_branch: 'main' # secrets: # registry_token: ${{ secrets.GITHUB_TOKEN }} - ### test releasing shell package - test-release-shell-pkg: - # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) - uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 - with: - is_test: 'true' - test_branch: '12032-reusable-wf-tests-2' - tag: shell-pkg-v3.0.0 - ### test releasing creators package + # ### test releasing shell package + # test-release-shell-pkg: + # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) + # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + # with: + # is_test: 'true' + # test_branch: '12032-reusable-wf-tests-2' + # tag: shell-pkg-v3.0.0 + # ### test releasing creators package # test-release-creators-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 # with: # is_test: 'true' - # test_branch: 'master' + # test_branch: '12032-reusable-wf-tests-2' # tag: creators-pkg-v1.0.0 \ No newline at end of file diff --git a/shell/scripts/retrieve-versions.sh b/shell/scripts/retrieve-versions.sh new file mode 100644 index 00000000000..d5535c5c4ac --- /dev/null +++ b/shell/scripts/retrieve-versions.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +set -eo pipefail + +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" +BASE_DIR="$( + cd $SCRIPT_DIR && cd ../.. & + pwd +)" +SHELL_DIR=$BASE_DIR/shell +CREATORS_DIR=$BASE_DIR/creators/extension + +if [ -z "$BRANCH" ]; then + echo "You need to specify a BRANCH variable first!" + exit 1 +fi + +function generate_version_export() { + NAME=$1 + + case $NAME in + "shell") + SHELL_VERSION=$(jq -r .version ${SHELL_DIR}/package.json) + declare SHELL_VERSION_$BRANCH=${SHELL_VERSION} + varname=SHELL_VERSION_$BRANCH + echo shell version ::: ${!varname} + ;; + "creators") + CREATORS_VERSION=$(jq -r .version ${CREATORS_DIR}/package.json) + declare CREATORS_VERSION_$BRANCH=${CREATORS_VERSION} + varname=CREATORS_VERSION_$BRANCH + echo ${!varname} + echo rancher version ::: ${!varname} + ;; + esac +} + +echo "Retrieve current Shell version" + +generate_version_export "shell" +generate_version_export "creators" + +# export RANCHER_VERSION_E2E=${{ matrix.rancherEnv[1] }} \ No newline at end of file From 7d9fa067d681129f30cf24b3badd4cbf6d8e3ee7 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 11:58:14 +0000 Subject: [PATCH 23/84] test --- shell/scripts/retrieve-versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/scripts/retrieve-versions.sh b/shell/scripts/retrieve-versions.sh index d5535c5c4ac..fc7fc3b3633 100644 --- a/shell/scripts/retrieve-versions.sh +++ b/shell/scripts/retrieve-versions.sh @@ -40,4 +40,4 @@ echo "Retrieve current Shell version" generate_version_export "shell" generate_version_export "creators" -# export RANCHER_VERSION_E2E=${{ matrix.rancherEnv[1] }} \ No newline at end of file +# export RANCHER_VERSION_E2E=${{ matrix.rancherEnv[1] }}# \ No newline at end of file From 4d34cbfcd7248027b142579600f48ee80b2a1d7a Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 11:59:23 +0000 Subject: [PATCH 24/84] test --- .github/workflows/test-extension-workflows.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 43bc2bb1ca4..7d22b5ea6df 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -16,6 +16,9 @@ jobs: get-versions: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run Bash script run: ./shell/scripts/retrieve-versions.sh shell: bash From e17eea15d0f98f49280f95d74576c3b5ce59e1aa Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 12:01:19 +0000 Subject: [PATCH 25/84] test --- .github/workflows/test-extension-workflows.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 7d22b5ea6df..791b46c929a 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -18,6 +18,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 1 + ref: "12032-reusable-wf-tests-2" - name: Run Bash script run: ./shell/scripts/retrieve-versions.sh From 70357bd3dbc8c0bcacda76f1eccaebf80f3e9e36 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 12:08:37 +0000 Subject: [PATCH 26/84] fix permissions --- shell/scripts/retrieve-versions.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 shell/scripts/retrieve-versions.sh diff --git a/shell/scripts/retrieve-versions.sh b/shell/scripts/retrieve-versions.sh old mode 100644 new mode 100755 From dfbc1cb8d02eece5f4505f678d5e72f976d4edd3 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 12:10:06 +0000 Subject: [PATCH 27/84] test --- .github/workflows/test-extension-workflows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 791b46c929a..8bc6abb71a2 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -25,6 +25,8 @@ jobs: - name: Run Bash script run: ./shell/scripts/retrieve-versions.sh shell: bash + env: + BRANCH: "master" # ### test building helm chart for an extension # test-build-extension-charts: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" From a438d9216da74f4c67142d4c21671d2278c4e163 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 15:57:11 +0000 Subject: [PATCH 28/84] testing exports --- .github/workflows/release-shell-pkg.yaml | 116 +++++++++--------- .../workflows/test-extension-workflows.yml | 36 +++--- shell/scripts/retrieve-versions.sh | 25 +--- 3 files changed, 86 insertions(+), 91 deletions(-) diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index 6cf2ce819bc..96cfa31a1ab 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -27,71 +27,71 @@ jobs: if: github.repository == 'aalves08/dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}')) steps: # TODO: this step is only for debug purposes... to be deleted - # - name: Echo some variables - # run: | - # echo "github.repository ::: ${{github.repository}}" - # echo "github.event_name ::: ${{github.event_name}}" - # echo "github.event.ref ::: ${{github.event.ref}}" - # echo "github.ref_name ::: ${{github.ref_name}}" - # echo "inputs.tag ::: ${{inputs.tag}}" + - name: Echo some variables + run: | + echo "github.repository ::: ${{github.repository}}" + echo "github.event_name ::: ${{github.event_name}}" + echo "github.event.ref ::: ${{github.event.ref}}" + echo "github.ref_name ::: ${{github.ref_name}}" + echo "inputs.tag ::: ${{inputs.tag}}" - - if: inputs.is_test == 'true' && inputs.test_branch != '' - name: Checkout (test flow) - uses: actions/checkout@v3 - with: - persist-credentials: false - ref: ${{ inputs.test_branch }} - fetch-depth: 0 + # - if: inputs.is_test == 'true' && inputs.test_branch != '' + # name: Checkout (test flow) + # uses: actions/checkout@v3 + # with: + # persist-credentials: false + # ref: ${{ inputs.test_branch }} + # fetch-depth: 0 - - if: inputs.is_test != 'true' - name: Checkout (normal flow) - uses: actions/checkout@v3 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Enable Corepack - run: corepack enable + # - if: inputs.is_test != 'true' + # name: Checkout (normal flow) + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # persist-credentials: false - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'yarn' + # - name: Enable Corepack + # run: corepack enable - - name: Check Tags Version Matching - env: - TAG: ${{ inputs.tag || github.ref_name }} - run: ./.github/workflows/scripts/check-package-tag-version.sh - shell: bash + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # node-version-file: '.nvmrc' + # cache: 'yarn' - # TODO: Re-enable this step before completing PR - # - name: Validate Plugin build system - # run: ./shell/scripts/test-plugins-build.sh + # - name: Check Tags Version Matching + # env: + # TAG: ${{ inputs.tag || github.ref_name }} + # run: ./.github/workflows/scripts/check-package-tag-version.sh # shell: bash - # Reset the local (ci) repository state because - # The previous step (Validate Plugin build system) changes - # the version number on package.json for Shell in order - # to release it in verdaccio for it's tests - - name: Reset repository (file system) - run: | - git reset --hard HEAD - echo $NPM_REGISTRY - cat ./shell/package.json + # # TODO: Re-enable this step before completing PR + # # - name: Validate Plugin build system + # # run: ./shell/scripts/test-plugins-build.sh + # # shell: bash + + # # Reset the local (ci) repository state because + # # The previous step (Validate Plugin build system) changes + # # the version number on package.json for Shell in order + # # to release it in verdaccio for it's tests + # - name: Reset repository (file system) + # run: | + # git reset --hard HEAD + # echo $NPM_REGISTRY + # cat ./shell/package.json - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - registry-url: 'https://registry.npmjs.org' - scope: '@rancher' + # - uses: actions/setup-node@v4 + # with: + # node-version-file: '.nvmrc' + # registry-url: 'https://registry.npmjs.org' + # scope: '@rancher' - - name: Install packages - run: yarn install --frozen-lockfile + # - name: Install packages + # run: yarn install --frozen-lockfile - - name: Publish Shell Package to npm - run: ./shell/scripts/publish-shell.sh --npm - env: - TAG: ${{ inputs.tag || github.ref_name }} - DRY_RUN: ${{ inputs.is_test }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # - name: Publish Shell Package to npm + # run: ./shell/scripts/publish-shell.sh --npm + # env: + # TAG: ${{ inputs.tag || github.ref_name }} + # DRY_RUN: ${{ inputs.is_test }} + # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 8bc6abb71a2..700de8fd010 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -13,20 +13,6 @@ defaults: working-directory: ./ # TODO: get latest versions from each branch for shell + creators + get version of latest clock and ui-plugin-examples root package.json version jobs: - get-versions: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 1 - ref: "12032-reusable-wf-tests-2" - - - name: Run Bash script - run: ./shell/scripts/retrieve-versions.sh - shell: bash - env: - BRANCH: "master" # ### test building helm chart for an extension # test-build-extension-charts: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" @@ -60,6 +46,28 @@ jobs: # secrets: # registry_token: ${{ secrets.GITHUB_TOKEN }} # ### test releasing shell package + test-release-shell-pkg-master: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Retrieve Shell and Creators versions + run: source ./shell/scripts/retrieve-versions.sh + shell: bash + + - name: Echoing variables + run: echo $SHELL_VERSION && echo CREATORS_VERSION + shell: bash + + - name: "Test release Shell package - master" + uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + with: + is_test: 'true' + test_branch: '12032-reusable-wf-tests-2' + tag: shell-pkg-v${{ env.SHELL_VERSION }} # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 diff --git a/shell/scripts/retrieve-versions.sh b/shell/scripts/retrieve-versions.sh index fc7fc3b3633..a9319ed5c25 100755 --- a/shell/scripts/retrieve-versions.sh +++ b/shell/scripts/retrieve-versions.sh @@ -10,34 +10,21 @@ BASE_DIR="$( SHELL_DIR=$BASE_DIR/shell CREATORS_DIR=$BASE_DIR/creators/extension -if [ -z "$BRANCH" ]; then - echo "You need to specify a BRANCH variable first!" - exit 1 -fi - function generate_version_export() { NAME=$1 case $NAME in "shell") - SHELL_VERSION=$(jq -r .version ${SHELL_DIR}/package.json) - declare SHELL_VERSION_$BRANCH=${SHELL_VERSION} - varname=SHELL_VERSION_$BRANCH - echo shell version ::: ${!varname} + SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) + echo "Shell version retrieved ::: ${SHELL_V}" + export CREATORS_VERSION=SHELL_V ;; "creators") - CREATORS_VERSION=$(jq -r .version ${CREATORS_DIR}/package.json) - declare CREATORS_VERSION_$BRANCH=${CREATORS_VERSION} - varname=CREATORS_VERSION_$BRANCH - echo ${!varname} - echo rancher version ::: ${!varname} + CREATORS_V=$(jq -r .version ${CREATORS_DIR}/package.json) + echo "Creators version retrieved ::: ${CREATORS_V}" ;; esac } -echo "Retrieve current Shell version" - generate_version_export "shell" -generate_version_export "creators" - -# export RANCHER_VERSION_E2E=${{ matrix.rancherEnv[1] }}# \ No newline at end of file +generate_version_export "creators" \ No newline at end of file From 2bbb219d8af680c103d803634632cf96b0a6bfcd Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:00:29 +0000 Subject: [PATCH 29/84] fix problem --- .github/workflows/test-extension-workflows.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 700de8fd010..2a0a2ad2b55 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -46,13 +46,11 @@ jobs: # secrets: # registry_token: ${{ secrets.GITHUB_TOKEN }} # ### test releasing shell package - test-release-shell-pkg-master: + retrieve-shell-creators-versions: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-depth: 1 - name: Retrieve Shell and Creators versions run: source ./shell/scripts/retrieve-versions.sh @@ -61,13 +59,13 @@ jobs: - name: Echoing variables run: echo $SHELL_VERSION && echo CREATORS_VERSION shell: bash - - - name: "Test release Shell package - master" - uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 - with: - is_test: 'true' - test_branch: '12032-reusable-wf-tests-2' - tag: shell-pkg-v${{ env.SHELL_VERSION }} + test-release-shell-pkg-master: + needs: retrieve-shell-creators-versions + uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + with: + is_test: 'true' + test_branch: '12032-reusable-wf-tests-2' + tag: shell-pkg-v${{ env.SHELL_VERSION }} # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 From d504a0a7c909e16b584812f2463648389722c887 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:02:24 +0000 Subject: [PATCH 30/84] fix problem --- .github/workflows/test-extension-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 2a0a2ad2b55..3c4c64559e2 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -65,7 +65,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: shell-pkg-v${{ env.SHELL_VERSION }} + tag: shell-pkg-v${{ SHELL_VERSION }} # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 From a3c47d0fdf7031c6a92a0846c09348a7ab42fb7a Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:06:24 +0000 Subject: [PATCH 31/84] fix problem --- .github/workflows/test-extension-workflows.yml | 2 +- shell/scripts/retrieve-versions.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 3c4c64559e2..2a0a2ad2b55 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -65,7 +65,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: shell-pkg-v${{ SHELL_VERSION }} + tag: shell-pkg-v${{ env.SHELL_VERSION }} # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 diff --git a/shell/scripts/retrieve-versions.sh b/shell/scripts/retrieve-versions.sh index a9319ed5c25..62edcf7cff3 100755 --- a/shell/scripts/retrieve-versions.sh +++ b/shell/scripts/retrieve-versions.sh @@ -16,11 +16,12 @@ function generate_version_export() { case $NAME in "shell") SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) + echo "SHELL_VERSION=$SHELL_V" >> $GITHUB_ENV echo "Shell version retrieved ::: ${SHELL_V}" - export CREATORS_VERSION=SHELL_V ;; "creators") CREATORS_V=$(jq -r .version ${CREATORS_DIR}/package.json) + echo "CREATORS_VERSION=$CREATORS_V" >> $GITHUB_ENV echo "Creators version retrieved ::: ${CREATORS_V}" ;; esac From b9ea107b5366d65714ea5f33c8d7f0f17e1bacab Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:07:04 +0000 Subject: [PATCH 32/84] fix problem --- .github/workflows/test-extension-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 2a0a2ad2b55..638bc141a07 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -65,7 +65,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: shell-pkg-v${{ env.SHELL_VERSION }} + tag: 'shell-pkg-v${{ env.SHELL_VERSION }}' # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 From 9c07d456a65b1b451a62a81413ee91d4fafb9a34 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:09:30 +0000 Subject: [PATCH 33/84] fix problem --- .github/workflows/test-extension-workflows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 638bc141a07..dbb2c862dce 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -57,7 +57,7 @@ jobs: shell: bash - name: Echoing variables - run: echo $SHELL_VERSION && echo CREATORS_VERSION + run: echo "shell var echo - ${{ SHELL_VERSION }}" && echo "shell var echo - ${{ CREATORS_VERSION }}" shell: bash test-release-shell-pkg-master: needs: retrieve-shell-creators-versions @@ -65,7 +65,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: 'shell-pkg-v${{ env.SHELL_VERSION }}' + tag: 'shell-pkg-v${{ SHELL_VERSION }}' # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 From 321c81f80f5d2090e330f0d2266ea93462a6e735 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:11:28 +0000 Subject: [PATCH 34/84] fix problem --- .github/workflows/test-extension-workflows.yml | 4 ++-- shell/scripts/retrieve-versions.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index dbb2c862dce..a1dc22d5093 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -57,7 +57,7 @@ jobs: shell: bash - name: Echoing variables - run: echo "shell var echo - ${{ SHELL_VERSION }}" && echo "shell var echo - ${{ CREATORS_VERSION }}" + run: echo "shell var echo - ${{ env.SHELL_VERSION }}" && echo "shell var echo - ${{ env.CREATORS_VERSION }}" shell: bash test-release-shell-pkg-master: needs: retrieve-shell-creators-versions @@ -65,7 +65,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: 'shell-pkg-v${{ SHELL_VERSION }}' + tag: 'shell-pkg-v${{ env.SHELL_VERSION }}' # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 diff --git a/shell/scripts/retrieve-versions.sh b/shell/scripts/retrieve-versions.sh index 62edcf7cff3..de0fc07f00f 100755 --- a/shell/scripts/retrieve-versions.sh +++ b/shell/scripts/retrieve-versions.sh @@ -16,12 +16,12 @@ function generate_version_export() { case $NAME in "shell") SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) - echo "SHELL_VERSION=$SHELL_V" >> $GITHUB_ENV + echo "SHELL_VERSION=$SHELL_V" >> "$GITHUB_ENV" echo "Shell version retrieved ::: ${SHELL_V}" ;; "creators") CREATORS_V=$(jq -r .version ${CREATORS_DIR}/package.json) - echo "CREATORS_VERSION=$CREATORS_V" >> $GITHUB_ENV + echo "CREATORS_VERSION=$CREATORS_V" >> "$GITHUB_ENV" echo "Creators version retrieved ::: ${CREATORS_V}" ;; esac From 5d19536017a2ed7cc7618c567c17f71003df2192 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:19:03 +0000 Subject: [PATCH 35/84] fix problem --- .github/workflows/test-extension-workflows.yml | 4 ++-- shell/scripts/retrieve-versions.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index a1dc22d5093..be62792b58f 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -57,7 +57,7 @@ jobs: shell: bash - name: Echoing variables - run: echo "shell var echo - ${{ env.SHELL_VERSION }}" && echo "shell var echo - ${{ env.CREATORS_VERSION }}" + run: echo "shell var echo - $SHELL_VERSION" && echo "shell var echo - $CREATORS_VERSION" shell: bash test-release-shell-pkg-master: needs: retrieve-shell-creators-versions @@ -65,7 +65,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: 'shell-pkg-v${{ env.SHELL_VERSION }}' + tag: 'shell-pkg-v$SHELL_VERSION' # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 diff --git a/shell/scripts/retrieve-versions.sh b/shell/scripts/retrieve-versions.sh index de0fc07f00f..62edcf7cff3 100755 --- a/shell/scripts/retrieve-versions.sh +++ b/shell/scripts/retrieve-versions.sh @@ -16,12 +16,12 @@ function generate_version_export() { case $NAME in "shell") SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) - echo "SHELL_VERSION=$SHELL_V" >> "$GITHUB_ENV" + echo "SHELL_VERSION=$SHELL_V" >> $GITHUB_ENV echo "Shell version retrieved ::: ${SHELL_V}" ;; "creators") CREATORS_V=$(jq -r .version ${CREATORS_DIR}/package.json) - echo "CREATORS_VERSION=$CREATORS_V" >> "$GITHUB_ENV" + echo "CREATORS_VERSION=$CREATORS_V" >> $GITHUB_ENV echo "Creators version retrieved ::: ${CREATORS_V}" ;; esac From c09a528e440a4f41d88a188b2fb754d719e9d6b3 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:20:23 +0000 Subject: [PATCH 36/84] fix problem --- .github/workflows/test-extension-workflows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index be62792b58f..a71bf8b3d27 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -57,7 +57,7 @@ jobs: shell: bash - name: Echoing variables - run: echo "shell var echo - $SHELL_VERSION" && echo "shell var echo - $CREATORS_VERSION" + run: echo "shell var echo - SHELL_VERSION" && echo "shell var echo - CREATORS_VERSION" shell: bash test-release-shell-pkg-master: needs: retrieve-shell-creators-versions @@ -65,7 +65,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: 'shell-pkg-v$SHELL_VERSION' + tag: shell-pkg-v$SHELL_VERSION # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 From abaf376898d2ecc1ba064e58dec3a52f54385269 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:21:37 +0000 Subject: [PATCH 37/84] fix problem --- .github/workflows/test-extension-workflows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index a71bf8b3d27..e27fe25248e 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -57,7 +57,7 @@ jobs: shell: bash - name: Echoing variables - run: echo "shell var echo - SHELL_VERSION" && echo "shell var echo - CREATORS_VERSION" + run: echo "shell var echo - $SHELL_VERSION" && echo "shell var echo - $CREATORS_VERSION" shell: bash test-release-shell-pkg-master: needs: retrieve-shell-creators-versions @@ -65,7 +65,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: shell-pkg-v$SHELL_VERSION + tag: 'shell-pkg-v${{ SHELL_VERSION }}' # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 From 8f1ff18796749b88d8b16909d853fa50baf9cff2 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:23:49 +0000 Subject: [PATCH 38/84] fix problem --- .github/workflows/test-extension-workflows.yml | 4 ++-- shell/scripts/retrieve-versions.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index e27fe25248e..05fe09ab187 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -57,7 +57,7 @@ jobs: shell: bash - name: Echoing variables - run: echo "shell var echo - $SHELL_VERSION" && echo "shell var echo - $CREATORS_VERSION" + run: echo "shell var echo - $SHELL_VERSION_TAG" && echo "shell var echo - $CREATORS_VERSION_TAG" shell: bash test-release-shell-pkg-master: needs: retrieve-shell-creators-versions @@ -65,7 +65,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: 'shell-pkg-v${{ SHELL_VERSION }}' + tag: $SHELL_VERSION_TAG # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 diff --git a/shell/scripts/retrieve-versions.sh b/shell/scripts/retrieve-versions.sh index 62edcf7cff3..bd8828b4c3f 100755 --- a/shell/scripts/retrieve-versions.sh +++ b/shell/scripts/retrieve-versions.sh @@ -10,18 +10,18 @@ BASE_DIR="$( SHELL_DIR=$BASE_DIR/shell CREATORS_DIR=$BASE_DIR/creators/extension -function generate_version_export() { +function generate_tag_export() { NAME=$1 case $NAME in "shell") SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) - echo "SHELL_VERSION=$SHELL_V" >> $GITHUB_ENV + echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_ENV echo "Shell version retrieved ::: ${SHELL_V}" ;; "creators") CREATORS_V=$(jq -r .version ${CREATORS_DIR}/package.json) - echo "CREATORS_VERSION=$CREATORS_V" >> $GITHUB_ENV + echo "CREATORS_VERSION_TAG=creators-pkg-v$CREATORS_V" >> $GITHUB_ENV echo "Creators version retrieved ::: ${CREATORS_V}" ;; esac From 0726c80b856e707f1d7a075569493f64ee00826b Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:24:28 +0000 Subject: [PATCH 39/84] fix problem --- shell/scripts/retrieve-versions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/scripts/retrieve-versions.sh b/shell/scripts/retrieve-versions.sh index bd8828b4c3f..9cf89c8f167 100755 --- a/shell/scripts/retrieve-versions.sh +++ b/shell/scripts/retrieve-versions.sh @@ -27,5 +27,5 @@ function generate_tag_export() { esac } -generate_version_export "shell" -generate_version_export "creators" \ No newline at end of file +generate_tag_export "shell" +generate_tag_export "creators" \ No newline at end of file From 464154e82884c47035981340c5cf67ae26133bdb Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:49:19 +0000 Subject: [PATCH 40/84] fix problem --- .github/workflows/test-extension-workflows.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 05fe09ab187..279cc84afab 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -53,8 +53,18 @@ jobs: uses: actions/checkout@v4 - name: Retrieve Shell and Creators versions - run: source ./shell/scripts/retrieve-versions.sh + # run: source ./shell/scripts/retrieve-versions.sh shell: bash + run: | + SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" + BASE_DIR="$( + cd $SCRIPT_DIR && cd ../.. & + pwd + )" + SHELL_DIR=$BASE_DIR/shell + + SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) + echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_ENV - name: Echoing variables run: echo "shell var echo - $SHELL_VERSION_TAG" && echo "shell var echo - $CREATORS_VERSION_TAG" @@ -65,7 +75,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: $SHELL_VERSION_TAG + tag: ${{ env.SHELL_VERSION_TAG }} # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 From 19d620323a12d0b34c0ec273eca794436d4b5d30 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:57:12 +0000 Subject: [PATCH 41/84] fix problem --- .github/workflows/test-extension-workflows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 279cc84afab..3db6524c9ae 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -64,7 +64,7 @@ jobs: SHELL_DIR=$BASE_DIR/shell SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) - echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_ENV + echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT - name: Echoing variables run: echo "shell var echo - $SHELL_VERSION_TAG" && echo "shell var echo - $CREATORS_VERSION_TAG" @@ -75,7 +75,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: ${{ env.SHELL_VERSION_TAG }} + tag: ${{ needs.retrieve-shell-creators-versions.outputs.SHELL_VERSION_TAG }} # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 From 6e6a461cf932efb7befea3240742729f25c36e35 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 16:58:31 +0000 Subject: [PATCH 42/84] fix problem --- .../workflows/test-extension-workflows.yml | 20 +++++++++---------- shell/scripts/retrieve-versions.sh | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 3db6524c9ae..ee665526da7 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -53,18 +53,18 @@ jobs: uses: actions/checkout@v4 - name: Retrieve Shell and Creators versions - # run: source ./shell/scripts/retrieve-versions.sh + run: source ./shell/scripts/retrieve-versions.sh shell: bash - run: | - SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" - BASE_DIR="$( - cd $SCRIPT_DIR && cd ../.. & - pwd - )" - SHELL_DIR=$BASE_DIR/shell + # run: | + # SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" + # BASE_DIR="$( + # cd $SCRIPT_DIR && cd ../.. & + # pwd + # )" + # SHELL_DIR=$BASE_DIR/shell - SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) - echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT + # SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) + # echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT - name: Echoing variables run: echo "shell var echo - $SHELL_VERSION_TAG" && echo "shell var echo - $CREATORS_VERSION_TAG" diff --git a/shell/scripts/retrieve-versions.sh b/shell/scripts/retrieve-versions.sh index 9cf89c8f167..2925becb350 100755 --- a/shell/scripts/retrieve-versions.sh +++ b/shell/scripts/retrieve-versions.sh @@ -16,12 +16,12 @@ function generate_tag_export() { case $NAME in "shell") SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) - echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_ENV + echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT echo "Shell version retrieved ::: ${SHELL_V}" ;; "creators") CREATORS_V=$(jq -r .version ${CREATORS_DIR}/package.json) - echo "CREATORS_VERSION_TAG=creators-pkg-v$CREATORS_V" >> $GITHUB_ENV + echo "CREATORS_VERSION_TAG=creators-pkg-v$CREATORS_V" >> $GITHUB_OUTPUT echo "Creators version retrieved ::: ${CREATORS_V}" ;; esac From 7a57e34edc4158cc48ca3129328638fe6b6cd551 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 17:01:32 +0000 Subject: [PATCH 43/84] fix problem --- .github/workflows/test-extension-workflows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index ee665526da7..51fab2af615 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -54,6 +54,7 @@ jobs: - name: Retrieve Shell and Creators versions run: source ./shell/scripts/retrieve-versions.sh + id: retrieve-data shell: bash # run: | # SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" @@ -75,7 +76,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: ${{ needs.retrieve-shell-creators-versions.outputs.SHELL_VERSION_TAG }} + tag: ${{ steps.retrieve-data.outputs.SHELL_VERSION_TAG }} # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 From 1cd635367e7f47ba04451c3e47958224bd25422d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 17:15:59 +0000 Subject: [PATCH 44/84] fix problem --- .../workflows/test-extension-workflows.yml | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 51fab2af615..913f4508221 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -53,19 +53,18 @@ jobs: uses: actions/checkout@v4 - name: Retrieve Shell and Creators versions - run: source ./shell/scripts/retrieve-versions.sh + # run: source ./shell/scripts/retrieve-versions.sh id: retrieve-data shell: bash - # run: | - # SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" - # BASE_DIR="$( - # cd $SCRIPT_DIR && cd ../.. & - # pwd - # )" - # SHELL_DIR=$BASE_DIR/shell - - # SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) - # echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT + run: | + SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" + BASE_DIR="$( + cd $SCRIPT_DIR && cd ../.. & + pwd + )" + SHELL_DIR=$BASE_DIR/shell + SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) + echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT - name: Echoing variables run: echo "shell var echo - $SHELL_VERSION_TAG" && echo "shell var echo - $CREATORS_VERSION_TAG" @@ -76,7 +75,7 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: ${{ steps.retrieve-data.outputs.SHELL_VERSION_TAG }} + tag: ${{ needs.retrieve-shell-creators-versions.outputs.SHELL_VERSION_TAG }} # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 From f6ba67554b95fbfef6de643e35ec09d24b71fb0a Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 17:23:53 +0000 Subject: [PATCH 45/84] fix problem --- .github/workflows/test-extension-workflows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 913f4508221..222caf9878c 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -48,6 +48,8 @@ jobs: # ### test releasing shell package retrieve-shell-creators-versions: runs-on: ubuntu-latest + outputs: + SHELL_VERSION_TAG: ${{ steps.retrieve-data.outputs.SHELL_VERSION_TAG }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -67,7 +69,7 @@ jobs: echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT - name: Echoing variables - run: echo "shell var echo - $SHELL_VERSION_TAG" && echo "shell var echo - $CREATORS_VERSION_TAG" + run: echo "shell var echo - ${{ steps.retrieve-data.outputs.SHELL_VERSION_TAG }}" && echo "shell var echo - $CREATORS_VERSION_TAG" shell: bash test-release-shell-pkg-master: needs: retrieve-shell-creators-versions From 4ead347d19993dc722f662632ee2017eb785e073 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 17:25:18 +0000 Subject: [PATCH 46/84] fix problem --- .../workflows/test-extension-workflows.yml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 222caf9878c..fe524e6ed8e 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -55,18 +55,18 @@ jobs: uses: actions/checkout@v4 - name: Retrieve Shell and Creators versions - # run: source ./shell/scripts/retrieve-versions.sh + run: source ./shell/scripts/retrieve-versions.sh id: retrieve-data shell: bash - run: | - SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" - BASE_DIR="$( - cd $SCRIPT_DIR && cd ../.. & - pwd - )" - SHELL_DIR=$BASE_DIR/shell - SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) - echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT + # run: | + # SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" + # BASE_DIR="$( + # cd $SCRIPT_DIR && cd ../.. & + # pwd + # )" + # SHELL_DIR=$BASE_DIR/shell + # SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) + # echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT - name: Echoing variables run: echo "shell var echo - ${{ steps.retrieve-data.outputs.SHELL_VERSION_TAG }}" && echo "shell var echo - $CREATORS_VERSION_TAG" From de5d149ef8063456125471269f7b5c843107621d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 17:28:39 +0000 Subject: [PATCH 47/84] test both workflows --- .../workflows/test-extension-workflows.yml | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index fe524e6ed8e..07f8c1a5886 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -46,7 +46,7 @@ jobs: # secrets: # registry_token: ${{ secrets.GITHUB_TOKEN }} # ### test releasing shell package - retrieve-shell-creators-versions: + retrieve-shell-creators-versions-12032-reusable-wf-tests-2: runs-on: ubuntu-latest outputs: SHELL_VERSION_TAG: ${{ steps.retrieve-data.outputs.SHELL_VERSION_TAG }} @@ -58,26 +58,20 @@ jobs: run: source ./shell/scripts/retrieve-versions.sh id: retrieve-data shell: bash - # run: | - # SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" - # BASE_DIR="$( - # cd $SCRIPT_DIR && cd ../.. & - # pwd - # )" - # SHELL_DIR=$BASE_DIR/shell - # SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) - # echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT - - - name: Echoing variables - run: echo "shell var echo - ${{ steps.retrieve-data.outputs.SHELL_VERSION_TAG }}" && echo "shell var echo - $CREATORS_VERSION_TAG" - shell: bash test-release-shell-pkg-master: - needs: retrieve-shell-creators-versions + needs: retrieve-shell-creators-versions-12032-reusable-wf-tests-2 uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: ${{ needs.retrieve-shell-creators-versions.outputs.SHELL_VERSION_TAG }} + tag: ${{ needs.retrieve-shell-creators-versions-12032-reusable-wf-tests-2.outputs.SHELL_VERSION_TAG }} + test-release-creators-pkg: + needs: retrieve-shell-creators-versions-12032-reusable-wf-tests-2 + uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + with: + is_test: 'true' + test_branch: '12032-reusable-wf-tests-2' + tag: ${{ needs.retrieve-shell-creators-versions-12032-reusable-wf-tests-2.outputs.CREATORS_VERSION_TAG }} # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 From b528048bbb7231fc9056e88d92c44e762c02394d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 17:30:17 +0000 Subject: [PATCH 48/84] test both workflows --- .github/workflows/test-extension-workflows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 07f8c1a5886..f1692cf429a 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -50,6 +50,7 @@ jobs: runs-on: ubuntu-latest outputs: SHELL_VERSION_TAG: ${{ steps.retrieve-data.outputs.SHELL_VERSION_TAG }} + CREATORS_VERSION_TAG: ${{ steps.retrieve-data.outputs.CREATORS_VERSION_TAG }} steps: - name: Checkout code uses: actions/checkout@v4 From 7c4dc169ab88061468d4d0c6b811900561605395 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 18:05:37 +0000 Subject: [PATCH 49/84] enable all wfs --- .../workflows/test-extension-workflows.yml | 48 +++++++++++++++---- shell/scripts/retrieve-versions.sh | 33 +++++++++++-- 2 files changed, 68 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index f1692cf429a..597759bc815 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -46,11 +46,13 @@ jobs: # secrets: # registry_token: ${{ secrets.GITHUB_TOKEN }} # ### test releasing shell package - retrieve-shell-creators-versions-12032-reusable-wf-tests-2: + retrieve-tags-master: runs-on: ubuntu-latest outputs: - SHELL_VERSION_TAG: ${{ steps.retrieve-data.outputs.SHELL_VERSION_TAG }} - CREATORS_VERSION_TAG: ${{ steps.retrieve-data.outputs.CREATORS_VERSION_TAG }} + 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 }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -59,20 +61,50 @@ jobs: run: source ./shell/scripts/retrieve-versions.sh id: retrieve-data shell: bash + test-build-extension-charts: + needs: retrieve-tags-master + uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests-2 + 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_repo: 'ui-plugin-examples' + test_branch: 'main' + test-build-extension-catalog: + needs: retrieve-tags-master + uses: aalves08/dashboard/.github/workflows/build-extension-catalog.yml@12032-reusable-wf-tests-2 + 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_repo: 'ui-plugin-examples' + test_branch: 'main' + secrets: + registry_token: ${{ secrets.GITHUB_TOKEN }} test-release-shell-pkg-master: - needs: retrieve-shell-creators-versions-12032-reusable-wf-tests-2 + needs: retrieve-tags-master uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: ${{ needs.retrieve-shell-creators-versions-12032-reusable-wf-tests-2.outputs.SHELL_VERSION_TAG }} - test-release-creators-pkg: - needs: retrieve-shell-creators-versions-12032-reusable-wf-tests-2 + tag: ${{ needs.retrieve-tags-master.outputs.SHELL_TAG }} + test-release-creators-pkg-master: + needs: retrieve-tags-master uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: ${{ needs.retrieve-shell-creators-versions-12032-reusable-wf-tests-2.outputs.CREATORS_VERSION_TAG }} + tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} # test-release-shell-pkg: # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 diff --git a/shell/scripts/retrieve-versions.sh b/shell/scripts/retrieve-versions.sh index 2925becb350..811aafcb202 100755 --- a/shell/scripts/retrieve-versions.sh +++ b/shell/scripts/retrieve-versions.sh @@ -16,16 +16,39 @@ function generate_tag_export() { case $NAME in "shell") SHELL_V=$(jq -r .version ${SHELL_DIR}/package.json) - echo "SHELL_VERSION_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT - echo "Shell version retrieved ::: ${SHELL_V}" + echo "SHELL_TAG=shell-pkg-v$SHELL_V" >> $GITHUB_OUTPUT + echo "Shell tag retrieved ::: ${SHELL_V}" ;; "creators") CREATORS_V=$(jq -r .version ${CREATORS_DIR}/package.json) - echo "CREATORS_VERSION_TAG=creators-pkg-v$CREATORS_V" >> $GITHUB_OUTPUT - echo "Creators version retrieved ::: ${CREATORS_V}" + echo "CREATORS_TAG=creators-pkg-v$CREATORS_V" >> $GITHUB_OUTPUT + echo "Creators tag retrieved ::: ${CREATORS_V}" + ;; + "extension") + REPO_NAME=$2 + BRANCH=$3 + EXTENSION=$4 + git clone https://github.com/rancher/$REPO_NAME.git + pushd ${BASE_DIR}/$REPO_NAME + + git checkout $BRANCH + + ECI_NAME=$(jq -r .name ./package.json) + ECI_VERSION=$(jq -r .version ./package.json) + EXTENSION_VERSION=$(jq -r .version pkg/$EXTENSION/package.json) + ECI_TAG_FULL=$ECI_NAME-$ECI_VERSION + EXTENSION_TAG_FULL=$EXTENSION-$EXTENSION_VERSION + + echo "ECI_TAG=$ECI_TAG_FULL" >> $GITHUB_OUTPUT + echo "EXTENSION_TAG=$EXTENSION_TAG_FULL" >> $GITHUB_OUTPUT + echo "ECI tag retrieved ::: ${ECI_TAG_FULL}" + echo "Extension tag retrieved ::: ${EXTENSION_TAG_FULL}" + + popd ;; esac } generate_tag_export "shell" -generate_tag_export "creators" \ No newline at end of file +generate_tag_export "creators" +generate_tag_export "extension" "ui-plugin-examples" "main" "clock" \ No newline at end of file From 20c9bc804a69c02115f4d541019723efbc301819 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 18:15:29 +0000 Subject: [PATCH 50/84] final test run --- .../workflows/test-extension-workflows.yml | 55 +------------------ shell/scripts/extension/parse-tag-name | 2 + 2 files changed, 5 insertions(+), 52 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 597759bc815..416b62d5932 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -11,41 +11,7 @@ defaults: run: shell: bash working-directory: ./ -# TODO: get latest versions from each branch for shell + creators + get version of latest clock and ui-plugin-examples root package.json version jobs: - # ### test building helm chart for an extension - # test-build-extension-charts: - # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" - # uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests-2 - # permissions: - # actions: write - # contents: write - # deployments: write - # pages: write - # with: - # target_branch: 'gh-pages' - # tagged_release: 'clock-0.3.2' - # is_test: 'true' - # test_repo: 'ui-plugin-examples' - # test_branch: 'main' - # ### test building catalog image for extensions - # test-build-extension-catalog: - # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" - # uses: aalves08/dashboard/.github/workflows/build-extension-catalog.yml@12032-reusable-wf-tests-2 - # permissions: - # actions: write - # contents: read - # packages: write - # with: - # registry_target: ghcr.io - # registry_user: ${{ github.actor }} - # tagged_release: 'ui-plugin-examples-0.1.0' - # is_test: 'true' - # test_repo: 'ui-plugin-examples' - # test_branch: 'main' - # secrets: - # registry_token: ${{ secrets.GITHUB_TOKEN }} - # ### test releasing shell package retrieve-tags-master: runs-on: ubuntu-latest outputs: @@ -61,7 +27,7 @@ jobs: run: source ./shell/scripts/retrieve-versions.sh id: retrieve-data shell: bash - test-build-extension-charts: + test-build-extension-charts-master: needs: retrieve-tags-master uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests-2 permissions: @@ -75,7 +41,7 @@ jobs: is_test: 'true' test_repo: 'ui-plugin-examples' test_branch: 'main' - test-build-extension-catalog: + test-build-extension-catalog-master: needs: retrieve-tags-master uses: aalves08/dashboard/.github/workflows/build-extension-catalog.yml@12032-reusable-wf-tests-2 permissions: @@ -104,19 +70,4 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} - # test-release-shell-pkg: - # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) - # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 - # with: - # is_test: 'true' - # test_branch: '12032-reusable-wf-tests-2' - # tag: shell-pkg-v3.0.0 - # ### test releasing creators package - # test-release-creators-pkg: - # # TODO: Create more tests for each branch (master, release-2.9, release-2.8) by setting correct branch on "uses" and "test_branch" (they need to be the same) - # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 - # with: - # is_test: 'true' - # test_branch: '12032-reusable-wf-tests-2' - # tag: creators-pkg-v1.0.0 \ No newline at end of file + tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} \ No newline at end of file diff --git a/shell/scripts/extension/parse-tag-name b/shell/scripts/extension/parse-tag-name index e87e6bbff0b..ef19335b4af 100755 --- a/shell/scripts/extension/parse-tag-name +++ b/shell/scripts/extension/parse-tag-name @@ -4,6 +4,8 @@ GITHUB_RELEASE_TAG=$1 GITHUB_RUN_ID=$2 GITHUB_WORKFLOW_TYPE=$3 +echo "Parse tag name - evaluating release tag $GITHUB_RELEASE_TAG" + # Ensure "catalog" workflow release tag name does not match a pkg/ if [[ "${GITHUB_WORKFLOW_TYPE}" == "catalog" ]]; then for d in pkg/*/ ; do From 2a27bc40eec62fbc0491e9401656a021da603a66 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 18:16:37 +0000 Subject: [PATCH 51/84] final test run --- .github/workflows/release-shell-pkg.yaml | 111 +++++++++++------------ 1 file changed, 51 insertions(+), 60 deletions(-) diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index 96cfa31a1ab..c79a526eba1 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -26,72 +26,63 @@ jobs: packages: write if: github.repository == 'aalves08/dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}')) steps: - # TODO: this step is only for debug purposes... to be deleted - - name: Echo some variables - run: | - echo "github.repository ::: ${{github.repository}}" - echo "github.event_name ::: ${{github.event_name}}" - echo "github.event.ref ::: ${{github.event.ref}}" - echo "github.ref_name ::: ${{github.ref_name}}" - echo "inputs.tag ::: ${{inputs.tag}}" - - # - if: inputs.is_test == 'true' && inputs.test_branch != '' - # name: Checkout (test flow) - # uses: actions/checkout@v3 - # with: - # persist-credentials: false - # ref: ${{ inputs.test_branch }} - # fetch-depth: 0 + - if: inputs.is_test == 'true' && inputs.test_branch != '' + name: Checkout (test flow) + uses: actions/checkout@v3 + with: + persist-credentials: false + ref: ${{ inputs.test_branch }} + fetch-depth: 0 - # - if: inputs.is_test != 'true' - # name: Checkout (normal flow) - # uses: actions/checkout@v3 - # with: - # fetch-depth: 0 - # persist-credentials: false + - if: inputs.is_test != 'true' + name: Checkout (normal flow) + uses: actions/checkout@v3 + with: + fetch-depth: 0 + persist-credentials: false - # - name: Enable Corepack - # run: corepack enable + - name: Enable Corepack + run: corepack enable - # - name: Setup Node.js - # uses: actions/setup-node@v4 - # with: - # node-version-file: '.nvmrc' - # cache: 'yarn' + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'yarn' - # - name: Check Tags Version Matching - # env: - # TAG: ${{ inputs.tag || github.ref_name }} - # run: ./.github/workflows/scripts/check-package-tag-version.sh - # shell: bash + - name: Check Tags Version Matching + env: + TAG: ${{ inputs.tag || github.ref_name }} + run: ./.github/workflows/scripts/check-package-tag-version.sh + shell: bash - # # TODO: Re-enable this step before completing PR - # # - name: Validate Plugin build system - # # run: ./shell/scripts/test-plugins-build.sh - # # shell: bash + # TODO: Re-enable this step before completing PR + # - name: Validate Plugin build system + # run: ./shell/scripts/test-plugins-build.sh + # shell: bash - # # Reset the local (ci) repository state because - # # The previous step (Validate Plugin build system) changes - # # the version number on package.json for Shell in order - # # to release it in verdaccio for it's tests - # - name: Reset repository (file system) - # run: | - # git reset --hard HEAD - # echo $NPM_REGISTRY - # cat ./shell/package.json + # Reset the local (ci) repository state because + # The previous step (Validate Plugin build system) changes + # the version number on package.json for Shell in order + # to release it in verdaccio for it's tests + - name: Reset repository (file system) + run: | + git reset --hard HEAD + echo $NPM_REGISTRY + cat ./shell/package.json - # - uses: actions/setup-node@v4 - # with: - # node-version-file: '.nvmrc' - # registry-url: 'https://registry.npmjs.org' - # scope: '@rancher' + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org' + scope: '@rancher' - # - name: Install packages - # run: yarn install --frozen-lockfile + - name: Install packages + run: yarn install --frozen-lockfile - # - name: Publish Shell Package to npm - # run: ./shell/scripts/publish-shell.sh --npm - # env: - # TAG: ${{ inputs.tag || github.ref_name }} - # DRY_RUN: ${{ inputs.is_test }} - # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish Shell Package to npm + run: ./shell/scripts/publish-shell.sh --npm + env: + TAG: ${{ inputs.tag || github.ref_name }} + DRY_RUN: ${{ inputs.is_test }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 51bb3a5163a66d4c64e3df582be4ac6bb7d42d5c Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 19:45:11 +0000 Subject: [PATCH 52/84] test with slack --- .github/workflows/build-extension-catalog.yml | 8 ++-- .github/workflows/build-extension-charts.yml | 12 +++--- .github/workflows/release-shell-pkg.yaml | 8 ++-- .../workflows/test-extension-workflows.yml | 39 ++++++++++++++++--- 4 files changed, 48 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-extension-catalog.yml b/.github/workflows/build-extension-catalog.yml index 63feccd535f..a6dba5e66c6 100644 --- a/.github/workflows/build-extension-catalog.yml +++ b/.github/workflows/build-extension-catalog.yml @@ -15,10 +15,10 @@ on: is_test: required: false type: string - test_repo: + test_ext_repo: required: false type: string - test_branch: + test_ext_branch: required: false type: string secrets: @@ -40,8 +40,8 @@ jobs: name: Checkout repository (test flow) uses: actions/checkout@v4 with: - repository: rancher/${{ inputs.test_repo }} - ref: ${{ inputs.test_branch }} + repository: rancher/${{ inputs.test_ext_repo }} + ref: ${{ inputs.test_ext_branch }} - if: inputs.is_test != 'true' name: Checkout repository (normal flow) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 4bf48de27d5..72fb1411fdb 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -12,10 +12,10 @@ on: is_test: required: false type: string - test_repo: + test_ext_repo: required: false type: string - test_branch: + test_ext_branch: required: false type: string @@ -40,8 +40,8 @@ jobs: name: Checkout (test flow) uses: actions/checkout@v4 with: - repository: rancher/${{ inputs.test_repo }} - ref: ${{ inputs.test_branch }} + repository: rancher/${{ inputs.test_ext_repo }} + ref: ${{ inputs.test_ext_branch }} fetch-depth: 0 - if: inputs.is_test != 'true' @@ -97,12 +97,12 @@ jobs: $publish - name: Upload charts artifact - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test == 'true' + if: github.ref_type == 'tag' || github.event_name != 'pull_request' || inputs.is_test == 'true' uses: actions/upload-artifact@v3 with: name: charts path: tmp -## if test, check if artifacts are there... +## TODO: if test, check if artifacts are there... release: name: Release Build if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test != 'true' diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index c79a526eba1..7c78314dacd 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -24,6 +24,7 @@ jobs: permissions: contents: read packages: write + # TODO: replace "aalves08" if: github.repository == 'aalves08/dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}')) steps: - if: inputs.is_test == 'true' && inputs.test_branch != '' @@ -56,10 +57,9 @@ jobs: run: ./.github/workflows/scripts/check-package-tag-version.sh shell: bash - # TODO: Re-enable this step before completing PR - # - name: Validate Plugin build system - # run: ./shell/scripts/test-plugins-build.sh - # shell: bash + - name: Validate Plugin build system + run: ./shell/scripts/test-plugins-build.sh + shell: bash # Reset the local (ci) repository state because # The previous step (Validate Plugin build system) changes diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 416b62d5932..d98c8783558 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -11,6 +11,7 @@ defaults: run: shell: bash working-directory: ./ +# TODO: replace all instances of "aalves08" and "12032-reusable-wf-tests-2" jobs: retrieve-tags-master: runs-on: ubuntu-latest @@ -22,6 +23,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + ref: 12032-reusable-wf-tests-2 - name: Retrieve Shell and Creators versions run: source ./shell/scripts/retrieve-versions.sh @@ -39,8 +42,8 @@ jobs: target_branch: 'gh-pages' tagged_release: ${{ needs.retrieve-tags-master.outputs.EXTENSIONS_TAG }} is_test: 'true' - test_repo: 'ui-plugin-examples' - test_branch: 'main' + test_ext_repo: 'ui-plugin-examples' + test_ext_branch: 'main' test-build-extension-catalog-master: needs: retrieve-tags-master uses: aalves08/dashboard/.github/workflows/build-extension-catalog.yml@12032-reusable-wf-tests-2 @@ -53,8 +56,8 @@ jobs: registry_user: ${{ github.actor }} tagged_release: ${{ needs.retrieve-tags-master.outputs.ECI_TAG }} is_test: 'true' - test_repo: 'ui-plugin-examples' - test_branch: 'main' + test_ext_repo: 'ui-plugin-examples' + test_ext_branch: 'main' secrets: registry_token: ${{ secrets.GITHUB_TOKEN }} test-release-shell-pkg-master: @@ -70,4 +73,30 @@ jobs: with: is_test: 'true' test_branch: '12032-reusable-wf-tests-2' - tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} \ No newline at end of file + 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] + # TODO: SLACK_WEBHOOK_URL_WORKFLOWS not SLACK_WEBHOOK_URL + steps: + - name: Slack message for workflow success + env: + SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL_WORKFLOWS }} + if: success() + shell: bash + run: | + curl -X POST \ + -H "Content-type: application/json; charset=utf-8" \ + --data '{"name": "${{ github.job }}", "status": "Extensions workflow test succedded! ✅", "workflow_run": ${{ github.run_id }} }' \ + $SLACK_URL + - name: Slack message for workflow success + env: + SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL_WORKFLOWS }} + if: success() + shell: bash + run: | + curl -X POST \ + -H "Content-type: application/json; charset=utf-8" \ + --data '{"name": "${{ github.job }}", "status": "Extensions workflow test failed! 🆘", "workflow_run": ${{ github.run_id }} }' \ + $SLACK_URL From d59deaf827b49891331825d3ec7933da40888d8e Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 20:02:57 +0000 Subject: [PATCH 53/84] test with slack --- .github/workflows/build-extension-charts.yml | 4 ++- .../workflows/test-extension-workflows.yml | 32 +++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 72fb1411fdb..ba9cdf18c64 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -94,10 +94,12 @@ jobs: publish="$publish -f" fi + exit 0; + $publish - name: Upload charts artifact - if: github.ref_type == 'tag' || github.event_name != 'pull_request' || inputs.is_test == 'true' + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test == 'true' uses: actions/upload-artifact@v3 with: name: charts diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index d98c8783558..09c9f3d4ebf 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -60,20 +60,20 @@ jobs: test_ext_branch: 'main' secrets: registry_token: ${{ secrets.GITHUB_TOKEN }} - test-release-shell-pkg-master: - needs: retrieve-tags-master - uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 - with: - is_test: 'true' - test_branch: '12032-reusable-wf-tests-2' - tag: ${{ needs.retrieve-tags-master.outputs.SHELL_TAG }} - test-release-creators-pkg-master: - needs: retrieve-tags-master - uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 - with: - is_test: 'true' - test_branch: '12032-reusable-wf-tests-2' - tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} + # test-release-shell-pkg-master: + # needs: retrieve-tags-master + # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + # with: + # is_test: 'true' + # test_branch: '12032-reusable-wf-tests-2' + # tag: ${{ needs.retrieve-tags-master.outputs.SHELL_TAG }} + # test-release-creators-pkg-master: + # needs: retrieve-tags-master + # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + # with: + # is_test: 'true' + # test_branch: '12032-reusable-wf-tests-2' + # tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} slack-message: if: always() runs-on: ubuntu-latest @@ -82,7 +82,7 @@ jobs: steps: - name: Slack message for workflow success env: - SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL_WORKFLOWS }} + SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} if: success() shell: bash run: | @@ -92,7 +92,7 @@ jobs: $SLACK_URL - name: Slack message for workflow success env: - SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL_WORKFLOWS }} + SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} if: success() shell: bash run: | From 282f8f8ca80081b2286d3e477c2e313dea47b7eb Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 11 Nov 2024 20:03:33 +0000 Subject: [PATCH 54/84] test with slack --- .github/workflows/test-extension-workflows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 09c9f3d4ebf..dd510a440d6 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -77,7 +77,8 @@ jobs: 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] + # needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master, test-release-shell-pkg-master, test-release-creators-pkg-master] + needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master] # TODO: SLACK_WEBHOOK_URL_WORKFLOWS not SLACK_WEBHOOK_URL steps: - name: Slack message for workflow success From 912a687e5db2200ac8e57f5129379585ef214635 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 11:27:43 +0000 Subject: [PATCH 55/84] test wf slack hit --- .github/workflows/build-extension-charts.yml | 2 +- .github/workflows/test-extension-workflows.yml | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index ba9cdf18c64..809e0f7ba85 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -94,7 +94,7 @@ jobs: publish="$publish -f" fi - exit 0; + exit 1; $publish diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index dd510a440d6..bbd7d6424f1 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -79,7 +79,7 @@ jobs: 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] needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master] - # TODO: SLACK_WEBHOOK_URL_WORKFLOWS not SLACK_WEBHOOK_URL + # TODO: SLACK_WEBHOOK_URL_EXT_WFS not SLACK_WEBHOOK_URL steps: - name: Slack message for workflow success env: @@ -87,16 +87,18 @@ jobs: if: success() shell: bash run: | + echo "JOBS SUCCEEDED: ${{ github.job }}" curl -X POST \ -H "Content-type: application/json; charset=utf-8" \ --data '{"name": "${{ github.job }}", "status": "Extensions workflow test succedded! ✅", "workflow_run": ${{ github.run_id }} }' \ $SLACK_URL - - name: Slack message for workflow success + - name: Slack message for workflow failure env: SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - if: success() + if: failure() shell: bash run: | + echo "JOBS FAILED: ${{ github.job }}" curl -X POST \ -H "Content-type: application/json; charset=utf-8" \ --data '{"name": "${{ github.job }}", "status": "Extensions workflow test failed! 🆘", "workflow_run": ${{ github.run_id }} }' \ From e3847d12d9b3e25f59afff6b24993c289cb5ca8e Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 11:31:59 +0000 Subject: [PATCH 56/84] have all workflows succeed to check slack message triggered --- .github/workflows/build-extension-charts.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 809e0f7ba85..00a95e679a3 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -94,8 +94,6 @@ jobs: publish="$publish -f" fi - exit 1; - $publish - name: Upload charts artifact From 3ae516a65c6f514c6ae2adf4bda48e82b8298d24 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 16:37:45 +0000 Subject: [PATCH 57/84] test slack msg output --- .github/workflows/build-extension-charts.yml | 2 + .../workflows/test-extension-workflows.yml | 63 +++++++++++++------ 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 00a95e679a3..809e0f7ba85 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -94,6 +94,8 @@ jobs: publish="$publish -f" fi + exit 1; + $publish - name: Upload charts artifact diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index bbd7d6424f1..515a9679079 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -20,6 +20,7 @@ jobs: 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 }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -75,31 +76,53 @@ jobs: # test_branch: '12032-reusable-wf-tests-2' # tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} slack-message: - if: always() + 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] needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master] # TODO: SLACK_WEBHOOK_URL_EXT_WFS not SLACK_WEBHOOK_URL steps: - - name: Slack message for workflow success - env: - SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - if: success() + - name: Slack message for workflow + if: always() shell: bash - run: | - echo "JOBS SUCCEEDED: ${{ github.job }}" - curl -X POST \ - -H "Content-type: application/json; charset=utf-8" \ - --data '{"name": "${{ github.job }}", "status": "Extensions workflow test succedded! ✅", "workflow_run": ${{ github.run_id }} }' \ - $SLACK_URL - - name: Slack message for workflow failure env: - SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - if: failure() - shell: bash + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | - echo "JOBS FAILED: ${{ github.job }}" - curl -X POST \ - -H "Content-type: application/json; charset=utf-8" \ - --data '{"name": "${{ github.job }}", "status": "Extensions workflow test failed! 🆘", "workflow_run": ${{ github.run_id }} }' \ - $SLACK_URL + succeeded=() + failed=() + for job in retrieve-tags-master test-build-extension-charts-master test-build-extension-catalog-master; do + if [[ ${{ job.outputs.result }} == 'success' ]]; then + succeeded+=("$job") + else + failed+=("$job") + fi + done + + succeeded_message="" + failed_message="" + + if [[ -n "${succeeded[*]}" ]]; then + succeeded_message="✅ The following jobs succeeded:\n${succeeded[*]}" + fi + + if [[ -n "${failed[*]}" ]]; then + failed_message="❌ The following jobs failed:\n${failed[*]}" + fi + + echo "succeeded_message ::: $succeeded_message" + echo "failed_message ::: $failed_message" + + curl -X POST -H 'Content-type: application/json; charset=utf-8' \ + --data '{ branch: "master", message: "${{ succeeded_message }} ::: ${{ failed_message }}"}' $SLACK_WEBHOOK + + # - name: Slack message for workflow success + # env: + # SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + # if: success() + # shell: bash + # run: | + # echo "JOBS SUCCEEDED: ${{ github.job }}" + # curl -X POST \ + # -H "Content-type: application/json; charset=utf-8" \ + # --data '{"name": "${{ github.job }}", "status": "Extensions workflow test succedded! ✅", "workflow_run": ${{ github.run_id }} }' \ + # $SLACK_URL From c44ee4ab8a47d30dea40ca666407dfe26262c169 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 16:39:37 +0000 Subject: [PATCH 58/84] test slack msg output --- .github/workflows/test-extension-workflows.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 515a9679079..2c480d6ab7c 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -98,9 +98,6 @@ jobs: fi done - succeeded_message="" - failed_message="" - if [[ -n "${succeeded[*]}" ]]; then succeeded_message="✅ The following jobs succeeded:\n${succeeded[*]}" fi @@ -109,8 +106,8 @@ jobs: failed_message="❌ The following jobs failed:\n${failed[*]}" fi - echo "succeeded_message ::: $succeeded_message" - echo "failed_message ::: $failed_message" + echo "succeeded ::: $succeeded" + echo "failed ::: $failed" curl -X POST -H 'Content-type: application/json; charset=utf-8' \ --data '{ branch: "master", message: "${{ succeeded_message }} ::: ${{ failed_message }}"}' $SLACK_WEBHOOK From 2c372427e3e780149d2033d4c054d58c314e956a Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 16:40:30 +0000 Subject: [PATCH 59/84] test slack msg output --- .github/workflows/test-extension-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 2c480d6ab7c..860e7db1e79 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -84,7 +84,7 @@ jobs: steps: - name: Slack message for workflow if: always() - shell: bash + # shell: bash env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | From 31ac307559f56ff520d137d134dc47df6166dbcf Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 16:42:40 +0000 Subject: [PATCH 60/84] test slack msg output --- .github/workflows/test-extension-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 860e7db1e79..dc79108f299 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -110,7 +110,7 @@ jobs: echo "failed ::: $failed" curl -X POST -H 'Content-type: application/json; charset=utf-8' \ - --data '{ branch: "master", message: "${{ succeeded_message }} ::: ${{ failed_message }}"}' $SLACK_WEBHOOK + --data '{ branch: "master", message: "$succeeded_message ::: $failed_message"}' $SLACK_WEBHOOK # - name: Slack message for workflow success # env: From 040eddebaeedbf436488a7e20c2ed0cfa02e9aed Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 16:48:19 +0000 Subject: [PATCH 61/84] test slack msg output --- .github/workflows/test-extension-workflows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index dc79108f299..0c3b54b3501 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -91,7 +91,8 @@ jobs: succeeded=() failed=() for job in retrieve-tags-master test-build-extension-charts-master test-build-extension-catalog-master; do - if [[ ${{ job.outputs.result }} == 'success' ]]; then + result=${{ 'steps.'. job . '.outputs.result' }} + if [[ $result == 'success' ]]; then succeeded+=("$job") else failed+=("$job") From 8d04222034e70972a169dfa95902cd0b2aaf8421 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 16:49:34 +0000 Subject: [PATCH 62/84] test slack msg output --- .github/workflows/test-extension-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 0c3b54b3501..432659df0e3 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -91,7 +91,7 @@ jobs: succeeded=() failed=() for job in retrieve-tags-master test-build-extension-charts-master test-build-extension-catalog-master; do - result=${{ 'steps.'. job . '.outputs.result' }} + result=${{ format('{{ needs.{0}.outputs.result }}', job) }} if [[ $result == 'success' ]]; then succeeded+=("$job") else From af603840949951dd83fd2ce9c33696641deb9a6d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 16:54:13 +0000 Subject: [PATCH 63/84] test slack msg output --- .github/workflows/build-extension-catalog.yml | 82 +++++++++---------- .../workflows/test-extension-workflows.yml | 2 +- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/build-extension-catalog.yml b/.github/workflows/build-extension-catalog.yml index a6dba5e66c6..44ddf0941e3 100644 --- a/.github/workflows/build-extension-catalog.yml +++ b/.github/workflows/build-extension-catalog.yml @@ -47,55 +47,55 @@ jobs: name: Checkout repository (normal flow) uses: actions/checkout@v4 - - name: Enable Corepack - run: corepack enable + # - name: Enable Corepack + # run: corepack enable - - name: Configure Git - run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' + # - name: Configure Git + # run: | + # git config user.name 'github-actions[bot]' + # git config user.email 'github-actions[bot]@users.noreply.github.com' - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ inputs.registry_target }} - username: ${{ inputs.registry_user }} - password: ${{ secrets.registry_token }} + # - name: Login to GitHub Container Registry + # uses: docker/login-action@v2 + # with: + # registry: ${{ inputs.registry_target }} + # username: ${{ inputs.registry_user }} + # password: ${{ secrets.registry_token }} - - name: Setup Helm - uses: azure/setup-helm@v3 - with: - version: v3.8.0 + # - name: Setup Helm + # uses: azure/setup-helm@v3 + # with: + # version: v3.8.0 - - name: Setup Nodejs with yarn caching - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: yarn + # - name: Setup Nodejs with yarn caching + # uses: actions/setup-node@v4 + # with: + # node-version: '20' + # cache: yarn - - name: Install dependencies - run: yarn + # - name: Install dependencies + # run: yarn - - name: Parse Extension Name - if: github.ref_type == 'tag' || inputs.is_test == 'true' - id: parsed-name - env: - GH_TOKEN: ${{ github.token }} - run: | - yarn parse-tag-name ${{ inputs.tagged_release }} ${{ github.run_id }} "catalog" + # - name: Parse Extension Name + # if: github.ref_type == 'tag' || inputs.is_test == 'true' + # id: parsed-name + # env: + # GH_TOKEN: ${{ github.token }} + # run: | + # yarn parse-tag-name ${{ inputs.tagged_release }} ${{ github.run_id }} "catalog" - - name: Build and push UI image - run: | - publish="yarn publish-pkgs -c" + # - name: Build and push UI image + # run: | + # publish="yarn publish-pkgs -c" - if [[ "${{ inputs.is_test }}" != "true" ]]; then - publish="$publish -p" - fi + # if [[ "${{ inputs.is_test }}" != "true" ]]; then + # publish="$publish -p" + # fi - publish="$publish -r ${{ inputs.registry_target }} -o ${{ github.repository_owner }}" + # publish="$publish -r ${{ inputs.registry_target }} -o ${{ github.repository_owner }}" - if [[ -n "${{ inputs.tagged_release }}" ]]; then - publish="$publish -t ${{ inputs.tagged_release }}" - fi + # if [[ -n "${{ inputs.tagged_release }}" ]]; then + # publish="$publish -t ${{ inputs.tagged_release }}" + # fi - $publish + # $publish diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 432659df0e3..b75ea129eb3 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -91,7 +91,7 @@ jobs: succeeded=() failed=() for job in retrieve-tags-master test-build-extension-charts-master test-build-extension-catalog-master; do - result=${{ format('{{ needs.{0}.outputs.result }}', job) }} + result=${{ format('{{ job.outputs.result }}', job) }} if [[ $result == 'success' ]]; then succeeded+=("$job") else From c97ce6969d5d186f734c224537504f69b51fc132 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 16:58:15 +0000 Subject: [PATCH 64/84] test slack msg output --- .github/workflows/test-extension-workflows.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index b75ea129eb3..5cd8dd8710d 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -91,8 +91,7 @@ jobs: succeeded=() failed=() for job in retrieve-tags-master test-build-extension-charts-master test-build-extension-catalog-master; do - result=${{ format('{{ job.outputs.result }}', job) }} - if [[ $result == 'success' ]]; then + if [[ ${{ format('{{ job.status == ''success'' }}', job) }} == 'true' ]]; then succeeded+=("$job") else failed+=("$job") From 201b93fb96799e724f12a50fa4caba344ab0c992 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 17:02:31 +0000 Subject: [PATCH 65/84] test slack msg output --- .github/workflows/test-extension-workflows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 5cd8dd8710d..6f2c797d0ef 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -90,8 +90,8 @@ jobs: run: | succeeded=() failed=() - for job in retrieve-tags-master test-build-extension-charts-master test-build-extension-catalog-master; do - if [[ ${{ format('{{ job.status == ''success'' }}', job) }} == 'true' ]]; then + for job in "retrieve-tags-master" "test-build-extension-charts-master" "test-build-extension-catalog-master"; do + if [[ ${{ format('{{ jobs["{}"].status == ''success'' }}', job[1:-1]) }} == 'true' ]]; then succeeded+=("$job") else failed+=("$job") From b3623a8fa33956ee6daa6d93675885ced636738c Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 17:03:08 +0000 Subject: [PATCH 66/84] test slack msg output --- .github/workflows/test-extension-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 6f2c797d0ef..e1de41bc2ba 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -91,7 +91,7 @@ jobs: succeeded=() failed=() for job in "retrieve-tags-master" "test-build-extension-charts-master" "test-build-extension-catalog-master"; do - if [[ ${{ format('{{ jobs["{}"].status == ''success'' }}', job[1:-1]) }} == 'true' ]]; then + if [[ ${{ format('{{ job.status == ''success'' }}', job) }} == 'true' ]]; then succeeded+=("$job") else failed+=("$job") From 8db7d24d15fc8b77cffb1709244b76c2e101cd1e Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Tue, 12 Nov 2024 17:24:02 +0000 Subject: [PATCH 67/84] test slack msg output --- .github/workflows/build-extension-charts.yml | 3 +-- .github/workflows/test-extension-workflows.yml | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 809e0f7ba85..4664e927c33 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -55,6 +55,7 @@ jobs: - name: Configure Git run: | + exit 1; git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' @@ -94,8 +95,6 @@ jobs: publish="$publish -f" fi - exit 1; - $publish - name: Upload charts artifact diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index e1de41bc2ba..0de37c6ca51 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -75,6 +75,7 @@ jobs: # is_test: 'true' # test_branch: '12032-reusable-wf-tests-2' # tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} + slack-message: if: ${{ always() }} runs-on: ubuntu-latest @@ -91,7 +92,7 @@ jobs: succeeded=() failed=() for job in "retrieve-tags-master" "test-build-extension-charts-master" "test-build-extension-catalog-master"; do - if [[ ${{ format('{{ job.status == ''success'' }}', job) }} == 'true' ]]; then + if [[ ${{ format('{{ job.status == "success" }}', job) }} == "true" ]]; then succeeded+=("$job") else failed+=("$job") From b4105f82ba40229df1538d64e0bb672361abc2e3 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 10:54:15 +0000 Subject: [PATCH 68/84] test slack msg output --- .github/workflows/build-extension-charts.yml | 7 ++++++ .../workflows/test-extension-workflows.yml | 22 ++----------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 4664e927c33..2bbae196bfb 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -18,6 +18,9 @@ on: test_ext_branch: required: false type: string + outputs: + build-job-status: ${{ jobs.build.outputs.build-status }} + release-job-status: ${{ jobs.build.outputs.release-status }} env: ACTIONS_RUNNER_DEBUG: false @@ -35,6 +38,8 @@ jobs: permissions: actions: write contents: read + outputs: + build-status: ${{ job.status }} steps: - if: inputs.is_test == 'true' name: Checkout (test flow) @@ -114,6 +119,8 @@ jobs: contents: write deployments: write pages: write + outputs: + release-status: ${{ job.status }} steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 0de37c6ca51..4a630d77fd8 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -89,26 +89,8 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | - succeeded=() - failed=() - for job in "retrieve-tags-master" "test-build-extension-charts-master" "test-build-extension-catalog-master"; do - if [[ ${{ format('{{ job.status == "success" }}', job) }} == "true" ]]; then - succeeded+=("$job") - else - failed+=("$job") - fi - done - - if [[ -n "${succeeded[*]}" ]]; then - succeeded_message="✅ The following jobs succeeded:\n${succeeded[*]}" - fi - - if [[ -n "${failed[*]}" ]]; then - failed_message="❌ The following jobs failed:\n${failed[*]}" - fi - - echo "succeeded ::: $succeeded" - echo "failed ::: $failed" + echo "status for test-build-extension-charts-master - build ::: {{ jobs.test-build-extension-charts-master.outputs.build-job-status }}" + echo "status for test-build-extension-charts-master - release ::: {{ jobs.test-build-extension-charts-master.outputs.release-job-status }}" curl -X POST -H 'Content-type: application/json; charset=utf-8' \ --data '{ branch: "master", message: "$succeeded_message ::: $failed_message"}' $SLACK_WEBHOOK From eb2c1922c6229a95aaadd7fe7b283e383fa337ef Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 10:55:41 +0000 Subject: [PATCH 69/84] test slack msg output --- .github/workflows/build-extension-charts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 2bbae196bfb..305dd1bd1a2 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -19,8 +19,8 @@ on: required: false type: string outputs: - build-job-status: ${{ jobs.build.outputs.build-status }} - release-job-status: ${{ jobs.build.outputs.release-status }} + build-job-status: ${{ jobs.build-extension-artifact.outputs.build-status }} + release-job-status: ${{ jobs.release.outputs.release-status }} env: ACTIONS_RUNNER_DEBUG: false From e4d602d119502b4f84f322e737b53f1ce24082ce Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 10:58:02 +0000 Subject: [PATCH 70/84] test slack msg output --- .github/workflows/build-extension-charts.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 305dd1bd1a2..804248e2e6e 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -19,8 +19,10 @@ on: required: false type: string outputs: - build-job-status: ${{ jobs.build-extension-artifact.outputs.build-status }} - release-job-status: ${{ jobs.release.outputs.release-status }} + build-job-status: + value: ${{ jobs.build-extension-artifact.outputs.build-status }} + release-job-status: + value: ${{ jobs.release.outputs.release-status }} env: ACTIONS_RUNNER_DEBUG: false From 7b73a7d06dede56f76a373d197fbd334b6a8e067 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 10:59:16 +0000 Subject: [PATCH 71/84] test slack msg output --- .github/workflows/test-extension-workflows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 4a630d77fd8..29cb92dfccd 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -89,8 +89,8 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | - echo "status for test-build-extension-charts-master - build ::: {{ jobs.test-build-extension-charts-master.outputs.build-job-status }}" - echo "status for test-build-extension-charts-master - release ::: {{ jobs.test-build-extension-charts-master.outputs.release-job-status }}" + echo "status for test-build-extension-charts-master - build ::: ${{ jobs.test-build-extension-charts-master.outputs.build-job-status }}" + echo "status for test-build-extension-charts-master - release ::: ${{ jobs.test-build-extension-charts-master.outputs.release-job-status }}" curl -X POST -H 'Content-type: application/json; charset=utf-8' \ --data '{ branch: "master", message: "$succeeded_message ::: $failed_message"}' $SLACK_WEBHOOK From 714fa750475298c74c47275cd68f59e316759734 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 11:19:01 +0000 Subject: [PATCH 72/84] test slack msg output --- .github/workflows/test-extension-workflows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 29cb92dfccd..cdc7122f7fa 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -89,8 +89,8 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | - echo "status for test-build-extension-charts-master - build ::: ${{ jobs.test-build-extension-charts-master.outputs.build-job-status }}" - echo "status for test-build-extension-charts-master - release ::: ${{ jobs.test-build-extension-charts-master.outputs.release-job-status }}" + echo "status for test-build-extension-charts-master - build ::: ${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" + echo "status for test-build-extension-charts-master - release ::: ${{ needs.test-build-extension-charts-master.outputs.release-job-status }}" curl -X POST -H 'Content-type: application/json; charset=utf-8' \ --data '{ branch: "master", message: "$succeeded_message ::: $failed_message"}' $SLACK_WEBHOOK From dbaf3a8b973ff89008d77025051afed60f4fddb0 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 12:19:14 +0000 Subject: [PATCH 73/84] adding outputs for jobs statuses and creating message for slack --- .github/workflows/build-extension-catalog.yml | 6 +- .github/workflows/release-shell-pkg.yaml | 81 ++++++++++--------- .../workflows/test-extension-workflows.yml | 73 ++++++++++++----- 3 files changed, 100 insertions(+), 60 deletions(-) diff --git a/.github/workflows/build-extension-catalog.yml b/.github/workflows/build-extension-catalog.yml index 44ddf0941e3..4afb6c4c0a5 100644 --- a/.github/workflows/build-extension-catalog.yml +++ b/.github/workflows/build-extension-catalog.yml @@ -24,6 +24,9 @@ on: secrets: registry_token: required: true + outputs: + build-extension-catalog-job-status: + value: ${{ jobs.build-extension-catalog.outputs.build-status }} jobs: build-extension-catalog: @@ -34,7 +37,8 @@ jobs: actions: write contents: read packages: write - + outputs: + build-status: ${{ job.status }} steps: - if: inputs.is_test == 'true' name: Checkout repository (test flow) diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index 7c78314dacd..2b8090379f8 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -16,6 +16,9 @@ on: test_branch: required: false type: string + outputs: + build-release-shell-creators-status: + value: ${{ jobs.build.outputs.build-status }} jobs: @@ -24,8 +27,10 @@ jobs: permissions: contents: read packages: write - # TODO: replace "aalves08" + # TODO: replace "aalves08" for "rancher" if: github.repository == 'aalves08/dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}')) + outputs: + build-status: ${{ job.status }} steps: - if: inputs.is_test == 'true' && inputs.test_branch != '' name: Checkout (test flow) @@ -42,47 +47,47 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Enable Corepack - run: corepack enable + # - name: Enable Corepack + # run: corepack enable - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'yarn' + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # node-version-file: '.nvmrc' + # cache: 'yarn' - - name: Check Tags Version Matching - env: - TAG: ${{ inputs.tag || github.ref_name }} - run: ./.github/workflows/scripts/check-package-tag-version.sh - shell: bash + # - name: Check Tags Version Matching + # env: + # TAG: ${{ inputs.tag || github.ref_name }} + # run: ./.github/workflows/scripts/check-package-tag-version.sh + # shell: bash - - name: Validate Plugin build system - run: ./shell/scripts/test-plugins-build.sh - shell: bash + # - name: Validate Plugin build system + # run: ./shell/scripts/test-plugins-build.sh + # shell: bash - # Reset the local (ci) repository state because - # The previous step (Validate Plugin build system) changes - # the version number on package.json for Shell in order - # to release it in verdaccio for it's tests - - name: Reset repository (file system) - run: | - git reset --hard HEAD - echo $NPM_REGISTRY - cat ./shell/package.json + # # Reset the local (ci) repository state because + # # The previous step (Validate Plugin build system) changes + # # the version number on package.json for Shell in order + # # to release it in verdaccio for it's tests + # - name: Reset repository (file system) + # run: | + # git reset --hard HEAD + # echo $NPM_REGISTRY + # cat ./shell/package.json - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - registry-url: 'https://registry.npmjs.org' - scope: '@rancher' + # - uses: actions/setup-node@v4 + # with: + # node-version-file: '.nvmrc' + # registry-url: 'https://registry.npmjs.org' + # scope: '@rancher' - - name: Install packages - run: yarn install --frozen-lockfile + # - name: Install packages + # run: yarn install --frozen-lockfile - - name: Publish Shell Package to npm - run: ./shell/scripts/publish-shell.sh --npm - env: - TAG: ${{ inputs.tag || github.ref_name }} - DRY_RUN: ${{ inputs.is_test }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # - name: Publish Shell Package to npm + # run: ./shell/scripts/publish-shell.sh --npm + # env: + # TAG: ${{ inputs.tag || github.ref_name }} + # DRY_RUN: ${{ inputs.is_test }} + # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index cdc7122f7fa..0bccb6fdcbd 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -21,6 +21,7 @@ jobs: 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 @@ -61,39 +62,69 @@ jobs: test_ext_branch: 'main' secrets: registry_token: ${{ secrets.GITHUB_TOKEN }} - # test-release-shell-pkg-master: - # needs: retrieve-tags-master - # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 - # with: - # is_test: 'true' - # test_branch: '12032-reusable-wf-tests-2' - # tag: ${{ needs.retrieve-tags-master.outputs.SHELL_TAG }} - # test-release-creators-pkg-master: - # needs: retrieve-tags-master - # uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 - # with: - # is_test: 'true' - # test_branch: '12032-reusable-wf-tests-2' - # tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} + test-release-shell-pkg-master: + needs: retrieve-tags-master + uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + with: + is_test: 'true' + test_branch: '12032-reusable-wf-tests-2' + tag: ${{ needs.retrieve-tags-master.outputs.SHELL_TAG }} + test-release-creators-pkg-master: + needs: retrieve-tags-master + uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + with: + is_test: 'true' + test_branch: '12032-reusable-wf-tests-2' + 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] - needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master] + needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master, test-release-shell-pkg-master, test-release-creators-pkg-master] # TODO: SLACK_WEBHOOK_URL_EXT_WFS not SLACK_WEBHOOK_URL steps: - name: Slack message for workflow if: always() - # shell: bash env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | - echo "status for test-build-extension-charts-master - build ::: ${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" - echo "status for test-build-extension-charts-master - release ::: ${{ needs.test-build-extension-charts-master.outputs.release-job-status }}" - + tags-output=${{ needs.retrieve-tags-master.outputs.tags-job-status }} + extensions-chart-build-output=${{ needs.test-build-extension-charts-master.outputs.build-job-status }} + extensions-chart-release-output=${{ needs.test-build-extension-charts-master.outputs.release-job-status }} + extensions-catalog-build-output=${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }} + release-shell-pkg-output=${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }} + release-creators-pkg-output=${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }} + + output-array=(${tags-output} ${extensions-chart-build-output} ${extensions-chart-release-output} ${extensions-catalog-build-output} $release-shell-pkg-output $release-creators-pkg-output) + + if [[ ${output-array[@]} =~ "failure" ]]; then + message-prefix="Workflows testing for extensions succedded! ✅" + else + message-prefix="Workflows testing for extensions failed! 🆘" + fi + + echo $message-prefix + + tags-output-string="status for retrieve-tags-master - build ::: ${{ tags-output }}" + extensions-chart-build-output-string="status for test-build-extension-charts-master - build ::: ${{ extensions-chart-build-output }}" + extensions-chart-release-output-string="status for test-build-extension-charts-master - release ::: ${{ extensions-chart-release-output }}" + extensions-catalog-build-output-string="status for test-build-extension-catalog-master - build ::: ${{ extensions-catalog-build-output }}" + release-shell-pkg-output-string="status for test-release-shell-pkg-master - release ::: ${{ release-shell-pkg-output }}" + release-creators-pkg-output-string="status for test-release-creators-pkg-master - release ::: ${{ release-creators-pkg-output }}" + + echo $tags-output-string + echo $extensions-chart-build-output-string + echo $extensions-chart-release-output-string + echo $extensions-catalog-build-output-string + echo $release-shell-pkg-output-string + echo $release-creators-pkg-output-string + + message="$message-prefix ::: $tags-output-string ::: $extensions-chart-build-output-string ::: $extensions-chart-release-output-string ::: $extensions-catalog-build-output-string ::: $release-shell-pkg-output-string ::: $release-creators-pkg-output-string" + + echo "message sent: $message" + curl -X POST -H 'Content-type: application/json; charset=utf-8' \ - --data '{ branch: "master", message: "$succeeded_message ::: $failed_message"}' $SLACK_WEBHOOK + --data '{ branch: "master", message: $message }' $SLACK_WEBHOOK # - name: Slack message for workflow success # env: From e095455296166f6960d1a85c41362f26ec1c1f24 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 12:25:09 +0000 Subject: [PATCH 74/84] fix --- .../workflows/test-extension-workflows.yml | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 0bccb6fdcbd..661df797f92 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -88,43 +88,43 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | - tags-output=${{ needs.retrieve-tags-master.outputs.tags-job-status }} - extensions-chart-build-output=${{ needs.test-build-extension-charts-master.outputs.build-job-status }} - extensions-chart-release-output=${{ needs.test-build-extension-charts-master.outputs.release-job-status }} - extensions-catalog-build-output=${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }} - release-shell-pkg-output=${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }} - release-creators-pkg-output=${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }} + TAGS_OUTPUT=${{ needs.retrieve-tags-master.outputs.tags-job-status }} + EXT_CHART_BUILD_OUTPUT=${{ needs.test-build-extension-charts-master.outputs.build-job-status }} + EXT_CHART_RELEASE_OUTPUT=${{ needs.test-build-extension-charts-master.outputs.release-job-status }} + EXT_CATALOG_BUILD_OUTPUT=${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }} + RELEASE_SHELL_PKG_OUTPUT=${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }} + RELEASE_CREATORS_PKG_OUTPUT=${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }} - output-array=(${tags-output} ${extensions-chart-build-output} ${extensions-chart-release-output} ${extensions-catalog-build-output} $release-shell-pkg-output $release-creators-pkg-output) + OUTPUT_ARRAY=(${TAGS_OUTPUT} ${EXT_CHART_BUILD_OUTPUT} ${EXT_CHART_RELEASE_OUTPUT} ${EXT_CATALOG_BUILD_OUTPUT} $RELEASE_SHELL_PKG_OUTPUT $RELEASE_CREATORS_PKG_OUTPUT) - if [[ ${output-array[@]} =~ "failure" ]]; then - message-prefix="Workflows testing for extensions succedded! ✅" + if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then + MSG_PREFIX="Workflows testing for extensions succedded! ✅" else - message-prefix="Workflows testing for extensions failed! 🆘" + MSG_PREFIX="Workflows testing for extensions failed! 🆘" fi - echo $message-prefix + echo "message prefix ::: $MSG_PREFIX" - tags-output-string="status for retrieve-tags-master - build ::: ${{ tags-output }}" - extensions-chart-build-output-string="status for test-build-extension-charts-master - build ::: ${{ extensions-chart-build-output }}" - extensions-chart-release-output-string="status for test-build-extension-charts-master - release ::: ${{ extensions-chart-release-output }}" - extensions-catalog-build-output-string="status for test-build-extension-catalog-master - build ::: ${{ extensions-catalog-build-output }}" - release-shell-pkg-output-string="status for test-release-shell-pkg-master - release ::: ${{ release-shell-pkg-output }}" - release-creators-pkg-output-string="status for test-release-creators-pkg-master - release ::: ${{ release-creators-pkg-output }}" + TAGS_OUTPUT_STRING="status for retrieve-tags-master - build ::: ${{ TAGS_OUTPUT }}" + EXT_CHART_BUILD_OUTPUT_STRING="status for test-build-extension-charts-master - build ::: ${{ EXT_CHART_BUILD_OUTPUT }}" + EXT_CHART_RELEASE_OUTPUT_STRING="status for test-build-extension-charts-master - release ::: ${{ EXT_CHART_RELEASE_OUTPUT }}" + EXT_CATALOG_BUILD_OUTPUT_STRING="status for test-build-extension-catalog-master - build ::: ${{ EXT_CATALOG_BUILD_OUTPUT }}" + RELEASE_SHELL_PKG_OUTPUT_STRING="status for test-release-shell-pkg-master - release ::: ${{ RELEASE_SHELL_PKG_OUTPUT }}" + RELEASE_CREATORS_PKG_OUTPUT_STRING="status for test-release-creators-pkg-master - release ::: ${{ RELEASE_CREATORS_PKG_OUTPUT }}" - echo $tags-output-string - echo $extensions-chart-build-output-string - echo $extensions-chart-release-output-string - echo $extensions-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_CHART_RELEASE_OUTPUT_STRING + echo $EXT_CATALOG_BUILD_OUTPUT_STRING + echo $RELEASE_SHELL_PKG_OUTPUT_STRING + echo $RELEASE_CREATORS_PKG_OUTPUT_STRING - message="$message-prefix ::: $tags-output-string ::: $extensions-chart-build-output-string ::: $extensions-chart-release-output-string ::: $extensions-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_CHART_RELEASE_OUTPUT_STRING ::: $EXT_CATALOG_BUILD_OUTPUT_STRING ::: $RELEASE_SHELL_PKG_OUTPUT_STRING ::: $RELEASE_CREATORS_PKG_OUTPUT_STRING" - echo "message sent: $message" + echo "message sent: $MSG" curl -X POST -H 'Content-type: application/json; charset=utf-8' \ - --data '{ branch: "master", message: $message }' $SLACK_WEBHOOK + --data '{ branch: "master", message: $MSG }' $SLACK_WEBHOOK # - name: Slack message for workflow success # env: From 2fdb9576a47054799c54946c8580c0581aa4a74d Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 12:31:21 +0000 Subject: [PATCH 75/84] fix --- .github/workflows/test-extension-workflows.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 661df797f92..8f845618cf3 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -88,12 +88,12 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | - TAGS_OUTPUT=${{ needs.retrieve-tags-master.outputs.tags-job-status }} - EXT_CHART_BUILD_OUTPUT=${{ needs.test-build-extension-charts-master.outputs.build-job-status }} - EXT_CHART_RELEASE_OUTPUT=${{ needs.test-build-extension-charts-master.outputs.release-job-status }} - EXT_CATALOG_BUILD_OUTPUT=${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }} - RELEASE_SHELL_PKG_OUTPUT=${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }} - RELEASE_CREATORS_PKG_OUTPUT=${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }} + TAGS_OUTPUT="${{ needs.retrieve-tags-master.outputs.tags-job-status }}" + EXT_CHART_BUILD_OUTPUT="${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" + EXT_CHART_RELEASE_OUTPUT="${{ needs.test-build-extension-charts-master.outputs.release-job-status }}" + EXT_CATALOG_BUILD_OUTPUT="${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" + RELEASE_SHELL_PKG_OUTPUT="${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" + RELEASE_CREATORS_PKG_OUTPUT="${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}" OUTPUT_ARRAY=(${TAGS_OUTPUT} ${EXT_CHART_BUILD_OUTPUT} ${EXT_CHART_RELEASE_OUTPUT} ${EXT_CATALOG_BUILD_OUTPUT} $RELEASE_SHELL_PKG_OUTPUT $RELEASE_CREATORS_PKG_OUTPUT) From 48c24f0c4df2ce96e256a75de29321042987a195 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 12:32:43 +0000 Subject: [PATCH 76/84] fix --- .github/workflows/test-extension-workflows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 8f845618cf3..791f5ba987d 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -85,6 +85,7 @@ jobs: steps: - name: Slack message for workflow if: always() + shell: bash env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | From f272e4077c42022aea98d5c11c768a9351fdf4b6 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 12:42:24 +0000 Subject: [PATCH 77/84] fix --- .../workflows/test-extension-workflows.yml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 791f5ba987d..279545937a5 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -89,14 +89,14 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | - TAGS_OUTPUT="${{ needs.retrieve-tags-master.outputs.tags-job-status }}" - EXT_CHART_BUILD_OUTPUT="${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" - EXT_CHART_RELEASE_OUTPUT="${{ needs.test-build-extension-charts-master.outputs.release-job-status }}" - EXT_CATALOG_BUILD_OUTPUT="${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" - RELEASE_SHELL_PKG_OUTPUT="${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" - RELEASE_CREATORS_PKG_OUTPUT="${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}" + # TAGS_OUTPUT="${{ needs.retrieve-tags-master.outputs.tags-job-status }}" + # EXT_CHART_BUILD_OUTPUT="${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" + # EXT_CHART_RELEASE_OUTPUT="${{ needs.test-build-extension-charts-master.outputs.release-job-status }}" + # EXT_CATALOG_BUILD_OUTPUT="${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" + # RELEASE_SHELL_PKG_OUTPUT="${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" + # RELEASE_CREATORS_PKG_OUTPUT="${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}" - OUTPUT_ARRAY=(${TAGS_OUTPUT} ${EXT_CHART_BUILD_OUTPUT} ${EXT_CHART_RELEASE_OUTPUT} ${EXT_CATALOG_BUILD_OUTPUT} $RELEASE_SHELL_PKG_OUTPUT $RELEASE_CREATORS_PKG_OUTPUT) + OUTPUT_ARRAY=("${{ needs.retrieve-tags-master.outputs.tags-job-status }}" "${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" "${{ needs.test-build-extension-charts-master.outputs.release-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 succedded! ✅" @@ -106,12 +106,12 @@ jobs: echo "message prefix ::: $MSG_PREFIX" - TAGS_OUTPUT_STRING="status for retrieve-tags-master - build ::: ${{ TAGS_OUTPUT }}" - EXT_CHART_BUILD_OUTPUT_STRING="status for test-build-extension-charts-master - build ::: ${{ EXT_CHART_BUILD_OUTPUT }}" - EXT_CHART_RELEASE_OUTPUT_STRING="status for test-build-extension-charts-master - release ::: ${{ EXT_CHART_RELEASE_OUTPUT }}" - EXT_CATALOG_BUILD_OUTPUT_STRING="status for test-build-extension-catalog-master - build ::: ${{ EXT_CATALOG_BUILD_OUTPUT }}" - RELEASE_SHELL_PKG_OUTPUT_STRING="status for test-release-shell-pkg-master - release ::: ${{ RELEASE_SHELL_PKG_OUTPUT }}" - RELEASE_CREATORS_PKG_OUTPUT_STRING="status for test-release-creators-pkg-master - release ::: ${{ RELEASE_CREATORS_PKG_OUTPUT }}" + 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_CHART_RELEASE_OUTPUT_STRING="status for test-build-extension-charts-master - release ::: ${{ needs.test-build-extension-charts-master.outputs.release-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 From 70b83f6ec229aa271bd2a84ed3f991b309a88286 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 12:50:15 +0000 Subject: [PATCH 78/84] fix --- .../workflows/test-extension-workflows.yml | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 279545937a5..70466a39243 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -89,29 +89,22 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | - # TAGS_OUTPUT="${{ needs.retrieve-tags-master.outputs.tags-job-status }}" - # EXT_CHART_BUILD_OUTPUT="${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" - # EXT_CHART_RELEASE_OUTPUT="${{ needs.test-build-extension-charts-master.outputs.release-job-status }}" - # EXT_CATALOG_BUILD_OUTPUT="${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" - # RELEASE_SHELL_PKG_OUTPUT="${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" - # RELEASE_CREATORS_PKG_OUTPUT="${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}" - OUTPUT_ARRAY=("${{ needs.retrieve-tags-master.outputs.tags-job-status }}" "${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" "${{ needs.test-build-extension-charts-master.outputs.release-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 succedded! ✅" - else 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_CHART_RELEASE_OUTPUT_STRING="status for test-build-extension-charts-master - release ::: ${{ needs.test-build-extension-charts-master.outputs.release-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_CHART_RELEASE_OUTPUT_STRING="status for test-build-extension-charts-master - release => ${{ needs.test-build-extension-charts-master.outputs.release-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 From 78b10754b490403ec48a8c6d1036a7fa2d5bf40f Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 12:52:17 +0000 Subject: [PATCH 79/84] fix --- .github/workflows/build-extension-charts.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 804248e2e6e..87ef21ff0f8 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -62,7 +62,6 @@ jobs: - name: Configure Git run: | - exit 1; git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' From 5298e3b726f049c1da4c8f7c16afdd8196b8c2f4 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Wed, 13 Nov 2024 14:47:08 +0000 Subject: [PATCH 80/84] final version --- .github/workflows/build-extension-catalog.yml | 82 +++++++++---------- .github/workflows/build-extension-charts.yml | 2 +- .github/workflows/release-shell-pkg.yaml | 77 +++++++++-------- .../workflows/test-extension-workflows.yml | 38 +++------ 4 files changed, 91 insertions(+), 108 deletions(-) diff --git a/.github/workflows/build-extension-catalog.yml b/.github/workflows/build-extension-catalog.yml index 4afb6c4c0a5..2f4b7c52d08 100644 --- a/.github/workflows/build-extension-catalog.yml +++ b/.github/workflows/build-extension-catalog.yml @@ -51,55 +51,55 @@ jobs: name: Checkout repository (normal flow) uses: actions/checkout@v4 - # - name: Enable Corepack - # run: corepack enable + - name: Enable Corepack + run: corepack enable - # - name: Configure Git - # run: | - # git config user.name 'github-actions[bot]' - # git config user.email 'github-actions[bot]@users.noreply.github.com' + - name: Configure Git + run: | + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' - # - name: Login to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ${{ inputs.registry_target }} - # username: ${{ inputs.registry_user }} - # password: ${{ secrets.registry_token }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ inputs.registry_target }} + username: ${{ inputs.registry_user }} + password: ${{ secrets.registry_token }} - # - name: Setup Helm - # uses: azure/setup-helm@v3 - # with: - # version: v3.8.0 + - name: Setup Helm + uses: azure/setup-helm@v3 + with: + version: v3.8.0 - # - name: Setup Nodejs with yarn caching - # uses: actions/setup-node@v4 - # with: - # node-version: '20' - # cache: yarn + - name: Setup Nodejs with yarn caching + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: yarn - # - name: Install dependencies - # run: yarn + - name: Install dependencies + run: yarn - # - name: Parse Extension Name - # if: github.ref_type == 'tag' || inputs.is_test == 'true' - # id: parsed-name - # env: - # GH_TOKEN: ${{ github.token }} - # run: | - # yarn parse-tag-name ${{ inputs.tagged_release }} ${{ github.run_id }} "catalog" + - name: Parse Extension Name + if: github.ref_type == 'tag' || inputs.is_test == 'true' + id: parsed-name + env: + GH_TOKEN: ${{ github.token }} + run: | + yarn parse-tag-name ${{ inputs.tagged_release }} ${{ github.run_id }} "catalog" - # - name: Build and push UI image - # run: | - # publish="yarn publish-pkgs -c" + - name: Build and push UI image + run: | + publish="yarn publish-pkgs -c" - # if [[ "${{ inputs.is_test }}" != "true" ]]; then - # publish="$publish -p" - # fi + if [[ "${{ inputs.is_test }}" != "true" ]]; then + publish="$publish -p" + fi - # publish="$publish -r ${{ inputs.registry_target }} -o ${{ github.repository_owner }}" + publish="$publish -r ${{ inputs.registry_target }} -o ${{ github.repository_owner }}" - # if [[ -n "${{ inputs.tagged_release }}" ]]; then - # publish="$publish -t ${{ inputs.tagged_release }}" - # fi + if [[ -n "${{ inputs.tagged_release }}" ]]; then + publish="$publish -t ${{ inputs.tagged_release }}" + fi - # $publish + $publish diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 87ef21ff0f8..edba881700d 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -109,7 +109,7 @@ jobs: with: name: charts path: tmp -## TODO: if test, check if artifacts are there... + release: name: Release Build if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test != 'true' diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index 2b8090379f8..1e414250782 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -27,8 +27,7 @@ jobs: permissions: contents: read packages: write - # TODO: replace "aalves08" for "rancher" - if: github.repository == 'aalves08/dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}')) + if: github.repository == 'rancher/dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}')) outputs: build-status: ${{ job.status }} steps: @@ -47,47 +46,47 @@ jobs: fetch-depth: 0 persist-credentials: false - # - name: Enable Corepack - # run: corepack enable + - name: Enable Corepack + run: corepack enable - # - name: Setup Node.js - # uses: actions/setup-node@v4 - # with: - # node-version-file: '.nvmrc' - # cache: 'yarn' + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'yarn' - # - name: Check Tags Version Matching - # env: - # TAG: ${{ inputs.tag || github.ref_name }} - # run: ./.github/workflows/scripts/check-package-tag-version.sh - # shell: bash + - name: Check Tags Version Matching + env: + TAG: ${{ inputs.tag || github.ref_name }} + run: ./.github/workflows/scripts/check-package-tag-version.sh + shell: bash - # - name: Validate Plugin build system - # run: ./shell/scripts/test-plugins-build.sh - # shell: bash + - name: Validate Plugin build system + run: ./shell/scripts/test-plugins-build.sh + shell: bash - # # Reset the local (ci) repository state because - # # The previous step (Validate Plugin build system) changes - # # the version number on package.json for Shell in order - # # to release it in verdaccio for it's tests - # - name: Reset repository (file system) - # run: | - # git reset --hard HEAD - # echo $NPM_REGISTRY - # cat ./shell/package.json + # Reset the local (ci) repository state because + # The previous step (Validate Plugin build system) changes + # the version number on package.json for Shell in order + # to release it in verdaccio for it's tests + - name: Reset repository (file system) + run: | + git reset --hard HEAD + echo $NPM_REGISTRY + cat ./shell/package.json - # - uses: actions/setup-node@v4 - # with: - # node-version-file: '.nvmrc' - # registry-url: 'https://registry.npmjs.org' - # scope: '@rancher' + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org' + scope: '@rancher' - # - name: Install packages - # run: yarn install --frozen-lockfile + - name: Install packages + run: yarn install --frozen-lockfile - # - name: Publish Shell Package to npm - # run: ./shell/scripts/publish-shell.sh --npm - # env: - # TAG: ${{ inputs.tag || github.ref_name }} - # DRY_RUN: ${{ inputs.is_test }} - # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish Shell Package to npm + run: ./shell/scripts/publish-shell.sh --npm + env: + TAG: ${{ inputs.tag || github.ref_name }} + DRY_RUN: ${{ inputs.is_test }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 70466a39243..e6a5adbb3c9 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -1,17 +1,14 @@ name: Test Extension workflows on: - push: - branches: - - 12032-reusable-wf-tests-2 - # schedule: - # - cron: "0 0 * * *" + schedule: + - cron: "0 0 * * *" defaults: run: shell: bash working-directory: ./ -# TODO: replace all instances of "aalves08" and "12032-reusable-wf-tests-2" + jobs: retrieve-tags-master: runs-on: ubuntu-latest @@ -26,7 +23,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - ref: 12032-reusable-wf-tests-2 + ref: master - name: Retrieve Shell and Creators versions run: source ./shell/scripts/retrieve-versions.sh @@ -34,7 +31,7 @@ jobs: shell: bash test-build-extension-charts-master: needs: retrieve-tags-master - uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests-2 + uses: rancher/dashboard/.github/workflows/build-extension-charts.yml@master permissions: actions: write contents: write @@ -48,7 +45,7 @@ jobs: test_ext_branch: 'main' test-build-extension-catalog-master: needs: retrieve-tags-master - uses: aalves08/dashboard/.github/workflows/build-extension-catalog.yml@12032-reusable-wf-tests-2 + uses: rancher/dashboard/.github/workflows/build-extension-catalog.yml@master permissions: actions: write contents: read @@ -64,24 +61,23 @@ jobs: registry_token: ${{ secrets.GITHUB_TOKEN }} test-release-shell-pkg-master: needs: retrieve-tags-master - uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + uses: rancher/dashboard/.github/workflows/release-shell-pkg.yaml@master with: is_test: 'true' - test_branch: '12032-reusable-wf-tests-2' + test_branch: 'master' tag: ${{ needs.retrieve-tags-master.outputs.SHELL_TAG }} test-release-creators-pkg-master: needs: retrieve-tags-master - uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + uses: rancher/dashboard/.github/workflows/release-shell-pkg.yaml@master with: is_test: 'true' - test_branch: '12032-reusable-wf-tests-2' + test_branch: 'master' 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] - # TODO: SLACK_WEBHOOK_URL_EXT_WFS not SLACK_WEBHOOK_URL steps: - name: Slack message for workflow if: always() @@ -118,16 +114,4 @@ jobs: echo "message sent: $MSG" curl -X POST -H 'Content-type: application/json; charset=utf-8' \ - --data '{ branch: "master", message: $MSG }' $SLACK_WEBHOOK - - # - name: Slack message for workflow success - # env: - # SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - # if: success() - # shell: bash - # run: | - # echo "JOBS SUCCEEDED: ${{ github.job }}" - # curl -X POST \ - # -H "Content-type: application/json; charset=utf-8" \ - # --data '{"name": "${{ github.job }}", "status": "Extensions workflow test succedded! ✅", "workflow_run": ${{ github.run_id }} }' \ - # $SLACK_URL + --data '{ branch: "master", message: $MSG }' $SLACK_WEBHOOK \ No newline at end of file From 196423b4a6e85da300ce6207056a51dcad2f1dba Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 25 Nov 2024 15:37:51 +0000 Subject: [PATCH 81/84] test condition in release-shell-pkg if some inputs are undefined --- .github/workflows/release-shell-pkg.yaml | 50 +++--- .../workflows/test-extension-workflows.yml | 146 +++++++++--------- 2 files changed, 98 insertions(+), 98 deletions(-) diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index 1e414250782..6d8edc1536e 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -61,32 +61,32 @@ jobs: run: ./.github/workflows/scripts/check-package-tag-version.sh shell: bash - - name: Validate Plugin build system - run: ./shell/scripts/test-plugins-build.sh - shell: bash + # - name: Validate Plugin build system + # run: ./shell/scripts/test-plugins-build.sh + # shell: bash - # Reset the local (ci) repository state because - # The previous step (Validate Plugin build system) changes - # the version number on package.json for Shell in order - # to release it in verdaccio for it's tests - - name: Reset repository (file system) - run: | - git reset --hard HEAD - echo $NPM_REGISTRY - cat ./shell/package.json + # # Reset the local (ci) repository state because + # # The previous step (Validate Plugin build system) changes + # # the version number on package.json for Shell in order + # # to release it in verdaccio for it's tests + # - name: Reset repository (file system) + # run: | + # git reset --hard HEAD + # echo $NPM_REGISTRY + # cat ./shell/package.json - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - registry-url: 'https://registry.npmjs.org' - scope: '@rancher' + # - uses: actions/setup-node@v4 + # with: + # node-version-file: '.nvmrc' + # registry-url: 'https://registry.npmjs.org' + # scope: '@rancher' - - name: Install packages - run: yarn install --frozen-lockfile + # - name: Install packages + # run: yarn install --frozen-lockfile - - name: Publish Shell Package to npm - run: ./shell/scripts/publish-shell.sh --npm - env: - TAG: ${{ inputs.tag || github.ref_name }} - DRY_RUN: ${{ inputs.is_test }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # - name: Publish Shell Package to npm + # run: ./shell/scripts/publish-shell.sh --npm + # env: + # TAG: ${{ inputs.tag || github.ref_name }} + # DRY_RUN: ${{ inputs.is_test }} + # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index e6a5adbb3c9..51eb3a67c6b 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -29,89 +29,89 @@ jobs: run: source ./shell/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-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' + # 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 }} + # 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: - 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-charts-master.outputs.release-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 }}") + # 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-charts-master.outputs.release-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_CHART_RELEASE_OUTPUT_STRING="status for test-build-extension-charts-master - release => ${{ needs.test-build-extension-charts-master.outputs.release-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_CHART_RELEASE_OUTPUT_STRING="status for test-build-extension-charts-master - release => ${{ needs.test-build-extension-charts-master.outputs.release-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_CHART_RELEASE_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_CHART_RELEASE_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_CHART_RELEASE_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_CHART_RELEASE_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 }' $SLACK_WEBHOOK \ No newline at end of file + # curl -X POST -H 'Content-type: application/json; charset=utf-8' \ + # --data '{ branch: "master", message: $MSG }' $SLACK_WEBHOOK \ No newline at end of file From 48c640fc62ad5d1da4c042e44a112d683475c6a8 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 25 Nov 2024 15:40:01 +0000 Subject: [PATCH 82/84] add push condition --- .github/workflows/test-extension-workflows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 51eb3a67c6b..5c808cf08dd 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -1,8 +1,8 @@ name: Test Extension workflows on: - schedule: - - cron: "0 0 * * *" + push: + branches: [12032-reusable-wf-tests-2] defaults: run: From c515e3f70c9952f77f68340861cc90e595752c69 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 25 Nov 2024 15:40:51 +0000 Subject: [PATCH 83/84] add push condition --- .github/workflows/test-extension-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index 5c808cf08dd..ebe9232c433 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -61,7 +61,7 @@ jobs: # registry_token: ${{ secrets.GITHUB_TOKEN }} test-release-shell-pkg-master: needs: retrieve-tags-master - uses: rancher/dashboard/.github/workflows/release-shell-pkg.yaml@master + uses: rancher/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 with: # is_test: 'true' # test_branch: 'master' From d523bfb6981e8c4b72c937429c2a3f6546e90463 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Mon, 25 Nov 2024 15:41:44 +0000 Subject: [PATCH 84/84] fix workflow --- .github/workflows/test-extension-workflows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-extension-workflows.yml b/.github/workflows/test-extension-workflows.yml index ebe9232c433..68cd82f55ad 100644 --- a/.github/workflows/test-extension-workflows.yml +++ b/.github/workflows/test-extension-workflows.yml @@ -23,7 +23,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - ref: master + ref: 12032-reusable-wf-tests-2 - name: Retrieve Shell and Creators versions run: source ./shell/scripts/retrieve-versions.sh @@ -61,7 +61,7 @@ jobs: # registry_token: ${{ secrets.GITHUB_TOKEN }} test-release-shell-pkg-master: needs: retrieve-tags-master - uses: rancher/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 + uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2 with: # is_test: 'true' # test_branch: 'master'