Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Support releases with different token testing strategies (#65203)

Nemanja Glumacc81e28e24091
diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml
index e1a64c1b909..bd963c092df 100644
--- a/.github/workflows/pre-release.yml
+++ b/.github/workflows/pre-release.yml
@@ -24,6 +24,39 @@ on:
required: true
jobs:
+ test-mode-config:
+ runs-on: ubuntu-22.04
+ timeout-minutes: 5
+ outputs:
+ run_mode: ${{ steps.config.outputs.runMode }}
+ dev_server: ${{ steps.config.outputs.metastoreDevServer }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ sparse-checkout: release
+ - name: Prepare build scripts
+ run: cd ${{ github.workspace }}/release && yarn && yarn build
+ # note: this block can be removed after we stop needing to be able to test versions before v55
+ - name: Get test mode config
+ id: config
+ uses: actions/github-script@v7
+ with:
+ script: | # js
+ const { getMajorVersion } = require('${{ github.workspace }}/release/dist/index.cjs');
+
+ // Versions before v55 used a single token for testing
+ // with v55 and later we use enterprise tokens that mirror actual Metabase plans
+ const MULTIPLE_TEST_TOKEN_THRESHOLD = 55;
+
+ const version = '${{ inputs.version }}';
+ const majorVersion = Number(getMajorVersion(version));
+ const oldTestToken = majorVersion < MULTIPLE_TEST_TOKEN_THRESHOLD;
+
+ return ({
+ runMode: oldTestToken ? 'prod' : 'e2e';
+ metastoreDevServer: oldTestToken ? '' : '${{ secrets.METASTORE_DEV_SERVER_URL }}'
+ });
+
release-artifact:
runs-on: ubuntu-22.04
timeout-minutes: 10
@@ -96,23 +129,23 @@ jobs:
run-sanity-check:
runs-on: ubuntu-22.04
timeout-minutes: 30
- needs: [release-artifact]
+ needs: [test-mode-config, release-artifact]
strategy:
matrix:
edition: [oss, ee]
env:
MB_EDITION: ${{ matrix.edition }}
DISPLAY: ""
- MB_RUN_MODE: e2e
- METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
+ MB_RUN_MODE: ${{ needs.test-mode-config.outputs.run_mode }}
+ METASTORE_DEV_SERVER_URL: ${{ needs.test-mode-config.outputs.dev_server }}
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }}
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }}
# these are needed for backwards compatibility with release branches earlier than v55, since
# this workflow always runs from master, but we run tests from the release branch
- CYPRESS_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
- CYPRESS_NO_FEATURES_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
+ CYPRESS_ALL_FEATURES_TOKEN: ${{ secrets.MB_ALL_FEATURES_TOKEN }}
+ CYPRESS_NO_FEATURES_TOKEN: ${{ secrets.MB_STARTER_CLOUD_TOKEN }}
# disabled because of out of memory issues
# probably related to https://github.com/cypress-io/cypress/issues/27415
CYPRESS_NO_COMMAND_LOG: 1