Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 70 additions & 5 deletions .github/workflows/trigger-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ name: Trigger Integration Tests

on:
pull_request:
types: [opened, synchronize, reopened, labeled]
types: [opened, synchronize, reopened, labeled, closed]
merge_group:

jobs:
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
});

skip-integration-tests-pr:
if: github.event_name == 'pull_request' && github.event.action != 'labeled'
if: github.event_name == 'pull_request' && github.event.action != 'labeled' && github.event.action != 'closed'
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
Expand Down Expand Up @@ -175,7 +175,8 @@ jobs:
"pr_repo": "${{ github.repository }}",
"pr_url": "${{ github.event.pull_request.html_url }}",
"pr_title": "${{ steps.sanitize.outputs.result }}",
"pr_author": "${{ github.event.pull_request.user.login }}"
"pr_author": "${{ github.event.pull_request.user.login }}",
"proxy_mode": "replay"
}

- name: Fail check on dispatch error
Expand Down Expand Up @@ -207,7 +208,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: 'Node.js integration tests triggered. [View workflow run](https://github.com/databricks/databricks-driver-test/actions/workflows/databricks-nodejs-integration-tests.yml).'
body: 'Node.js integration tests triggered. [View workflow runs](https://github.com/databricks/databricks-driver-test/actions/workflows/databricks-sql-nodejs-integration-tests.yml). The result posts back here as the "Node.js Integration Tests" check.'
});

merge-queue-nodejs:
Expand Down Expand Up @@ -270,7 +271,8 @@ jobs:
"pr_repo": "${{ github.repository }}",
"pr_url": "${{ github.server_url }}/${{ github.repository }}/pull/${{ steps.extract-pr.outputs.pr_number }}",
"pr_title": "Merge queue validation",
"pr_author": "merge-queue"
"pr_author": "merge-queue",
"proxy_mode": "replay"
}

- name: Fail check on dispatch error
Expand All @@ -292,3 +294,66 @@ jobs:
summary: 'An error occurred while dispatching Node.js integration tests. Check this workflow run for details.'
}
});

# =============================================================================
# After merge: trigger the multi-language coverage fan-out.
# Fires when a PR lands on main (merge queue or direct merge) and touched
# driver source. Dispatches `coverage-fanout` to databricks-driver-test, whose
# coverage-fanout-tracker.yml opens a tracking issue and runs the
# language-agnostic fan-out (a spec authored from THIS PR's diff, conformed as
# tests across every driver) as peco-engineer-bot.
# =============================================================================
trigger-coverage-fanout:
if: |
github.event_name == 'pull_request' &&
github.event.action == 'closed' &&
github.event.pull_request.merged == true &&
github.event.pull_request.base.ref == 'main'
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- name: Check if driver source changed
id: changed
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
with:
script: |
const files = await github.paginate(github.rest.pulls.listFiles, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
per_page: 100,
});
// The whole repo IS the driver. Count a merge as source-affecting when it changes driver
// source: lib/ (JS/TS), native/ (kernel bindings), thrift/ (Thrift defs), or the KERNEL_REV
// pin. Docs/CI/test-only merges do not warrant a full multi-language fan-out. (Matches the
// source roots called out in the "run on every change" comments above — a merge that only
// bumps KERNEL_REV or edits native/ or thrift/ still affects the Thrift/kernel backends.)
const isSource = (f) =>
f.startsWith('lib/') || f.startsWith('native/') || f.startsWith('thrift/') || f === 'KERNEL_REV';
const srcChanged = files.some((f) => isSource(f.filename));
console.log(`driver source changed: ${srcChanged}`);
core.setOutput('source', srcChanged.toString());

- name: Generate GitHub App token (databricks-driver-test)
if: steps.changed.outputs.source == 'true'
id: app-token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
with:
app-id: ${{ secrets.INTEGRATION_TEST_APP_ID }}
private-key: ${{ secrets.INTEGRATION_TEST_PRIVATE_KEY }}
owner: databricks
repositories: databricks-driver-test
permission-contents: write

- name: Dispatch coverage-fanout
if: steps.changed.outputs.source == 'true'
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
with:
token: ${{ steps.app-token.outputs.token }}
repository: databricks/databricks-driver-test
event-type: coverage-fanout
client-payload: '{"reference_repo": "${{ github.repository }}", "pr_number": "${{ github.event.pull_request.number }}", "pr_url": "${{ github.event.pull_request.html_url }}"}'
Loading