Skip to content
Closed
Show file tree
Hide file tree
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
16 changes: 10 additions & 6 deletions .github/workflows/external-message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ name: PR Comment
# DO NOT PULL THE PR OR EXECUTE ANY CODE FROM THE PR.

on:
pull_request_target:
types: [opened, reopened, synchronize]
branches:
- main
workflow_dispatch:

# Disable because of https://github.com/databricks/databricks-sdk-py/issues/848.
#
# pull_request_target:
# types: [opened, reopened, synchronize]
# branches:
# - main

jobs:
comment-on-pr:
Expand Down Expand Up @@ -44,13 +48,13 @@ jobs:
gh pr comment ${{ github.event.pull_request.number }} --body \
"<!-- INTEGRATION_TESTS_MANUAL -->
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
[go/deco-tests-run/sdk-py](https://go/deco-tests-run/sdk-py)

Inputs:
* PR number: ${{github.event.pull_request.number}}
* Commit SHA: \`${{ env.COMMIT_SHA }}\`

Checks will be approved automatically on success.
"
26 changes: 14 additions & 12 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: Integration Tests

on:
workflow_dispatch:

pull_request:
types: [opened, synchronize]

merge_group:

# Disable because of https://github.com/databricks/databricks-sdk-py/issues/848.
#
# pull_request:
# types: [opened, synchronize]
#
# merge_group:

jobs:
check-token:
Expand All @@ -26,14 +28,14 @@ jobs:
echo "DECO_WORKFLOW_TRIGGER_APP_ID is set. User has access to secrets."
echo "::set-output name=has_token::true"
fi

trigger-tests:
name: Trigger Tests
runs-on: ubuntu-latest
needs: check-token
if: github.event_name == 'pull_request' && needs.check-token.outputs.has_token == 'true'
environment: "test-trigger-is"

steps:
- uses: actions/checkout@v3

Expand All @@ -45,19 +47,19 @@ jobs:
private-key: ${{ secrets.DECO_WORKFLOW_TRIGGER_PRIVATE_KEY }}
owner: ${{ secrets.ORG_NAME }}
repositories: ${{secrets.REPO_NAME}}

- name: Trigger Workflow in Another Repo
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
gh workflow run sdk-py-isolated-pr.yml -R ${{ secrets.ORG_NAME }}/${{secrets.REPO_NAME}} \
--ref main \
-f pull_request_number=${{ github.event.pull_request.number }} \
-f commit_sha=${{ github.event.pull_request.head.sha }}
-f commit_sha=${{ github.event.pull_request.head.sha }}

# Statuses and checks apply to specific commits (by hash).
# Statuses and checks apply to specific commits (by hash).
# Enforcement of required checks is done both at the PR level and the merge queue level.
# In case of multiple commits in a single PR, the hash of the squashed commit
# In case of multiple commits in a single PR, the hash of the squashed commit
# will not match the one for the latest (approved) commit in the PR.
# We auto approve the check for the merge queue for two reasons:
# * Queue times out due to duration of tests.
Expand All @@ -75,4 +77,4 @@ jobs:
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/statuses/${{ github.sha }} \
-f 'state=success' \
-f 'context=Integration Tests Check'
-f 'context=Integration Tests Check'
Loading