From 9f8abe87723d58c0a8028576ebf60033043183a4 Mon Sep 17 00:00:00 2001 From: aIbrahiim Date: Wed, 15 Apr 2026 12:36:23 +0200 Subject: [PATCH 1/2] fixed PythonDocker rerun matrix gating and gh setup --- .github/actions/rerun-job-action/action.yml | 6 +----- .github/workflows/README.md | 4 ++-- .github/workflows/beam_PreCommit_PythonDocker.yml | 6 ++++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/actions/rerun-job-action/action.yml b/.github/actions/rerun-job-action/action.yml index 73679aaaf819..37a068f5a84f 100644 --- a/.github/actions/rerun-job-action/action.yml +++ b/.github/actions/rerun-job-action/action.yml @@ -114,11 +114,7 @@ runs: -s $URL - name: Install GH Cli if: ${{env.rerun != 'false' }} - shell: bash - run: | - wget https://github.com/cli/cli/releases/download/v2.31.0/gh_2.31.0_linux_amd64.tar.gz - tar -xvf gh_2.31.0_linux_amd64.tar.gz - sudo mv gh_2.31.0_linux_amd64/bin/gh /usr/local/bin + uses: ./.github/actions/setup-gh-cli-linux - name: Exit rest of the run if: ${{env.rerun != 'false' }} shell: bash diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 75f09f12f4a5..9e685a983278 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -104,13 +104,13 @@ jobs: github.event_name == 'pull_request_target' || (github.event_name == 'schedule' && github.repository == 'apache/beam') || github.event_name == 'workflow_dispatch' || - startsWith(github.event.comment.body, 'Run Job With Matrix') + (github.event_name == 'issue_comment' && github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version)) steps: - uses: actions/checkout@v3 - name: Setup repository uses: ./.github/actions/setup-action with: - comment_phrase: ${{ matrix.job_phrase }} + comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }} github_token: ${{ secrets.GITHUB_TOKEN }} github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }}) ``` diff --git a/.github/workflows/beam_PreCommit_PythonDocker.yml b/.github/workflows/beam_PreCommit_PythonDocker.yml index 85e8445852e0..2a98b7f113e0 100644 --- a/.github/workflows/beam_PreCommit_PythonDocker.yml +++ b/.github/workflows/beam_PreCommit_PythonDocker.yml @@ -73,30 +73,36 @@ jobs: startsWith(github.event.comment.body, 'Run PythonDocker PreCommit') steps: - uses: actions/checkout@v4 + if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} - name: Setup repository + if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} uses: ./.github/actions/setup-action with: comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }} github_token: ${{ secrets.GITHUB_TOKEN }} github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }}) - name: Setup environment + if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} uses: ./.github/actions/setup-environment-action with: java-version: default python-version: ${{ matrix.python_version }} go-version: default - name: Setup Buildx + if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd with: install: true driver: 'docker' - name: Set PY_VER_CLEAN + if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} id: set_py_ver_clean run: | PY_VER=${{ matrix.python_version }} PY_VER_CLEAN=${PY_VER//.} echo "py_ver_clean=$PY_VER_CLEAN" >> $GITHUB_OUTPUT - name: Run pythonDockerBuildPreCommit + if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} uses: ./.github/actions/gradle-command-self-hosted-action with: gradle-command: :sdks:python:container:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:docker From 3dda1445142ff254629ba4052cf24bd1fce76cb5 Mon Sep 17 00:00:00 2001 From: aIbrahiim Date: Wed, 15 Apr 2026 21:59:46 +0200 Subject: [PATCH 2/2] Remove issue_comment flow from PythonDocker precommit --- .github/workflows/beam_PreCommit_PythonDocker.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/beam_PreCommit_PythonDocker.yml b/.github/workflows/beam_PreCommit_PythonDocker.yml index 2a98b7f113e0..c40190201d04 100644 --- a/.github/workflows/beam_PreCommit_PythonDocker.yml +++ b/.github/workflows/beam_PreCommit_PythonDocker.yml @@ -18,8 +18,6 @@ on: pull_request_target: branches: [ "master", "release-*" ] paths: [ "model/**","sdks/python/**","release/**", 'release/trigger_all_tests.json', '.github/trigger_files/beam_PreCommit_PythonDocker.json'] - issue_comment: - types: [created] push: tags: ['v*'] branches: ['master', 'release-*'] @@ -69,40 +67,33 @@ jobs: github.event_name == 'push' || github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' || - (github.event_name == 'schedule' && github.repository == 'apache/beam') || - startsWith(github.event.comment.body, 'Run PythonDocker PreCommit') + (github.event_name == 'schedule' && github.repository == 'apache/beam') steps: - uses: actions/checkout@v4 - if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} - name: Setup repository - if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} uses: ./.github/actions/setup-action with: comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }} github_token: ${{ secrets.GITHUB_TOKEN }} github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }}) - name: Setup environment - if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} uses: ./.github/actions/setup-environment-action with: java-version: default python-version: ${{ matrix.python_version }} go-version: default - name: Setup Buildx - if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd with: install: true driver: 'docker' - name: Set PY_VER_CLEAN - if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} id: set_py_ver_clean run: | PY_VER=${{ matrix.python_version }} PY_VER_CLEAN=${PY_VER//.} echo "py_ver_clean=$PY_VER_CLEAN" >> $GITHUB_OUTPUT - name: Run pythonDockerBuildPreCommit - if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == format('{0} {1}', matrix.job_phrase, matrix.python_version) }} uses: ./.github/actions/gradle-command-self-hosted-action with: gradle-command: :sdks:python:container:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:docker