diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index fe0d24e87..841e81cbc 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -7,10 +7,14 @@ on: branches: - "*" env: - OPENSEARCH_DASHBOARDS_VERSION: 'main' - OPENSEARCH_VERSION: '3.0.0-SNAPSHOT' - SECURITY_ANALYTICS_BRANCH: 'main' + OPENSEARCH_DASHBOARDS_VERSION: '2.8.0' + OPENSEARCH_VERSION: '2.8.0-SNAPSHOT' + SECURITY_ANALYTICS_BRANCH: '2.x' GRADLE_VERSION: '7.6.1' + + # If this variable is not empty, the package.json, opensearch_dashboards.json, and yarn.lock files will be replaced + # with those files from the 'opensearch-project/security-analytics-dashboards-plugin' branch or commit specified. + OVERRIDE_REFERENCE: '2.8' jobs: tests: name: Run Cypress E2E tests @@ -70,6 +74,19 @@ jobs: with: path: OpenSearch-Dashboards/plugins/security-analytics-dashboards-plugin + # This job replaces the package.json, opensearch_dashboards.json, and yarn.lock files from the + # 'opensearch-project/security-analytics-dashboards-plugin' branch or commit specified in env variable. + # This is most useful on the 'main' branch as it will enable us to specify which version to use for the build when + # one of this package's dependencies is not building reliably without having to adjust the actual version of this package. + - name: Override Package Version + if: ${{ env.OVERRIDE_REFERENCE != '' }} + run: | + cd OpenSearch-Dashboards/plugins/security-analytics-dashboards-plugin + git fetch --all + git checkout origin/${{ env.OVERRIDE_REFERENCE }} opensearch_dashboards.json + git checkout origin/${{ env.OVERRIDE_REFERENCE }} package.json + git checkout origin/${{ env.OVERRIDE_REFERENCE }} yarn.lock + - name: Setup Node uses: actions/setup-node@v3 with: