Skip to content

SNOW-1720835 param protect thread-safe client side changes #48

SNOW-1720835 param protect thread-safe client side changes

SNOW-1720835 param protect thread-safe client side changes #48

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