Merge pull request #2245 from rossoctl/fix/bump-operator-chart-alpha9 #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # OpenShell PoC E2E Tests (HyperShift) | |
| # | |
| # Experimental, non-voting workflow for the OpenShell PoC on HyperShift. | |
| # Triggered by /run-e2e-openshell comment on PRs or manual dispatch. | |
| # | |
| # Uses the unified openshell-full-test.sh script with --platform ocp. | |
| # | |
| # Note: LLM-dependent tests skip without .env.maas credentials. | |
| # Custom agent images (ADK, Claude SDK) need Shipwright builds on OCP. | |
| # The weather agent uses a public ghcr.io image and works without builds. | |
| # | |
| name: "[Experimental] E2E OpenShell (HyperShift)" | |
| on: | |
| issue_comment: | |
| types: [created] | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'deployments/openshell/**' | |
| - 'charts/openshell/**' | |
| - 'scripts/openshell/**' | |
| - 'rossoctl/tests/e2e/openshell/**' | |
| - '.github/scripts/local-setup/openshell-full-test.sh' | |
| - '.github/workflows/e2e-openshell-hypershift.yaml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'deployments/openshell/**' | |
| - 'charts/openshell/**' | |
| - 'scripts/openshell/**' | |
| - 'rossoctl/tests/e2e/openshell/**' | |
| - '.github/scripts/local-setup/openshell-full-test.sh' | |
| - '.github/workflows/e2e-openshell-hypershift.yaml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| OCP_VERSION: '4.20.11' | |
| jobs: | |
| authorize: | |
| name: Authorize | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| github.event_name == 'push' || | |
| github.event_name == 'pull_request' || | |
| (github.event.issue.pull_request && | |
| startsWith(github.event.comment.body, '/run-e2e-openshell')) | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| outputs: | |
| authorized: ${{ steps.check.outputs.has-permission }} | |
| pr_number: ${{ steps.pr-info.outputs.number }} | |
| pr_sha: ${{ steps.pr-info.outputs.sha }} | |
| cluster_suffix: ${{ steps.pr-info.outputs.cluster_suffix }} | |
| steps: | |
| - name: Check write permission | |
| id: check | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| script: | | |
| if (context.eventName === 'workflow_dispatch' || context.eventName === 'push' || context.eventName === 'pull_request') { | |
| core.setOutput('has-permission', 'true'); | |
| return; | |
| } | |
| const { data } = await github.rest.repos.getCollaboratorPermissionLevel({ | |
| owner: context.repo.owner, repo: context.repo.repo, | |
| username: context.payload.comment.user.login | |
| }); | |
| const ok = ['admin', 'write'].includes(data.permission); | |
| core.setOutput('has-permission', ok.toString()); | |
| if (!ok) core.setFailed(`No write permission: ${data.permission}`); | |
| - name: Get PR info | |
| id: pr-info | |
| if: steps.check.outputs.has-permission == 'true' && github.event_name != 'workflow_dispatch' && github.event_name != 'push' | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| script: | | |
| let prNumber, prSha; | |
| if (context.eventName === 'pull_request') { | |
| prNumber = context.payload.pull_request.number; | |
| prSha = context.payload.pull_request.head.sha; | |
| } else { | |
| const { data: pr } = await github.rest.pulls.get({ | |
| owner: context.repo.owner, repo: context.repo.repo, | |
| pull_number: context.issue.number | |
| }); | |
| prNumber = pr.number; | |
| prSha = pr.head.sha; | |
| } | |
| core.setOutput('number', prNumber); | |
| core.setOutput('sha', prSha); | |
| core.setOutput('cluster_suffix', `ospr${prNumber}`); | |
| - name: React with rocket | |
| if: steps.check.outputs.has-permission == 'true' && github.event_name == 'issue_comment' | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| script: | | |
| await github.rest.reactions.createForIssueComment({ | |
| owner: context.repo.owner, repo: context.repo.repo, | |
| comment_id: context.payload.comment.id, content: 'rocket' | |
| }); | |
| e2e-openshell: | |
| name: OpenShell PoC (HyperShift) | |
| runs-on: ubuntu-latest | |
| needs: authorize | |
| if: needs.authorize.outputs.authorized == 'true' && github.event_name != 'pull_request' | |
| # Runs on: issue_comment (/run-e2e-openshell), push (post-merge), workflow_dispatch | |
| # Skips on: pull_request (visibility only — too expensive for every PR push) | |
| timeout-minutes: 120 | |
| continue-on-error: true | |
| outputs: | |
| test_outcome: ${{ steps.run-tests.outcome }} | |
| env: | |
| CLUSTER_SUFFIX: ${{ needs.authorize.outputs.cluster_suffix || 'osmanual' }} | |
| MANAGED_BY_TAG: ${{ secrets.MANAGED_BY_TAG }} | |
| steps: | |
| - name: Checkout PR code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| ref: ${{ needs.authorize.outputs.pr_sha || github.sha }} | |
| - name: Set up Python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| - name: Install tools (kubectl, Helm, oc, hcp) | |
| run: | | |
| bash .github/scripts/hypershift/ci/20-install-tools.sh | |
| bash .github/scripts/common/10-setup-dependencies.sh | |
| uv pip install --system boto3==1.43.6 botocore==1.43.6 | |
| - name: Install Helm v3 | |
| uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 | |
| with: | |
| version: 'v3.17.0' | |
| - name: Setup Go (for hcp CLI) | |
| uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 | |
| with: | |
| go-version: '1.24' | |
| cache: false | |
| - name: Build hcp CLI | |
| run: bash .github/scripts/hypershift/ci/30-build-hcp-cli.sh | |
| - name: Clone hypershift-automation | |
| run: bash .github/scripts/hypershift/ci/40-clone-hypershift-automation.sh | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| - name: Install dependencies | |
| run: uv sync --frozen | |
| - name: Setup credentials | |
| run: bash .github/scripts/hypershift/ci/10-setup-credentials.sh | |
| env: | |
| HYPERSHIFT_MGMT_KUBECONFIG: ${{ secrets.HYPERSHIFT_MGMT_KUBECONFIG }} | |
| PULL_SECRET: ${{ secrets.PULL_SECRET }} | |
| - name: Run OpenShell full test (HyperShift) | |
| id: run-tests | |
| run: | | |
| ./.github/scripts/local-setup/openshell-full-test.sh \ | |
| --platform ocp \ | |
| --skip-cluster-destroy \ | |
| "${{ env.CLUSTER_SUFFIX }}" | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| BASE_DOMAIN: ${{ secrets.BASE_DOMAIN }} | |
| HCP_ROLE_NAME: ${{ secrets.HCP_ROLE_NAME }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| GITHUB_TOKEN: ${{ github.token }} | |
| OPENSHELL_LLM_MODELS: "Qwen3.6-35B-A3B" | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: openshell-hypershift-e2e-results | |
| path: test-results/ | |
| cleanup: | |
| name: Cleanup | |
| runs-on: ubuntu-latest | |
| needs: [authorize, e2e-openshell] | |
| if: always() && needs.authorize.outputs.authorized == 'true' && github.event_name != 'pull_request' | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Setup credentials | |
| run: bash .github/scripts/hypershift/ci/10-setup-credentials.sh | |
| env: | |
| HYPERSHIFT_MGMT_KUBECONFIG: ${{ secrets.HYPERSHIFT_MGMT_KUBECONFIG }} | |
| MANAGED_BY_TAG: ${{ secrets.MANAGED_BY_TAG }} | |
| PULL_SECRET: ${{ secrets.PULL_SECRET }} | |
| - name: Install tools | |
| run: bash .github/scripts/hypershift/ci/20-install-tools.sh | |
| - name: Setup Go | |
| uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 | |
| with: | |
| go-version: '1.24' | |
| cache: false | |
| - name: Build hcp CLI | |
| run: bash .github/scripts/hypershift/ci/30-build-hcp-cli.sh | |
| - name: Clone hypershift-automation | |
| run: bash .github/scripts/hypershift/ci/40-clone-hypershift-automation.sh | |
| - name: Destroy cluster | |
| run: bash .github/scripts/hypershift/ci/55-cleanup-existing-cluster.sh | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| MANAGED_BY_TAG: ${{ secrets.MANAGED_BY_TAG }} | |
| HCP_ROLE_NAME: ${{ secrets.HCP_ROLE_NAME }} | |
| CLUSTER_SUFFIX: ${{ needs.authorize.outputs.cluster_suffix || 'osmanual' }} | |
| post-results: | |
| name: Post Results | |
| runs-on: ubuntu-latest | |
| needs: [authorize, e2e-openshell] | |
| if: always() && needs.authorize.outputs.authorized == 'true' && github.event_name == 'issue_comment' | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Post result comment | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| script: | | |
| const outcome = '${{ needs.e2e-openshell.outputs.test_outcome }}' || 'failure'; | |
| const passed = outcome === 'success'; | |
| const emoji = passed ? '✅' : '❌'; | |
| const status = passed ? 'Passed' : 'Failed'; | |
| const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, repo: context.repo.repo, | |
| issue_number: ${{ needs.authorize.outputs.pr_number }}, | |
| body: `### ${emoji} [Experimental] OpenShell E2E Tests (HyperShift) ${status}\n\n**Commit:** \`${{ needs.authorize.outputs.pr_sha }}\`\n**Workflow:** [View logs](${runUrl})\n\n---\n<sub>Non-voting. Re-run: \`/run-e2e-openshell\`</sub>` | |
| }); |