Skip to content
Open
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
25 changes: 22 additions & 3 deletions .github/workflows/bot_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,25 @@ jobs:
pull-requests: write
outputs:
comment_id: ${{ steps.comment.outputs.comment_id }}
authorized: ${{ steps.auth.outputs.authorized }}
steps:
- name: Authorize commenter
id: auth
env:
AUTHOR_ASSOCIATION: ${{ github.event.comment.author_association }}
ACTOR: ${{ github.actor }}
run: |
case "$AUTHOR_ASSOCIATION" in
OWNER|MEMBER|COLLABORATOR)
echo "authorized=true" >> "$GITHUB_OUTPUT"
;;
*)
echo "::error::User '${ACTOR}' (association: ${AUTHOR_ASSOCIATION}) is not authorized to trigger this workflow."
echo "authorized=false" >> "$GITHUB_OUTPUT"
exit 1
;;
esac

- name: Acknowledge with 👀
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -46,6 +64,7 @@ jobs:
gpu:
name: Run pytest on GPU
needs: gate
if: ${{ needs.gate.outputs.authorized == 'true' }}
# A newer command on the same PR supersedes an in-flight one. Scoped to this job
# only so the superseded run's `report` still updates its comment.
concurrency:
Expand Down Expand Up @@ -75,7 +94,7 @@ jobs:
shell: bash
steps:
- name: Checkout PR head
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Works for forks too — no fork credentials needed.
ref: refs/pull/${{ github.event.issue.number }}/head
Expand Down Expand Up @@ -116,7 +135,7 @@ jobs:

- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: bot_gpu_test_reports
path: reports
Expand All @@ -126,7 +145,7 @@ jobs:
needs: [gate, gpu]
# Always run so the comment is updated on success, failure, or cancellation —
# but only if `gate` actually posted a comment to update.
if: ${{ always() && needs.gate.outputs.comment_id != '' }}
if: ${{ always() && needs.gate.outputs.authorized == 'true' && needs.gate.outputs.comment_id != '' }}
runs-on: ubuntu-22.04
permissions:
pull-requests: write
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/claude_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:
pull_request_review_comment:
types: [created]

permissions:
contents: write
pull-requests: write
issues: read

permissions: {}

jobs:
claude-review:
permissions:
contents: write
issues: read
pull-requests: write
if: |
(
github.event_name == 'issue_comment' &&
Expand All @@ -34,7 +36,7 @@ jobs:
cancel-in-progress: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1

Expand Down
34 changes: 27 additions & 7 deletions .github/workflows/issue_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ on:
issues:
types: [opened]

permissions:
contents: read
issues: write

permissions: {}

jobs:
label:
permissions:
contents: read
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -22,7 +24,14 @@ jobs:
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_BODY: ${{ github.event.issue.body }}
run: |
LABELS=$(python utils/label_issues.py)
# Issue title/body are untrusted user input: bound their length before
# they are handed to the LLM. utils/label_issues.py must wrap them in a
# clearly delimited user-content block and instruct the model to never
# follow instructions contained inside that block.
ISSUE_TITLE=$(printf '%s' "$ISSUE_TITLE" | head -c 500)
ISSUE_BODY=$(printf '%s' "$ISSUE_BODY" | head -c 4000)
export ISSUE_TITLE ISSUE_BODY
LABELS=$(python utils/label_issues.py | tr -d '\r\n')
echo "labels=$LABELS" >> "$GITHUB_OUTPUT"
- name: Apply labels
if: steps.get-labels.outputs.labels != ''
Expand All @@ -31,6 +40,17 @@ jobs:
ISSUE_NUMBER: ${{ github.event.issue.number }}
LABELS: ${{ steps.get-labels.outputs.labels }}
run: |
for label in $(echo "$LABELS" | python -c "import json,sys; print('\n'.join(json.load(sys.stdin)))"); do
gh issue edit "$ISSUE_NUMBER" --add-label "$label"
done
# The model output is untrusted (it can be steered by the issue author).
# Validate every returned label against a fixed server-side allowlist
# before mutating the issue with the write-scoped token.
ALLOWED_LABELS=$'bug\nenhancement\ndocumentation\nquestion\nfeature request\ngood first issue\nhelp wanted'
printf '%s' "$LABELS" \
| python -c "import json,sys; data=json.load(sys.stdin); data=data if isinstance(data,list) else []; print('\n'.join(str(x) for x in data[:10]))" \
| while IFS= read -r label; do
[ -n "$label" ] || continue
if ! printf '%s\n' "$ALLOWED_LABELS" | grep -Fxq -- "$label"; then
echo "Skipping label not in allowlist: $label"
continue
fi
gh issue edit "$ISSUE_NUMBER" --add-label "$label"
done
4 changes: 2 additions & 2 deletions .github/workflows/mirror_community_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ jobs:
run: |
echo "CHECKOUT_REF: ${{ env.CHECKOUT_REF }}"
echo "PATH_IN_REPO: ${{ env.PATH_IN_REPO }}"
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.CHECKOUT_REF }}

# Setup + install dependencies
- name: Set up Python
uses: actions/setup-python@v7.0.0
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/notify_slack_about_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Python
uses: actions/setup-python@v7.0.0
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.10'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr_dependency_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
check_dependencies:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@v7.0.0
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"
- name: Install dependencies
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/pr_labeler.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
name: PR Labeler

on:
pull_request_target:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write

permissions: {}

jobs:
label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
with:
sync-labels: true

missing-tests:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -50,6 +55,9 @@ jobs:
fi

fixes-issue:
permissions:
issues: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Check for linked closing issues
Expand Down Expand Up @@ -85,6 +93,8 @@ jobs:
fi

size-label:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Label PR by diff size
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pr_modular_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
check_code_quality:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@v7.0.0
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"
- name: Install dependencies
Expand All @@ -64,9 +64,9 @@ jobs:
needs: check_code_quality
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@v7.0.0
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"
- name: Install dependencies
Expand All @@ -92,7 +92,7 @@ jobs:
container:
image: diffusers/diffusers-pytorch-cpu
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: |
printf 'torch==2.10.0\ntorchvision==0.25.0\ntorchaudio==2.10.0\n' > "$UV_OVERRIDE"
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:

steps:
- name: Checkout diffusers
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2

Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:

- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr_pytorch_pipelines_torch_cpu_modular_pipelines_test_reports
path: reports
12 changes: 6 additions & 6 deletions .github/workflows/pr_test_fetcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
test_map: ${{ steps.set_matrix.outputs.test_map }}
steps:
- name: Checkout diffusers
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Install dependencies
Expand All @@ -45,7 +45,7 @@ jobs:
run: |
python utils/tests_fetcher.py | tee test_preparation.txt
- name: Report fetched tests
uses: actions/upload-artifact@v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test_fetched
path: test_preparation.txt
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
shell: bash
steps:
- name: Checkout diffusers
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2

Expand All @@ -112,7 +112,7 @@ jobs:

- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.modules }}_test_reports
path: reports
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:

steps:
- name: Checkout diffusers
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2

Expand All @@ -167,7 +167,7 @@ jobs:

- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr_${{ matrix.config.report }}_test_reports
path: reports
Loading
Loading