Skip to content

Commit 965d08b

Browse files
Re-enable integration test trigger and route cross-org dispatch through emu-access (#5034)
## Summary - Reverts the intent of #4899 (temporary stub) and restores automatic integration test triggering. The original PR could not simply be reverted (as initially intended) because of the new distinction between runners with cross-org access and ones with same-org access. - Both upstream blockers are now resolved: - **eng-dev-ecosystem side:** [databricks-eng/eng-dev-ecosystem#1252](https://github.com/databricks-eng/eng-dev-ecosystem/pull/1252?timeline_per_page=5) moved `mark-as-pending` / `mark-as-success` / `mark-as-failure` onto `linux-ubuntu-latest-ghec-access` runners so cross-org check-run writes no longer 403 on the `databricks` org allowlist. - **CLI side (this PR):** the cross-org `gh workflow run` dispatch is moved onto `linux-ubuntu-latest-emu-access`, following the pattern from databricks/databricks-sdk-go#1638, so it no longer 403s on the `databricks-eng` org allowlist. - The job is split in two: - `integration-trigger` (deco runners) handles same-org `Integration Tests` check writes for the PR-skip and merge-group-auto-approve paths, using the `DECO_TEST_APPROVAL` app token. Testmask-based gating and the pre-#4899 summaries (`Skipped (changes do not require integration tests)` / `Auto-approved for merge queue (tests already passed on PR)`) are restored. - `trigger-tests` (emu-access runners) mints the `DECO_WORKFLOW_TRIGGER` token and issues the cross-org `gh workflow run cli-isolated-pr.yml` / `cli-isolated-nightly.yml` dispatches. - `integration-trigger-dependabot` is unchanged. NO_CHANGELOG=true ## Test plan - [x] On this PR, confirm `integration-trigger` runs on `databricks-deco-testing-runner-group` and succeeds. - [x] Confirm `trigger-tests` runs on `databricks-release-runner-group-emu-access`; `Generate GitHub App Token` step succeeds (no 403); `Trigger integration tests (pull request)` dispatches `cli-isolated-pr.yml` on `databricks-eng/eng-dev-ecosystem` with `pull_request_number` and `commit_sha` inputs. - [x] On `databricks-eng/eng-dev-ecosystem`, confirm the dispatched `cli-isolated-pr` run appears (event: `workflow_dispatch`) and its `checkout` job uploads the `update-check-action` and `gh-report-action` artifacts. - [x] Confirm `mark-as-pending` runs on `linux-ubuntu-latest-ghec-access` and updates the `Integration Tests` check on the PR commit to `in_progress`. - [x] When the `integration-tests-prod` matrix finishes, confirm `mark-as-success` / `mark-as-failure` updates the check to `success` / `failure`. (Known separate issue: `integration-tests-prod` on `main` has been failing due to a Go 1.25.9 toolchain fetch against `proxy.golang.org`; that is out of scope here.) - [ ] Merge-queue path: after ready-for-merge, confirm `integration-trigger` writes the `Auto-approved for merge queue (tests already passed on PR)` check. - [ ] Push-to-main path: after merge, confirm a `workflow_dispatch` run of `cli-isolated-nightly.yml` appears on eng-dev-ecosystem keyed to the merge commit SHA. This pull request and its description were written by Isaac.
1 parent 45688a4 commit 965d08b

1 file changed

Lines changed: 83 additions & 7 deletions

File tree

.github/workflows/push.yml

Lines changed: 83 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,25 +376,50 @@ jobs:
376376
exit 1
377377
fi
378378
379-
# Skip integration tests (temporarily disabled).
380-
# Creates a passing check for PRs and auto-approves for merge groups.
379+
# Trigger integration tests in a separate repository.
380+
# Writes the same-org "Integration Tests" check run for skip/auto-approve
381+
# paths on deco runners. The cross-org `gh workflow run` dispatch is split
382+
# into the sibling `trigger-tests` job so it can run on emu-access runners
383+
# that are allowlisted in the databricks-eng org.
381384
integration-trigger:
385+
needs:
386+
- testmask
387+
382388
if: >-
383389
(github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]') ||
384390
(github.event_name == 'merge_group')
385391
386392
runs-on:
387-
group: databricks-protected-runner-group-large
388-
labels: linux-ubuntu-latest-large
393+
group: databricks-deco-testing-runner-group
394+
labels: ubuntu-latest-deco
389395

390396
permissions:
391397
checks: write
398+
contents: read
399+
400+
environment: "test-trigger-is"
392401

393402
steps:
403+
- name: Generate GitHub App Token (check runs)
404+
if: >-
405+
(github.event_name == 'merge_group') ||
406+
(github.event_name == 'pull_request' && !contains(fromJSON(needs.testmask.outputs.targets), 'test') && !contains(fromJSON(needs.testmask.outputs.targets), 'test-exp-ssh'))
407+
id: generate-check-token
408+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
409+
with:
410+
app-id: ${{ secrets.DECO_TEST_APPROVAL_APP_ID }}
411+
private-key: ${{ secrets.DECO_TEST_APPROVAL_PRIVATE_KEY }}
412+
# DECO_TEST_APPROVAL is installed on the databricks org (not databricks-eng).
413+
owner: databricks
414+
repositories: cli
415+
416+
# Skip integration tests if the primary "test" target is not triggered by this change.
417+
# Use Checks API (not Statuses API) to match the required "Integration Tests" check.
394418
- name: Skip integration tests (pull request)
395-
if: ${{ github.event_name == 'pull_request' }}
419+
if: ${{ github.event_name == 'pull_request' && !contains(fromJSON(needs.testmask.outputs.targets), 'test') && !contains(fromJSON(needs.testmask.outputs.targets), 'test-exp-ssh') }}
396420
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
397421
with:
422+
github-token: ${{ steps.generate-check-token.outputs.token }}
398423
script: |
399424
await github.rest.checks.create({
400425
owner: context.repo.owner,
@@ -405,14 +430,16 @@ jobs:
405430
conclusion: 'success',
406431
output: {
407432
title: 'Integration Tests',
408-
summary: '⏭️ Skipped (integration test trigger is temporarily disabled)'
433+
summary: '⏭️ Skipped (changes do not require integration tests)'
409434
}
410435
});
411436
437+
# Auto-approve for merge group since tests already passed on the PR.
412438
- name: Auto-approve for merge group
413439
if: ${{ github.event_name == 'merge_group' }}
414440
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
415441
with:
442+
github-token: ${{ steps.generate-check-token.outputs.token }}
416443
script: |
417444
await github.rest.checks.create({
418445
owner: context.repo.owner,
@@ -423,10 +450,59 @@ jobs:
423450
conclusion: 'success',
424451
output: {
425452
title: 'Integration Tests',
426-
summary: '⏭️ Skipped (integration test trigger is temporarily disabled)'
453+
summary: '⏭️ Auto-approved for merge queue (tests already passed on PR)'
427454
}
428455
});
429456
457+
# Cross-org dispatch to databricks-eng/eng-dev-ecosystem. Must run on an
458+
# emu-access runner because the databricks-eng org IP-allowlists only the
459+
# release runner group, not deco. See databricks/databricks-sdk-go#1638.
460+
trigger-tests:
461+
needs:
462+
- testmask
463+
464+
if: >-
465+
(github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' && (contains(fromJSON(needs.testmask.outputs.targets), 'test') || contains(fromJSON(needs.testmask.outputs.targets), 'test-exp-ssh'))) ||
466+
(github.event_name == 'push')
467+
468+
runs-on:
469+
group: databricks-release-runner-group-emu-access
470+
labels: linux-ubuntu-latest-emu-access
471+
472+
permissions:
473+
contents: read
474+
475+
environment: "test-trigger-is"
476+
477+
steps:
478+
- name: Generate GitHub App Token
479+
id: generate-token
480+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
481+
with:
482+
app-id: ${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }}
483+
private-key: ${{ secrets.DECO_WORKFLOW_TRIGGER_PRIVATE_KEY }}
484+
owner: ${{ secrets.ORG_NAME }}
485+
repositories: ${{ secrets.REPO_NAME }}
486+
487+
- name: Trigger integration tests (pull request)
488+
if: ${{ github.event_name == 'pull_request' }}
489+
env:
490+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
491+
run: |-
492+
gh workflow run cli-isolated-pr.yml -R ${{ secrets.ORG_NAME }}/${{ secrets.REPO_NAME }} \
493+
--ref main \
494+
-f pull_request_number=${{ github.event.pull_request.number }} \
495+
-f commit_sha=${{ github.event.pull_request.head.sha }}
496+
497+
- name: Trigger integration tests (push to main)
498+
if: ${{ github.event_name == 'push' }}
499+
env:
500+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
501+
run: |-
502+
gh workflow run cli-isolated-nightly.yml -R ${{ secrets.ORG_NAME }}/${{ secrets.REPO_NAME }} \
503+
--ref main \
504+
-f commit_sha=${{ github.event.after }}
505+
430506
# Skip integration tests for dependabot PRs.
431507
# Dependabot has no access to the "test-trigger-is" environment secrets,
432508
# so we use the built-in GITHUB_TOKEN to mark the required "Integration

0 commit comments

Comments
 (0)