Add diagnostic logging to patch generation process#2568
Conversation
- 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>
|
Agentic Changeset Generator triggered by this pull request. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive diagnostic logging to the Git patch generation process to help identify which commits are included in patches and diagnose oversized patch generation issues (specifically addressing issue #2553 where a 20.1 MB patch with 498,195 lines was generated from already-merged PRs).
Key changes:
- Enhanced logging before patch generation showing recent commits, git status, diff statistics, and commit counts
- Enhanced logging after patch generation showing file size, line count, and included commit SHAs
- All diagnostic output uses standardized
=== Diagnostic: ... ===headers for easy log parsing
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/sh/generate_git_patch.sh | Modified shell script with comprehensive diagnostic logging sections before and after patch generation |
| .github/workflows/unbloat-docs.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/tidy.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/technical-doc-writer.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/security-fix-pr.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/q.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/poem-bot.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/mergefest.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/instructions-janitor.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/go-logger.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/github-mcp-tools-report.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/dictation-prompt.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/daily-test-improver.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/daily-perf-improver.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/daily-doc-updater.lock.yml | Updated workflow lock file with new patch generation diagnostics |
| .github/workflows/changeset-generator.firewall.lock.yml | Updated workflow lock file with new patch generation diagnostics |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ls -la /tmp/gh-aw/aw.patch | ||
| echo "" | ||
| echo "=== Diagnostic: Patch file information ===" | ||
| ls -lh /tmp/gh-aw/aw.patch |
There was a problem hiding this comment.
[nitpick] The ls -lh output is now redundant since patch size is explicitly calculated and displayed on line 107. Consider removing this line to avoid duplicate information in logs.
| ls -lh /tmp/gh-aw/aw.patch |
Adds comprehensive diagnostic logging to identify which commits are included in patches and diagnose oversized patch generation (related to #2553 where Mergefest agent generated a 20.1 MB patch with 498,195 lines from already-merged PRs).
Changes
Modified
pkg/workflow/sh/generate_git_patch.shto add diagnostic sections:Before patch generation:
git log --oneline -5)git status)git diff --stat BASE..BRANCH)git format-patchcommand being executedAfter patch generation:
All diagnostic output uses
=== Diagnostic: ... ===headers for easy log parsing.Example Output
All workflow lock files recompiled with updated patch generation script.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.