SNOW-1546090 add merge gate for future thread safe updates #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Threadsafe Check | |
on: | |
pull_request: | |
types: [opened, synchronize, labeled, unlabeled, edited] | |
jobs: | |
check_threadsafety: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check for modified files | |
id: changed_files | |
run: | | |
echo "changed_files=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)" >> $GITHUB_OUTPUT | |
- name: Verify threadsafety acknowledgement | |
run: | | |
CHANGED_FILES="${{ steps.changed_files.outputs.changed_files }}" | |
# Check if changed files are in snowpark/_internal, snowpark/mock, or snowpark/*.py. We exclude snowpark/modin in this check. | |
if echo "$CHANGED_FILES" | grep -qE '(src/snowflake/snowpark/_internal|src/snowflake/snowpark/mock|src/snowflake/snowpark/[^/]+\.py)'; then | |
echo "Checking PR description for thread-safety acknowledgment..." | |
if [[ "${{ github.event.pull_request.body }}" != *"[x] I acknowledge that I have ensured my changes to be thread-safe"* ]]; then | |
echo "Thread-safety acknowledgment not found in PR description." | |
echo "Please acknowledge the threadsafety implications of your changes by adding '[x] I acknowledge that I have ensured my changes to be thread-safe' to the PR description." | |
exit 1 | |
else | |
echo "Thread-safety acknowledgment found in PR description." | |
fi | |
else | |
echo "No critical files modified; skipping threadsafety check." | |
fi |