From b7cde9ce4ac6c581a27de73934f41bb895158280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?oliver=20k=C3=B6nig?= Date: Sat, 1 Nov 2025 18:49:22 +0000 Subject: [PATCH 1/4] ci(hotfix): Bypass approvalbot in merge-queue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: oliver könig --- .github/workflows/multi-approval-bot.yml | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/multi-approval-bot.yml b/.github/workflows/multi-approval-bot.yml index 8d082f49c6e..e90f5530594 100644 --- a/.github/workflows/multi-approval-bot.yml +++ b/.github/workflows/multi-approval-bot.yml @@ -6,9 +6,18 @@ on: - "pull-request/[0-9]+" jobs: + pre-flight: + uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_cicd_preflight.yml@v0.65.5 + if: github.repository == 'NVIDIA/Megatron-LM' + codeowners-approval: + needs: [pre-flight] runs-on: ubuntu-latest environment: nemo-ci + if: | + !(needs.pre-flight.outputs.docs_only == 'true' + || needs.pre-flight.outputs.is_merge_group == 'true' + || needs.pre-flight.outputs.is_deployment_workflow == 'true') steps: - name: Get PR info id: get-pr-info @@ -28,3 +37,30 @@ jobs: pr-number: ${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number }} repo-name: ${{ github.repository }} github-token: ${{ secrets.PAT }} + + multi-approval-bot-summary: + needs: [pre-flight, codeowners-approval] + if: | + ( + needs.pre-flight.outputs.docs_only == 'true' + || needs.pre-flight.outputs.is_merge_group == 'true' + || needs.pre-flight.outputs.is_deployment_workflow == 'true' + || always() + ) + && github.repository == 'NVIDIA/Megatron-LM' + && !cancelled() + runs-on: ubuntu-latest + steps: + - name: Result + run: | + FAILED_JOBS=$(gh run view $GITHUB_RUN_ID --json jobs --jq '[.jobs[] | select(.status == "completed" and .conclusion != "success")] | length') || echo 0 + + if [ "${FAILED_JOBS:-0}" -eq 0 ] || [ "$SKIPPING_IS_ALLOWED" == "true" ]; then + echo "✅ All previous jobs completed successfully" + exit 0 + else + echo "❌ Found $FAILED_JOBS failed job(s)" + # Show which jobs failed + gh run view $GITHUB_RUN_ID --json jobs --jq '.jobs[] | select(.status == "completed" and .conclusion != "success") | .name' + exit 1 + fi From 723055d7d0581aef7e3ea35764002c6fc80976ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?oliver=20k=C3=B6nig?= Date: Sat, 1 Nov 2025 18:52:39 +0000 Subject: [PATCH 2/4] test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: oliver könig --- .github/workflows/build-test-publish-wheel.yml | 4 ++++ .github/workflows/copyright-check.yml | 2 ++ .github/workflows/multi-approval-bot.yml | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/.github/workflows/build-test-publish-wheel.yml b/.github/workflows/build-test-publish-wheel.yml index 1580c5ada35..c645caea28b 100644 --- a/.github/workflows/build-test-publish-wheel.yml +++ b/.github/workflows/build-test-publish-wheel.yml @@ -57,6 +57,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Result + env: + GH_TOKEN: ${{ github.token }} + GITHUB_RUN_ID: ${{ github.run_id }} + SKIPPING_IS_ALLOWED: ${{ needs.pre-flight.outputs.docs_only == 'true' || needs.pre-flight.outputs.is_deployment_workflow == 'true' || needs.pre-flight.outputs.is_merge_group == 'true' || needs.pre-flight.outputs.is_ci_workload == 'true' }} run: | FAILED_JOBS=$(gh run view $GITHUB_RUN_ID --json jobs --jq '[.jobs[] | select(.status == "completed" and .conclusion != "success")] | length') || echo 0 diff --git a/.github/workflows/copyright-check.yml b/.github/workflows/copyright-check.yml index 4ed3ba7c0a9..3ded55cade8 100644 --- a/.github/workflows/copyright-check.yml +++ b/.github/workflows/copyright-check.yml @@ -50,6 +50,8 @@ jobs: steps: - name: Result env: + GH_TOKEN: ${{ github.token }} + GITHUB_RUN_ID: ${{ github.run_id }} SKIPPING_IS_ALLOWED: ${{ needs.pre-flight.outputs.docs_only == 'true' || needs.pre-flight.outputs.is_deployment_workflow == 'true' || needs.pre-flight.outputs.is_merge_group == 'true' || needs.pre-flight.outputs.is_ci_workload == 'true' }} run: | FAILED_JOBS=$(gh run view $GITHUB_RUN_ID --json jobs --jq '[.jobs[] | select(.status == "completed" and .conclusion != "success")] | length') || echo 0 diff --git a/.github/workflows/multi-approval-bot.yml b/.github/workflows/multi-approval-bot.yml index e90f5530594..1e72e83f1af 100644 --- a/.github/workflows/multi-approval-bot.yml +++ b/.github/workflows/multi-approval-bot.yml @@ -52,6 +52,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Result + env: + GH_TOKEN: ${{ github.token }} + GITHUB_RUN_ID: ${{ github.run_id }} + SKIPPING_IS_ALLOWED: ${{ needs.pre-flight.outputs.docs_only == 'true' || needs.pre-flight.outputs.is_deployment_workflow == 'true' || needs.pre-flight.outputs.is_merge_group == 'true' || needs.pre-flight.outputs.is_ci_workload == 'true' }} run: | FAILED_JOBS=$(gh run view $GITHUB_RUN_ID --json jobs --jq '[.jobs[] | select(.status == "completed" and .conclusion != "success")] | length') || echo 0 From a5e2aa0a2c0e8ee186d5fb564b186e21482051e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?oliver=20k=C3=B6nig?= Date: Sat, 1 Nov 2025 18:54:17 +0000 Subject: [PATCH 3/4] test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: oliver könig --- .github/workflows/build-test-publish-wheel.yml | 3 +++ .github/workflows/copyright-check.yml | 3 +++ .github/workflows/multi-approval-bot.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/build-test-publish-wheel.yml b/.github/workflows/build-test-publish-wheel.yml index c645caea28b..91fc4570b00 100644 --- a/.github/workflows/build-test-publish-wheel.yml +++ b/.github/workflows/build-test-publish-wheel.yml @@ -56,6 +56,9 @@ jobs: && !cancelled() runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Result env: GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/copyright-check.yml b/.github/workflows/copyright-check.yml index 3ded55cade8..920caf749e6 100644 --- a/.github/workflows/copyright-check.yml +++ b/.github/workflows/copyright-check.yml @@ -48,6 +48,9 @@ jobs: && github.repository == 'NVIDIA/Megatron-LM' runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Result env: GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/multi-approval-bot.yml b/.github/workflows/multi-approval-bot.yml index 1e72e83f1af..29debc79f3d 100644 --- a/.github/workflows/multi-approval-bot.yml +++ b/.github/workflows/multi-approval-bot.yml @@ -51,6 +51,9 @@ jobs: && !cancelled() runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Result env: GH_TOKEN: ${{ github.token }} From 7dc054bcdf6a4b7316ebface7b10214c55ebf57e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?oliver=20k=C3=B6nig?= Date: Sat, 1 Nov 2025 20:11:02 +0000 Subject: [PATCH 4/4] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: oliver könig --- .github/workflows/cicd-main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd-main.yml b/.github/workflows/cicd-main.yml index f635fdb1289..777027ff31e 100644 --- a/.github/workflows/cicd-main.yml +++ b/.github/workflows/cicd-main.yml @@ -502,7 +502,7 @@ jobs: shell: bash -x -e -u -o pipefail {0} env: GH_TOKEN: ${{ github.token }} - RUN_ID: ${{ github.run_id }} + GITHUB_RUN_ID: ${{ github.run_id }} SKIPPING_IS_ALLOWED: ${{ needs.pre-flight.outputs.docs_only == 'true' || needs.pre-flight.outputs.is_deployment_workflow == 'true' || needs.pre-flight.outputs.is_merge_group == 'true' || needs.pre-flight.outputs.is_ci_workload == 'true' }} run: | FAILED_JOBS=$(gh run view $GITHUB_RUN_ID --json jobs --jq '[.jobs[] | select(.status == "completed" and .conclusion == "failure")] | length') || echo 0