sadpandajoe commented on code in PR #40719:
URL: https://github.com/apache/superset/pull/40719#discussion_r3351657922
##########
.github/workflows/superset-e2e.yml:
##########
@@ -269,3 +287,34 @@ jobs:
${{ github.workspace }}/superset-frontend/playwright-results/
${{ github.workspace }}/superset-frontend/test-results/
name: playwright-artifact-${{ github.run_id }}-${{ github.job }}-${{
matrix.browser }}--${{ steps.set-safe-app-root.outputs.safe_app_root }}
+
+ # workflow_run runs don't attach their checks to the originating PR, so post
+ # an aggregate commit status back onto the PR head SHA. Make THIS the
required
+ # status check in branch protection (in place of the individual E2E jobs).
+ report-status:
+ needs: [cypress-matrix, playwright-tests]
+ if: always() && github.event_name == 'workflow_run'
+ runs-on: ubuntu-24.04
+ permissions:
+ statuses: write
+ steps:
+ - name: Report aggregate E2E status to PR commit
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 #
v9.0.0
+ with:
+ script: |
+ // 'skipped' is acceptable: the change-detector legitimately skips
+ // jobs when no relevant files changed. Only real failures fail.
+ const results = [
+ '${{ needs.cypress-matrix.result }}',
+ '${{ needs.playwright-tests.result }}',
+ ];
+ const ok = results.every((r) => r === 'success' || r ===
'skipped');
+ await github.rest.repos.createCommitStatus({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ sha: context.payload.workflow_run.head_sha,
+ state: ok ? 'success' : 'failure',
+ context: 'E2E / required',
+ description: ok ? 'E2E passed (or skipped)' : 'E2E failed',
+ target_url:
`${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
+ });
Review Comment:
Right now when tests are skipped because pre-commit fails we'll land a
success. Is that what we want? Shouldn't be an issue since pre-commit is
required but just wondering.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]