From be337ecffb410fbda56a79c4da1638cd143caab0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 26 Oct 2025 20:42:08 +0000 Subject: [PATCH 1/3] Initial plan From 9c1b607a8cd0e92b29ff282fa8dab839fb64fb82 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 26 Oct 2025 20:53:32 +0000 Subject: [PATCH 2/3] Add comprehensive diagnostic logging to patch generation process - Added logging for recent commits (git log --oneline -5) before patch generation - Added git status output with clear diagnostic headers - Added diff stats preview (git diff --stat) showing files and line counts - Added commit count and list of commit SHAs to be included in patch - Added exact git format-patch command being executed - Added post-generation logging: file size in KB, line count, number of commits in patch - Added extraction of commit SHAs from generated patch file - All diagnostic sections use clear "=== Diagnostic: ... ===" headers for easy identification - Recompiled all workflow lock files with updated patch generation script Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../changeset-generator.firewall.lock.yml | 43 ++++++++++++++- .github/workflows/daily-doc-updater.lock.yml | 43 ++++++++++++++- .../workflows/daily-perf-improver.lock.yml | 43 ++++++++++++++- .../workflows/daily-test-improver.lock.yml | 43 ++++++++++++++- .github/workflows/dictation-prompt.lock.yml | 43 ++++++++++++++- .../github-mcp-tools-report.lock.yml | 43 ++++++++++++++- .github/workflows/go-logger.lock.yml | 43 ++++++++++++++- .../workflows/instructions-janitor.lock.yml | 43 ++++++++++++++- .github/workflows/mergefest.lock.yml | 43 ++++++++++++++- .github/workflows/poem-bot.lock.yml | 43 ++++++++++++++- .github/workflows/q.lock.yml | 43 ++++++++++++++- .github/workflows/security-fix-pr.lock.yml | 43 ++++++++++++++- .../workflows/technical-doc-writer.lock.yml | 43 ++++++++++++++- .github/workflows/tidy.lock.yml | 43 ++++++++++++++- .github/workflows/unbloat-docs.lock.yml | 43 ++++++++++++++- pkg/workflow/sh/generate_git_patch.sh | 52 ++++++++++++++++++- 16 files changed, 665 insertions(+), 32 deletions(-) diff --git a/.github/workflows/changeset-generator.firewall.lock.yml b/.github/workflows/changeset-generator.firewall.lock.yml index db903ab4bdc..025b05851b9 100644 --- a/.github/workflows/changeset-generator.firewall.lock.yml +++ b/.github/workflows/changeset-generator.firewall.lock.yml @@ -4336,12 +4336,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -4394,6 +4399,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -4403,7 +4426,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/daily-doc-updater.lock.yml b/.github/workflows/daily-doc-updater.lock.yml index e1cda5ae43b..c3c0adef2ee 100644 --- a/.github/workflows/daily-doc-updater.lock.yml +++ b/.github/workflows/daily-doc-updater.lock.yml @@ -3175,12 +3175,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -3233,6 +3238,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -3242,7 +3265,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/daily-perf-improver.lock.yml b/.github/workflows/daily-perf-improver.lock.yml index 7ddf4bf0bc1..0fd75502cb3 100644 --- a/.github/workflows/daily-perf-improver.lock.yml +++ b/.github/workflows/daily-perf-improver.lock.yml @@ -3852,12 +3852,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -3910,6 +3915,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -3919,7 +3942,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/daily-test-improver.lock.yml b/.github/workflows/daily-test-improver.lock.yml index f88294a16dd..13107429f81 100644 --- a/.github/workflows/daily-test-improver.lock.yml +++ b/.github/workflows/daily-test-improver.lock.yml @@ -3826,12 +3826,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -3884,6 +3889,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -3893,7 +3916,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/dictation-prompt.lock.yml b/.github/workflows/dictation-prompt.lock.yml index 74e07b684d0..82ae04dac00 100644 --- a/.github/workflows/dictation-prompt.lock.yml +++ b/.github/workflows/dictation-prompt.lock.yml @@ -3802,12 +3802,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -3860,6 +3865,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -3869,7 +3892,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/github-mcp-tools-report.lock.yml b/.github/workflows/github-mcp-tools-report.lock.yml index bb130e8bfba..62363d6798c 100644 --- a/.github/workflows/github-mcp-tools-report.lock.yml +++ b/.github/workflows/github-mcp-tools-report.lock.yml @@ -3485,12 +3485,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -3543,6 +3548,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -3552,7 +3575,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/go-logger.lock.yml b/.github/workflows/go-logger.lock.yml index f24de3abc9b..5cb333dbab5 100644 --- a/.github/workflows/go-logger.lock.yml +++ b/.github/workflows/go-logger.lock.yml @@ -3222,12 +3222,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -3280,6 +3285,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -3289,7 +3312,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/instructions-janitor.lock.yml b/.github/workflows/instructions-janitor.lock.yml index fbe8e0dd098..9a71f48a1a7 100644 --- a/.github/workflows/instructions-janitor.lock.yml +++ b/.github/workflows/instructions-janitor.lock.yml @@ -3172,12 +3172,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -3230,6 +3235,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -3239,7 +3262,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/mergefest.lock.yml b/.github/workflows/mergefest.lock.yml index 0052a9de565..c4d5579191d 100644 --- a/.github/workflows/mergefest.lock.yml +++ b/.github/workflows/mergefest.lock.yml @@ -3972,12 +3972,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -4030,6 +4035,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -4039,7 +4062,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/poem-bot.lock.yml b/.github/workflows/poem-bot.lock.yml index f068917f751..999ca1bd911 100644 --- a/.github/workflows/poem-bot.lock.yml +++ b/.github/workflows/poem-bot.lock.yml @@ -4646,12 +4646,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -4704,6 +4709,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -4713,7 +4736,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/q.lock.yml b/.github/workflows/q.lock.yml index b33205cf5c3..44887997d4e 100644 --- a/.github/workflows/q.lock.yml +++ b/.github/workflows/q.lock.yml @@ -4698,12 +4698,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -4756,6 +4761,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -4765,7 +4788,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/security-fix-pr.lock.yml b/.github/workflows/security-fix-pr.lock.yml index 44b382ab8b7..cff2c7ab630 100644 --- a/.github/workflows/security-fix-pr.lock.yml +++ b/.github/workflows/security-fix-pr.lock.yml @@ -3118,12 +3118,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -3176,6 +3181,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -3185,7 +3208,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/technical-doc-writer.lock.yml b/.github/workflows/technical-doc-writer.lock.yml index 04e4e83711c..b019d1715c1 100644 --- a/.github/workflows/technical-doc-writer.lock.yml +++ b/.github/workflows/technical-doc-writer.lock.yml @@ -3852,12 +3852,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -3910,6 +3915,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -3919,7 +3942,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/tidy.lock.yml b/.github/workflows/tidy.lock.yml index 8d75257d511..260428e9a77 100644 --- a/.github/workflows/tidy.lock.yml +++ b/.github/workflows/tidy.lock.yml @@ -3779,12 +3779,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -3837,6 +3842,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -3846,7 +3869,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/unbloat-docs.lock.yml b/.github/workflows/unbloat-docs.lock.yml index cd4463209c0..329ac6cd23a 100644 --- a/.github/workflows/unbloat-docs.lock.yml +++ b/.github/workflows/unbloat-docs.lock.yml @@ -4089,12 +4089,17 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_SHA: ${{ github.sha }} run: | + # Diagnostic logging: Show recent commits before patch generation + echo "=== Diagnostic: Recent commits (last 5) ===" + git log --oneline -5 || echo "Failed to show git log" # Check current git status - echo "Current git status:" + echo "" + echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -4147,6 +4152,24 @@ jobs: BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME) echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -4156,7 +4179,23 @@ jobs: fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY diff --git a/pkg/workflow/sh/generate_git_patch.sh b/pkg/workflow/sh/generate_git_patch.sh index 7335131870c..aab2969217f 100644 --- a/pkg/workflow/sh/generate_git_patch.sh +++ b/pkg/workflow/sh/generate_git_patch.sh @@ -1,10 +1,16 @@ +# Diagnostic logging: Show recent commits before patch generation +echo "=== Diagnostic: Recent commits (last 5) ===" +git log --oneline -5 || echo "Failed to show git log" + # Check current git status -echo "Current git status:" +echo "" +echo "=== Diagnostic: Current git status ===" git status # Extract branch name from JSONL output BRANCH_NAME="" if [ -f "$GH_AW_SAFE_OUTPUTS" ]; then + echo "" echo "Checking for branch name in JSONL output..." while IFS= read -r line; do if [ -n "$line" ]; then @@ -61,6 +67,27 @@ if [ -n "$BRANCH_NAME" ]; then echo "Using merge-base as base: $BASE_REF" fi + # Diagnostic logging: Show diff stats before generating patch + echo "" + echo "=== Diagnostic: Diff stats for patch generation ===" + echo "Command: git diff --stat $BASE_REF..$BRANCH_NAME" + git diff --stat "$BASE_REF".."$BRANCH_NAME" || echo "Failed to show diff stats" + + # Diagnostic logging: Count commits to be included + echo "" + echo "=== Diagnostic: Commits to be included in patch ===" + COMMIT_COUNT=$(git rev-list --count "$BASE_REF".."$BRANCH_NAME" 2>/dev/null || echo "0") + echo "Number of commits: $COMMIT_COUNT" + if [ "$COMMIT_COUNT" -gt 0 ]; then + echo "Commit SHAs:" + git log --oneline "$BASE_REF".."$BRANCH_NAME" || echo "Failed to list commits" + fi + + # Diagnostic logging: Show the exact command being used + echo "" + echo "=== Diagnostic: Generating patch ===" + echo "Command: git format-patch $BASE_REF..$BRANCH_NAME --stdout > /tmp/gh-aw/aw.patch" + # Generate patch from the determined base to the branch git format-patch "$BASE_REF".."$BRANCH_NAME" --stdout > /tmp/gh-aw/aw.patch || echo "Failed to generate patch from branch" > /tmp/gh-aw/aw.patch echo "Patch file created from branch: $BRANCH_NAME (base: $BASE_REF)" @@ -71,7 +98,28 @@ fi # Show patch info if it exists if [ -f /tmp/gh-aw/aw.patch ]; then - ls -la /tmp/gh-aw/aw.patch + echo "" + echo "=== Diagnostic: Patch file information ===" + ls -lh /tmp/gh-aw/aw.patch + + # Get patch file size in KB + PATCH_SIZE=$(du -k /tmp/gh-aw/aw.patch | cut -f1) + echo "Patch file size: ${PATCH_SIZE} KB" + + # Count lines in patch + PATCH_LINES=$(wc -l < /tmp/gh-aw/aw.patch) + echo "Patch file lines: $PATCH_LINES" + + # Extract and count commits from patch file (each commit starts with "From ") + PATCH_COMMITS=$(grep -c "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch 2>/dev/null || echo "0") + echo "Commits included in patch: $PATCH_COMMITS" + + # List commit SHAs in the patch + if [ "$PATCH_COMMITS" -gt 0 ]; then + echo "Commit SHAs in patch:" + grep "^From [0-9a-f]\{40\}" /tmp/gh-aw/aw.patch | sed 's/^From \([0-9a-f]\{40\}\).*/ \1/' || echo "Failed to extract commit SHAs" + fi + # Show the first 50 lines of the patch for review echo '## Git Patch' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY From ba328950f09d876e7a46f6a385152fee0fc5d915 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 Oct 2025 21:04:08 +0000 Subject: [PATCH 3/3] Add changeset for diagnostic logging [skip-ci] --- .changeset/patch-add-diagnostic-logging.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/patch-add-diagnostic-logging.md diff --git a/.changeset/patch-add-diagnostic-logging.md b/.changeset/patch-add-diagnostic-logging.md new file mode 100644 index 00000000000..467c85f78ff --- /dev/null +++ b/.changeset/patch-add-diagnostic-logging.md @@ -0,0 +1,5 @@ +--- +"gh-aw": patch +--- + +Add diagnostic logging to patch generation process