From 5d91294e9078902c40989a973080e3793ee44ffe Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 19 Sep 2025 03:31:56 +0100 Subject: [PATCH] update workflows --- .github/workflows/ask.lock.yml | 6 +-- .github/workflows/ci-doctor.lock.yml | 2 +- .../workflows/daily-backlog-burner.lock.yml | 45 ++++++++++++++++--- .../workflows/daily-perf-improver.lock.yml | 45 ++++++++++++++++--- .../workflows/daily-test-improver.lock.yml | 45 ++++++++++++++++--- .github/workflows/pr-fix.lock.yml | 31 ++++++++++--- 6 files changed, 150 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ask.lock.yml b/.github/workflows/ask.lock.yml index 1281f95cb..c4425a643 100644 --- a/.github/workflows/ask.lock.yml +++ b/.github/workflows/ask.lock.yml @@ -2,7 +2,7 @@ # To update this file, edit the corresponding .md file and run: # gh aw compile # -# Effective stop-time: 2025-09-19 22:49:48 +# Effective stop-time: 2025-09-21 02:31:54 name: "Question Answering Researcher" on: @@ -1078,7 +1078,7 @@ jobs: WORKFLOW_NAME="Question Answering Researcher" # Check stop-time limit - STOP_TIME="2025-09-19 22:49:48" + STOP_TIME="2025-09-21 02:31:54" echo "Checking stop-time limit: $STOP_TIME" # Convert stop time to epoch seconds @@ -1194,7 +1194,7 @@ jobs: version: "", workflow_name: "Question Answering Researcher", experimental: false, - supports_tools_whitelist: true, + supports_tools_allowlist: true, supports_http_transport: true, run_id: context.runId, run_number: context.runNumber, diff --git a/.github/workflows/ci-doctor.lock.yml b/.github/workflows/ci-doctor.lock.yml index 19068e890..c75fd661c 100644 --- a/.github/workflows/ci-doctor.lock.yml +++ b/.github/workflows/ci-doctor.lock.yml @@ -779,7 +779,7 @@ jobs: version: "", workflow_name: "CI Failure Doctor", experimental: false, - supports_tools_whitelist: true, + supports_tools_allowlist: true, supports_http_transport: true, run_id: context.runId, run_number: context.runNumber, diff --git a/.github/workflows/daily-backlog-burner.lock.yml b/.github/workflows/daily-backlog-burner.lock.yml index a17d0a14b..355ca9a78 100644 --- a/.github/workflows/daily-backlog-burner.lock.yml +++ b/.github/workflows/daily-backlog-burner.lock.yml @@ -2,7 +2,7 @@ # To update this file, edit the corresponding .md file and run: # gh aw compile # -# Effective stop-time: 2025-09-19 22:49:48 +# Effective stop-time: 2025-09-21 02:31:54 name: "Daily Backlog Burner" "on": @@ -539,7 +539,7 @@ jobs: WORKFLOW_NAME="Daily Backlog Burner" # Check stop-time limit - STOP_TIME="2025-09-19 22:49:48" + STOP_TIME="2025-09-21 02:31:54" echo "Checking stop-time limit: $STOP_TIME" # Convert stop time to epoch seconds @@ -718,7 +718,7 @@ jobs: version: "", workflow_name: "Daily Backlog Burner", experimental: false, - supports_tools_whitelist: true, + supports_tools_allowlist: true, supports_http_transport: true, run_id: context.runId, run_number: context.runNumber, @@ -2404,8 +2404,10 @@ jobs: else echo "origin/$BRANCH_NAME does not exist, using merge-base with default branch" # Get the default branch name - DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') + DEFAULT_BRANCH="${{ github.event.repository.default_branch }}" echo "Default branch: $DEFAULT_BRANCH" + # Fetch the default branch to ensure it's available locally + git fetch origin $DEFAULT_BRANCH # Find merge base between default branch and current branch BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" @@ -2966,6 +2968,7 @@ jobs: GITHUB_AW_BASE_BRANCH: ${{ github.ref_name }} GITHUB_AW_PR_DRAFT: "true" GITHUB_AW_PR_IF_NO_CHANGES: "warn" + GITHUB_AW_MAX_PATCH_SIZE: 1024 with: github-token: ${{ secrets.DSYME_GH_TOKEN}} script: | @@ -3052,8 +3055,40 @@ jobs: return; } } - // Empty patch is valid - behavior depends on if-no-changes configuration + // Validate patch size (unless empty) const isEmpty = !patchContent || !patchContent.trim(); + if (!isEmpty) { + // Get maximum patch size from environment (default: 1MB = 1024 KB) + const maxSizeKb = parseInt( + process.env.GITHUB_AW_MAX_PATCH_SIZE || "1024", + 10 + ); + const patchSizeBytes = Buffer.byteLength(patchContent, "utf8"); + const patchSizeKb = Math.ceil(patchSizeBytes / 1024); + core.info( + `Patch size: ${patchSizeKb} KB (maximum allowed: ${maxSizeKb} KB)` + ); + if (patchSizeKb > maxSizeKb) { + const message = `Patch size (${patchSizeKb} KB) exceeds maximum allowed size (${maxSizeKb} KB)`; + // If in staged mode, still show preview with error + if (isStaged) { + let summaryContent = + "## 🎭 Staged Mode: Create Pull Request Preview\n\n"; + summaryContent += + "The following pull request would be created if staged mode was disabled:\n\n"; + summaryContent += `**Status:** ❌ Patch size exceeded\n\n`; + summaryContent += `**Message:** ${message}\n\n`; + // Write to step summary + await core.summary.addRaw(summaryContent).write(); + core.info( + "📝 Pull request creation preview written to step summary (patch size error)" + ); + return; + } + throw new Error(message); + } + core.info("Patch size validation passed"); + } if (isEmpty && !isStaged) { const message = "Patch file is empty - no changes to apply (noop operation)"; diff --git a/.github/workflows/daily-perf-improver.lock.yml b/.github/workflows/daily-perf-improver.lock.yml index 40f51182a..41448b626 100644 --- a/.github/workflows/daily-perf-improver.lock.yml +++ b/.github/workflows/daily-perf-improver.lock.yml @@ -2,7 +2,7 @@ # To update this file, edit the corresponding .md file and run: # gh aw compile # -# Effective stop-time: 2025-09-19 22:49:48 +# Effective stop-time: 2025-09-21 02:31:54 name: "Daily Perf Improver" "on": @@ -553,7 +553,7 @@ jobs: WORKFLOW_NAME="Daily Perf Improver" # Check stop-time limit - STOP_TIME="2025-09-19 22:49:48" + STOP_TIME="2025-09-21 02:31:54" echo "Checking stop-time limit: $STOP_TIME" # Convert stop time to epoch seconds @@ -793,7 +793,7 @@ jobs: version: "", workflow_name: "Daily Perf Improver", experimental: false, - supports_tools_whitelist: true, + supports_tools_allowlist: true, supports_http_transport: true, run_id: context.runId, run_number: context.runNumber, @@ -2479,8 +2479,10 @@ jobs: else echo "origin/$BRANCH_NAME does not exist, using merge-base with default branch" # Get the default branch name - DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') + DEFAULT_BRANCH="${{ github.event.repository.default_branch }}" echo "Default branch: $DEFAULT_BRANCH" + # Fetch the default branch to ensure it's available locally + git fetch origin $DEFAULT_BRANCH # Find merge base between default branch and current branch BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" @@ -3041,6 +3043,7 @@ jobs: GITHUB_AW_BASE_BRANCH: ${{ github.ref_name }} GITHUB_AW_PR_DRAFT: "true" GITHUB_AW_PR_IF_NO_CHANGES: "warn" + GITHUB_AW_MAX_PATCH_SIZE: 1024 with: github-token: ${{ secrets.DSYME_GH_TOKEN}} script: | @@ -3127,8 +3130,40 @@ jobs: return; } } - // Empty patch is valid - behavior depends on if-no-changes configuration + // Validate patch size (unless empty) const isEmpty = !patchContent || !patchContent.trim(); + if (!isEmpty) { + // Get maximum patch size from environment (default: 1MB = 1024 KB) + const maxSizeKb = parseInt( + process.env.GITHUB_AW_MAX_PATCH_SIZE || "1024", + 10 + ); + const patchSizeBytes = Buffer.byteLength(patchContent, "utf8"); + const patchSizeKb = Math.ceil(patchSizeBytes / 1024); + core.info( + `Patch size: ${patchSizeKb} KB (maximum allowed: ${maxSizeKb} KB)` + ); + if (patchSizeKb > maxSizeKb) { + const message = `Patch size (${patchSizeKb} KB) exceeds maximum allowed size (${maxSizeKb} KB)`; + // If in staged mode, still show preview with error + if (isStaged) { + let summaryContent = + "## 🎭 Staged Mode: Create Pull Request Preview\n\n"; + summaryContent += + "The following pull request would be created if staged mode was disabled:\n\n"; + summaryContent += `**Status:** ❌ Patch size exceeded\n\n`; + summaryContent += `**Message:** ${message}\n\n`; + // Write to step summary + await core.summary.addRaw(summaryContent).write(); + core.info( + "📝 Pull request creation preview written to step summary (patch size error)" + ); + return; + } + throw new Error(message); + } + core.info("Patch size validation passed"); + } if (isEmpty && !isStaged) { const message = "Patch file is empty - no changes to apply (noop operation)"; diff --git a/.github/workflows/daily-test-improver.lock.yml b/.github/workflows/daily-test-improver.lock.yml index ac44e3de2..e001ab7df 100644 --- a/.github/workflows/daily-test-improver.lock.yml +++ b/.github/workflows/daily-test-improver.lock.yml @@ -2,7 +2,7 @@ # To update this file, edit the corresponding .md file and run: # gh aw compile # -# Effective stop-time: 2025-09-19 22:49:48 +# Effective stop-time: 2025-09-21 02:31:54 name: "Daily Test Coverage Improver" "on": @@ -553,7 +553,7 @@ jobs: WORKFLOW_NAME="Daily Test Coverage Improver" # Check stop-time limit - STOP_TIME="2025-09-19 22:49:48" + STOP_TIME="2025-09-21 02:31:54" echo "Checking stop-time limit: $STOP_TIME" # Convert stop time to epoch seconds @@ -768,7 +768,7 @@ jobs: version: "", workflow_name: "Daily Test Coverage Improver", experimental: false, - supports_tools_whitelist: true, + supports_tools_allowlist: true, supports_http_transport: true, run_id: context.runId, run_number: context.runNumber, @@ -2454,8 +2454,10 @@ jobs: else echo "origin/$BRANCH_NAME does not exist, using merge-base with default branch" # Get the default branch name - DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') + DEFAULT_BRANCH="${{ github.event.repository.default_branch }}" echo "Default branch: $DEFAULT_BRANCH" + # Fetch the default branch to ensure it's available locally + git fetch origin $DEFAULT_BRANCH # Find merge base between default branch and current branch BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" @@ -3016,6 +3018,7 @@ jobs: GITHUB_AW_BASE_BRANCH: ${{ github.ref_name }} GITHUB_AW_PR_DRAFT: "true" GITHUB_AW_PR_IF_NO_CHANGES: "warn" + GITHUB_AW_MAX_PATCH_SIZE: 1024 with: github-token: ${{ secrets.DSYME_GH_TOKEN}} script: | @@ -3102,8 +3105,40 @@ jobs: return; } } - // Empty patch is valid - behavior depends on if-no-changes configuration + // Validate patch size (unless empty) const isEmpty = !patchContent || !patchContent.trim(); + if (!isEmpty) { + // Get maximum patch size from environment (default: 1MB = 1024 KB) + const maxSizeKb = parseInt( + process.env.GITHUB_AW_MAX_PATCH_SIZE || "1024", + 10 + ); + const patchSizeBytes = Buffer.byteLength(patchContent, "utf8"); + const patchSizeKb = Math.ceil(patchSizeBytes / 1024); + core.info( + `Patch size: ${patchSizeKb} KB (maximum allowed: ${maxSizeKb} KB)` + ); + if (patchSizeKb > maxSizeKb) { + const message = `Patch size (${patchSizeKb} KB) exceeds maximum allowed size (${maxSizeKb} KB)`; + // If in staged mode, still show preview with error + if (isStaged) { + let summaryContent = + "## 🎭 Staged Mode: Create Pull Request Preview\n\n"; + summaryContent += + "The following pull request would be created if staged mode was disabled:\n\n"; + summaryContent += `**Status:** ❌ Patch size exceeded\n\n`; + summaryContent += `**Message:** ${message}\n\n`; + // Write to step summary + await core.summary.addRaw(summaryContent).write(); + core.info( + "📝 Pull request creation preview written to step summary (patch size error)" + ); + return; + } + throw new Error(message); + } + core.info("Patch size validation passed"); + } if (isEmpty && !isStaged) { const message = "Patch file is empty - no changes to apply (noop operation)"; diff --git a/.github/workflows/pr-fix.lock.yml b/.github/workflows/pr-fix.lock.yml index 18d12a58e..87e8b10c9 100644 --- a/.github/workflows/pr-fix.lock.yml +++ b/.github/workflows/pr-fix.lock.yml @@ -2,7 +2,7 @@ # To update this file, edit the corresponding .md file and run: # gh aw compile # -# Effective stop-time: 2025-09-19 22:49:48 +# Effective stop-time: 2025-09-21 02:31:54 name: "PR Fix" on: @@ -1083,7 +1083,7 @@ jobs: WORKFLOW_NAME="PR Fix" # Check stop-time limit - STOP_TIME="2025-09-19 22:49:48" + STOP_TIME="2025-09-21 02:31:54" echo "Checking stop-time limit: $STOP_TIME" # Convert stop time to epoch seconds @@ -1222,7 +1222,7 @@ jobs: version: "", workflow_name: "PR Fix", experimental: false, - supports_tools_whitelist: true, + supports_tools_allowlist: true, supports_http_transport: true, run_id: context.runId, run_number: context.runNumber, @@ -2908,8 +2908,10 @@ jobs: else echo "origin/$BRANCH_NAME does not exist, using merge-base with default branch" # Get the default branch name - DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') + DEFAULT_BRANCH="${{ github.event.repository.default_branch }}" echo "Default branch: $DEFAULT_BRANCH" + # Fetch the default branch to ensure it's available locally + git fetch origin $DEFAULT_BRANCH # Find merge base between default branch and current branch BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" @@ -3389,6 +3391,7 @@ jobs: GH_TOKEN: ${{ github.token }} GITHUB_AW_AGENT_OUTPUT: ${{ needs.pr-fix.outputs.output }} GITHUB_AW_PUSH_IF_NO_CHANGES: "warn" + GITHUB_AW_MAX_PATCH_SIZE: 1024 with: github-token: ${{ secrets.DSYME_GH_TOKEN}} script: | @@ -3438,8 +3441,26 @@ jobs: return; } } - // Empty patch is valid - behavior depends on if-no-changes configuration + // Validate patch size (unless empty) const isEmpty = !patchContent || !patchContent.trim(); + if (!isEmpty) { + // Get maximum patch size from environment (default: 1MB = 1024 KB) + const maxSizeKb = parseInt( + process.env.GITHUB_AW_MAX_PATCH_SIZE || "1024", + 10 + ); + const patchSizeBytes = Buffer.byteLength(patchContent, "utf8"); + const patchSizeKb = Math.ceil(patchSizeBytes / 1024); + core.info( + `Patch size: ${patchSizeKb} KB (maximum allowed: ${maxSizeKb} KB)` + ); + if (patchSizeKb > maxSizeKb) { + const message = `Patch size (${patchSizeKb} KB) exceeds maximum allowed size (${maxSizeKb} KB)`; + core.setFailed(message); + return; + } + core.info("Patch size validation passed"); + } if (isEmpty) { const message = "Patch file is empty - no changes to apply (noop operation)";