From cd85d8af5960e13134039fbe90e9f85974fdf564 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 29 Jan 2026 14:52:17 +0100 Subject: [PATCH 1/2] Use Checks API for skipped integration tests PR #4268 migrated from Statuses API to Checks API for integration test reporting, but the skip/auto-approve paths still used the Statuses API with context "Integration Tests Check" instead of the Checks API with name "Integration Tests". This caused the required check to remain pending when integration tests were skipped. This change: - Updates push.yml to use Checks API for skip and merge queue cases - Consolidates merge queue handling in push.yml - Removes redundant auto-approve job from start-integration-tests.yml Co-Authored-By: Claude Opus 4.5 --- .github/workflows/push.yml | 58 +++++++++++++------ .github/workflows/start-integration-tests.yml | 33 ----------- 2 files changed, 39 insertions(+), 52 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 37f2a8fee7..640ebd3d4e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -369,6 +369,10 @@ jobs: group: databricks-deco-testing-runner-group labels: ubuntu-latest-deco + permissions: + checks: write + contents: read + environment: "test-trigger-is" steps: @@ -394,29 +398,45 @@ jobs: -f commit_sha=${{ github.event.pull_request.head.sha }} # Skip integration tests if the primary "test" target is not triggered by this change. + # Use Checks API (not Statuses API) to match the required "Integration Tests" check. - name: Skip integration tests (pull request) if: ${{ github.event_name == 'pull_request' && !contains(fromJSON(needs.testmask.outputs.targets), 'test') }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: |- - gh api -X POST -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \ - -f 'state=success' \ - -f 'context=Integration Tests Check' \ - -f 'description=⏭️ Skipped' - + uses: actions/github-script@v7 + with: + script: | + await github.rest.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: 'Integration Tests', + head_sha: '${{ github.event.pull_request.head.sha }}', + status: 'completed', + conclusion: 'success', + output: { + title: 'Integration Tests', + summary: '⏭️ Skipped (changes do not require integration tests)' + } + }); + + # Auto-approve for merge group since tests already passed on the PR. + # Use Checks API (not Statuses API) to match the required "Integration Tests" check. - name: Auto-approve for merge group if: ${{ github.event_name == 'merge_group' }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: |- - gh api -X POST -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/${{ github.repository }}/statuses/${{ github.sha }} \ - -f 'state=success' \ - -f 'context=Integration Tests Check' \ - -f 'description=⏭️ Skipped' + uses: actions/github-script@v7 + with: + script: | + await github.rest.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: 'Integration Tests', + head_sha: context.sha, + status: 'completed', + conclusion: 'success', + output: { + title: 'Integration Tests', + summary: '⏭️ Auto-approved for merge queue (tests already passed on PR)' + } + }); + - name: Trigger integration tests (push to main) if: ${{ github.event_name == 'push' }} diff --git a/.github/workflows/start-integration-tests.yml b/.github/workflows/start-integration-tests.yml index 99919beab9..74bfc90e64 100644 --- a/.github/workflows/start-integration-tests.yml +++ b/.github/workflows/start-integration-tests.yml @@ -2,45 +2,12 @@ name: start-integration-tests on: workflow_dispatch: - merge_group: jobs: - # Auto-approve integration tests for merge queue. - # The tests already passed on the PR, so we don't need to run them again. - auto-approve: - if: github.event_name == 'merge_group' - - runs-on: - group: databricks-deco-testing-runner-group - labels: ubuntu-latest-deco - - permissions: - checks: write - contents: read - - steps: - - name: Auto-approve Check for Merge Queue - uses: actions/github-script@v7 - with: - script: | - await github.rest.checks.create({ - owner: context.repo.owner, - repo: context.repo.repo, - name: 'Integration Tests', - head_sha: context.sha, - status: 'completed', - conclusion: 'success', - output: { - title: 'Integration Tests', - summary: 'Auto-approved for merge queue (tests already passed on PR)' - } - }); - # Trigger integration tests for PRs. # This workflow triggers the integration test workflow in a different repository. # It requires secrets from the "test-trigger-is" environment, which are only available to authorized users. trigger: - if: github.event_name == 'workflow_dispatch' runs-on: group: databricks-deco-testing-runner-group From 40e333c9e0fe05f0a7ba57f75c42220431b147df Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 29 Jan 2026 14:57:04 +0100 Subject: [PATCH 2/2] Format --- .github/workflows/push.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 640ebd3d4e..e3a6d319eb 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -437,7 +437,6 @@ jobs: } }); - - name: Trigger integration tests (push to main) if: ${{ github.event_name == 'push' }} env: