From 7f48ef8744932f68664e71dba2a9ea58cf75b294 Mon Sep 17 00:00:00 2001 From: openhands Date: Mon, 13 Apr 2026 14:30:26 +0000 Subject: [PATCH] Remove redundant 'Apply workflow_dispatch overrides' step from build workflows Replace hardcoded env defaults with `${{ inputs.X || 'default' }}` expressions so both workflow_dispatch and pull_request_target triggers work without a separate override step. For pull_request_target events, inputs are empty so the fallback applies. For workflow_dispatch events, the input value is used directly. Also removes unused env vars (BUILD_BATCH_SIZE, BUILDKIT_PRUNE_KEEP_GB, BUILDKIT_PRUNE_THRESHOLD_PCT) from workflows where they were defined but never referenced. Fixes #565 Co-authored-by: openhands --- .github/workflows/build-commit0-images.yml | 26 +++++--------- .../workflows/build-multiswebench-images.yml | 34 ++++++------------- .github/workflows/build-swebench-images.yml | 28 +++++---------- .../build-swebenchmultimodal-images.yml | 28 +++++---------- .github/workflows/build-swegym-images.yml | 31 +++++------------ .github/workflows/build-swesmith-images.yml | 32 ++++++----------- 6 files changed, 56 insertions(+), 123 deletions(-) diff --git a/.github/workflows/build-commit0-images.yml b/.github/workflows/build-commit0-images.yml index 6eee64842..d2cebd320 100644 --- a/.github/workflows/build-commit0-images.yml +++ b/.github/workflows/build-commit0-images.yml @@ -60,13 +60,16 @@ on: default: 'false' type: string +# Resolve inputs with fallback defaults so both workflow_dispatch and +# pull_request_target triggers work without a separate override step. +# INSTANCE_IDS/SELECT_FILE must be initialized for set -euo pipefail. env: - DATASET: wentingzhao/commit0_combined - SPLIT: test - REPO_SPLIT: lite - MAX_WORKERS: '4' - N_LIMIT: '' - INSTANCE_IDS: '' + DATASET: ${{ inputs.dataset || 'wentingzhao/commit0_combined' }} + SPLIT: ${{ inputs.split || 'test' }} + REPO_SPLIT: ${{ inputs.repo-split || 'lite' }} + MAX_WORKERS: ${{ inputs.max-workers || '4' }} + N_LIMIT: ${{ inputs.n-limit || '' }} + INSTANCE_IDS: ${{ inputs.instance-ids || '' }} SELECT_FILE: '' concurrency: @@ -108,17 +111,6 @@ jobs: ref: ${{ steps.checkout-ref.outputs.ref }} submodules: recursive - - name: Apply workflow_dispatch overrides (if any) - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - if [ -n "${{ inputs.dataset }}" ]; then echo "DATASET=${{ inputs.dataset }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.split }}" ]; then echo "SPLIT=${{ inputs.split }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.repo-split }}" ]; then echo "REPO_SPLIT=${{ inputs.repo-split }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.max-workers }}" ]; then echo "MAX_WORKERS=${{ inputs.max-workers }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.n-limit }}" ]; then echo "N_LIMIT=${{ inputs.n-limit }}" >> "$GITHUB_ENV"; else echo "N_LIMIT=" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.instance-ids }}" ]; then echo "INSTANCE_IDS=${{ inputs.instance-ids }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.sdk-commit }}" ]; then echo "SDK_COMMIT=${{ inputs.sdk-commit }}" >> "$GITHUB_ENV"; fi - - uses: ./.github/actions/build-select-file with: instance-ids: ${{ env.INSTANCE_IDS }} diff --git a/.github/workflows/build-multiswebench-images.yml b/.github/workflows/build-multiswebench-images.yml index c60806088..74f940e89 100644 --- a/.github/workflows/build-multiswebench-images.yml +++ b/.github/workflows/build-multiswebench-images.yml @@ -61,19 +61,18 @@ on: default: 'false' type: string -# Defaults for automatic runs; keep INSTANCE_IDS/SELECT_FILE initialized so set -euo pipefail won't fail on unset vars. +# Resolve inputs with fallback defaults so both workflow_dispatch and +# pull_request_target triggers work without a separate override step. +# INSTANCE_IDS/SELECT_FILE must be initialized for set -euo pipefail. env: - DATASET: bytedance-research/Multi-SWE-Bench - SPLIT: test - LANGUAGE: java - MAX_WORKERS: '12' - MAX_RETRIES: '2' - N_LIMIT: '50' - INSTANCE_IDS: '' + DATASET: ${{ inputs.dataset || 'bytedance-research/Multi-SWE-Bench' }} + SPLIT: ${{ inputs.split || 'test' }} + LANGUAGE: ${{ inputs.language || 'java' }} + MAX_WORKERS: ${{ inputs.max-workers || '12' }} + MAX_RETRIES: ${{ inputs.max-retries || '2' }} + N_LIMIT: ${{ inputs.n-limit || '50' }} + INSTANCE_IDS: ${{ inputs.instance-ids || '' }} SELECT_FILE: '' - BUILD_BATCH_SIZE: '15' - BUILDKIT_PRUNE_KEEP_GB: '60' - BUILDKIT_PRUNE_THRESHOLD_PCT: '60' concurrency: group: build-multiswebench-${{ github.ref }} @@ -121,19 +120,6 @@ jobs: ref: ${{ steps.checkout-ref.outputs.ref }} submodules: recursive - # If this was a manual dispatch, override defaults with provided inputs. - - name: Apply workflow_dispatch overrides (if any) - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - if [ -n "${{ inputs.dataset }}" ]; then echo "DATASET=${{ inputs.dataset }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.split }}" ]; then echo "SPLIT=${{ inputs.split }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.language }}" ]; then echo "LANGUAGE=${{ inputs.language }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.max-workers }}" ]; then echo "MAX_WORKERS=${{ inputs.max-workers }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.max-retries }}" ]; then echo "MAX_RETRIES=${{ inputs.max-retries }}" >> "$GITHUB_ENV"; fi - # Empty string means "no limit" - if [ -n "${{ inputs.n-limit }}" ]; then echo "N_LIMIT=${{ inputs.n-limit }}" >> "$GITHUB_ENV"; else echo "N_LIMIT=" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.instance-ids }}" ]; then echo "INSTANCE_IDS=${{ inputs.instance-ids }}" >> "$GITHUB_ENV"; fi - # Set N_LIMIT based on the label that triggered the workflow - name: Set N_LIMIT based on label if: ${{ github.event_name == 'pull_request_target' }} diff --git a/.github/workflows/build-swebench-images.yml b/.github/workflows/build-swebench-images.yml index e2cad2430..9c8aba6b8 100644 --- a/.github/workflows/build-swebench-images.yml +++ b/.github/workflows/build-swebench-images.yml @@ -65,14 +65,16 @@ on: default: 'default' type: string -# Defaults for automatic runs; keep INSTANCE_IDS/SELECT_FILE initialized so set -euo pipefail won't fail on unset vars. +# Resolve inputs with fallback defaults so both workflow_dispatch and +# pull_request_target triggers work without a separate override step. +# INSTANCE_IDS/SELECT_FILE must be initialized for set -euo pipefail. env: - DATASET: princeton-nlp/SWE-bench_Verified - SPLIT: test - MAX_WORKERS: '12' - MAX_RETRIES: '2' - N_LIMIT: '500' - INSTANCE_IDS: '' + DATASET: ${{ inputs.dataset || 'princeton-nlp/SWE-bench_Verified' }} + SPLIT: ${{ inputs.split || 'test' }} + MAX_WORKERS: ${{ inputs.max-workers || '12' }} + MAX_RETRIES: ${{ inputs.max-retries || '2' }} + N_LIMIT: ${{ inputs.n-limit || '500' }} + INSTANCE_IDS: ${{ inputs.instance-ids || '' }} SELECT_FILE: '' concurrency: @@ -121,18 +123,6 @@ jobs: ref: ${{ steps.checkout-ref.outputs.ref }} submodules: recursive - # If this was a manual dispatch, override defaults with provided inputs. - - name: Apply workflow_dispatch overrides (if any) - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - if [ -n "${{ inputs.dataset }}" ]; then echo "DATASET=${{ inputs.dataset }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.split }}" ]; then echo "SPLIT=${{ inputs.split }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.max-workers }}" ]; then echo "MAX_WORKERS=${{ inputs.max-workers }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.max-retries }}" ]; then echo "MAX_RETRIES=${{ inputs.max-retries }}" >> "$GITHUB_ENV"; fi - # Empty string means "no limit" - if [ -n "${{ inputs.n-limit }}" ]; then echo "N_LIMIT=${{ inputs.n-limit }}" >> "$GITHUB_ENV"; else echo "N_LIMIT=" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.instance-ids }}" ]; then echo "INSTANCE_IDS=${{ inputs.instance-ids }}" >> "$GITHUB_ENV"; fi - # Set N_LIMIT based on the label that triggered the workflow - name: Set N_LIMIT based on label if: ${{ github.event_name == 'pull_request_target' }} diff --git a/.github/workflows/build-swebenchmultimodal-images.yml b/.github/workflows/build-swebenchmultimodal-images.yml index 4885a1d43..0c77e888a 100644 --- a/.github/workflows/build-swebenchmultimodal-images.yml +++ b/.github/workflows/build-swebenchmultimodal-images.yml @@ -60,14 +60,16 @@ on: default: 'false' type: string -# Defaults for automatic runs; keep INSTANCE_IDS/SELECT_FILE initialized so set -euo pipefail won't fail on unset vars. +# Resolve inputs with fallback defaults so both workflow_dispatch and +# pull_request_target triggers work without a separate override step. +# INSTANCE_IDS/SELECT_FILE must be initialized for set -euo pipefail. env: - DATASET: princeton-nlp/SWE-bench_Multimodal - SPLIT: dev - MAX_WORKERS: '12' - MAX_RETRIES: '2' - N_LIMIT: '500' - INSTANCE_IDS: '' + DATASET: ${{ inputs.dataset || 'princeton-nlp/SWE-bench_Multimodal' }} + SPLIT: ${{ inputs.split || 'dev' }} + MAX_WORKERS: ${{ inputs.max-workers || '12' }} + MAX_RETRIES: ${{ inputs.max-retries || '2' }} + N_LIMIT: ${{ inputs.n-limit || '500' }} + INSTANCE_IDS: ${{ inputs.instance-ids || '' }} SELECT_FILE: '' concurrency: @@ -116,18 +118,6 @@ jobs: ref: ${{ steps.checkout-ref.outputs.ref }} submodules: recursive - # If this was a manual dispatch, override defaults with provided inputs. - - name: Apply workflow_dispatch overrides (if any) - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - if [ -n "${{ inputs.dataset }}" ]; then echo "DATASET=${{ inputs.dataset }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.split }}" ]; then echo "SPLIT=${{ inputs.split }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.max-workers }}" ]; then echo "MAX_WORKERS=${{ inputs.max-workers }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.max-retries }}" ]; then echo "MAX_RETRIES=${{ inputs.max-retries }}" >> "$GITHUB_ENV"; fi - # Empty string means "no limit" - if [ -n "${{ inputs.n-limit }}" ]; then echo "N_LIMIT=${{ inputs.n-limit }}" >> "$GITHUB_ENV"; else echo "N_LIMIT=" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.instance-ids }}" ]; then echo "INSTANCE_IDS=${{ inputs.instance-ids }}" >> "$GITHUB_ENV"; fi - # Set N_LIMIT based on the label that triggered the workflow - name: Set N_LIMIT based on label if: ${{ github.event_name == 'pull_request_target' }} diff --git a/.github/workflows/build-swegym-images.yml b/.github/workflows/build-swegym-images.yml index 77f730539..6de46231c 100644 --- a/.github/workflows/build-swegym-images.yml +++ b/.github/workflows/build-swegym-images.yml @@ -56,18 +56,17 @@ on: default: 'false' type: string -# Defaults for automatic runs; keep INSTANCE_IDS/SELECT_FILE initialized so set -euo pipefail won't fail on unset vars. +# Resolve inputs with fallback defaults so both workflow_dispatch and +# pull_request_target triggers work without a separate override step. +# INSTANCE_IDS/SELECT_FILE must be initialized for set -euo pipefail. env: - DATASET: SWE-Gym/SWE-Gym - SPLIT: train - MAX_WORKERS: '12' - MAX_RETRIES: '2' - N_LIMIT: '2438' - INSTANCE_IDS: '' + DATASET: ${{ inputs.dataset || 'SWE-Gym/SWE-Gym' }} + SPLIT: ${{ inputs.split || 'train' }} + MAX_WORKERS: ${{ inputs.max-workers || '12' }} + MAX_RETRIES: ${{ inputs.max-retries || '2' }} + N_LIMIT: ${{ inputs.n-limit || '2438' }} + INSTANCE_IDS: ${{ inputs.instance-ids || '' }} SELECT_FILE: '' - BUILD_BATCH_SIZE: '15' - BUILDKIT_PRUNE_KEEP_GB: '60' - BUILDKIT_PRUNE_THRESHOLD_PCT: '60' concurrency: group: build-swe-gym-${{ github.ref }} @@ -115,18 +114,6 @@ jobs: ref: ${{ steps.checkout-ref.outputs.ref }} submodules: recursive - # If this was a manual dispatch, override defaults with provided inputs. - - name: Apply workflow_dispatch overrides (if any) - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - if [ -n "${{ inputs.dataset }}" ]; then echo "DATASET=${{ inputs.dataset }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.split }}" ]; then echo "SPLIT=${{ inputs.split }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.max-workers }}" ]; then echo "MAX_WORKERS=${{ inputs.max-workers }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.max-retries }}" ]; then echo "MAX_RETRIES=${{ inputs.max-retries }}" >> "$GITHUB_ENV"; fi - # Empty string means "no limit" - if [ -n "${{ inputs.n-limit }}" ]; then echo "N_LIMIT=${{ inputs.n-limit }}" >> "$GITHUB_ENV"; else echo "N_LIMIT=" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.instance-ids }}" ]; then echo "INSTANCE_IDS=${{ inputs.instance-ids }}" >> "$GITHUB_ENV"; fi - # Set N_LIMIT based on the label that triggered the workflow - name: Set N_LIMIT based on label if: ${{ github.event_name == 'pull_request_target' }} diff --git a/.github/workflows/build-swesmith-images.yml b/.github/workflows/build-swesmith-images.yml index 551034c62..51a51e97b 100644 --- a/.github/workflows/build-swesmith-images.yml +++ b/.github/workflows/build-swesmith-images.yml @@ -56,18 +56,18 @@ on: default: 'false' type: string -# Defaults for automatic runs; keep INSTANCE_IDS/SELECT_FILE initialized so set -euo pipefail won't fail on unset vars. +# Resolve inputs with fallback defaults so both workflow_dispatch and +# pull_request_target triggers work without a separate override step. +# INSTANCE_IDS/SELECT_FILE must be initialized for set -euo pipefail. +# Note: N_LIMIT default of 51000 is effectively "all" since total unique base images <200. env: - DATASET: SWE-bench/SWE-smith-py - SPLIT: train - MAX_WORKERS: '12' - MAX_RETRIES: '2' - N_LIMIT: '51000' # Total number of unique base images in SWE-Smith is <200 - INSTANCE_IDS: '' + DATASET: ${{ inputs.dataset || 'SWE-bench/SWE-smith-py' }} + SPLIT: ${{ inputs.split || 'train' }} + MAX_WORKERS: ${{ inputs.max-workers || '12' }} + MAX_RETRIES: ${{ inputs.max-retries || '2' }} + N_LIMIT: ${{ inputs.n-limit || '51000' }} + INSTANCE_IDS: ${{ inputs.instance-ids || '' }} SELECT_FILE: '' - BUILD_BATCH_SIZE: '15' - BUILDKIT_PRUNE_KEEP_GB: '60' - BUILDKIT_PRUNE_THRESHOLD_PCT: '60' concurrency: group: build-swe-smith-${{ github.ref }} @@ -115,18 +115,6 @@ jobs: ref: ${{ steps.checkout-ref.outputs.ref }} submodules: recursive - # If this was a manual dispatch, override defaults with provided inputs. - - name: Apply workflow_dispatch overrides (if any) - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - if [ -n "${{ inputs.dataset }}" ]; then echo "DATASET=${{ inputs.dataset }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.split }}" ]; then echo "SPLIT=${{ inputs.split }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.max-workers }}" ]; then echo "MAX_WORKERS=${{ inputs.max-workers }}" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.max-retries }}" ]; then echo "MAX_RETRIES=${{ inputs.max-retries }}" >> "$GITHUB_ENV"; fi - # Empty string means "no limit" - if [ -n "${{ inputs.n-limit }}" ]; then echo "N_LIMIT=${{ inputs.n-limit }}" >> "$GITHUB_ENV"; else echo "N_LIMIT=" >> "$GITHUB_ENV"; fi - if [ -n "${{ inputs.instance-ids }}" ]; then echo "INSTANCE_IDS=${{ inputs.instance-ids }}" >> "$GITHUB_ENV"; fi - # Set N_LIMIT based on the label that triggered the workflow - name: Set N_LIMIT based on label if: ${{ github.event_name == 'pull_request_target' }}