Skip to content

Commit 347ffd3

Browse files
Re-enable integration test trigger and route cross-org dispatch through emu-access
Reverts the intent of #4899 (temporary stub) now that both blockers are resolved: the eng-dev-ecosystem `mark-as-*` jobs moved onto ghec-access runners in databricks-eng/eng-dev-ecosystem#1252, and this change moves the cross-org `gh workflow run` dispatch onto `linux-ubuntu-latest-emu-access` following the pattern from databricks/databricks-sdk-go#1638 so the call is no longer 403'd by the databricks-eng org IP allowlist. Restores the pre-#4899 behavior in `push.yml`: - PRs dispatch `cli-isolated-pr.yml`; pushes to `main` dispatch `cli-isolated-nightly.yml`. - The required `Integration Tests` check is updated by the eng-dev-ecosystem `mark-as-*` jobs (in_progress → success/failure) instead of being fake-stamped. - Testmask-based skip/auto-approve paths are restored with their original summaries. Split into two jobs: - `integration-trigger` (deco runners) writes same-org Skip/Auto-approve checks via the DECO_TEST_APPROVAL token. - `trigger-tests` (emu-access runners) mints the DECO_WORKFLOW_TRIGGER token and does the cross-org `gh workflow run` dispatch. NO_CHANGELOG=true Co-authored-by: Isaac
1 parent a698cdc commit 347ffd3

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@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.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@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.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)