Skip to content

[task] Add diagnostic logging to patch generation process #2555

@github-actions

Description

@github-actions

Objective

Add comprehensive diagnostic logging to the patch generation process to help identify which commits are being included and why patches might be oversized.

Context

Related to #2553. The Mergefest agent successfully merges but the patch generation captures the full diff from already-merged PRs (20.1 MB patch with 498,195 lines). We need visibility into what's happening during patch generation to diagnose the root cause.

Approach

  1. Locate the patch generation code in the codebase (likely in JavaScript files handling safe-outputs)
  2. Add logging before patch generation:
    • git log --oneline -5 to show recent commits
    • git status to show working tree state
    • git diff --stat HEAD^..HEAD to preview patch size
    • Echo the exact git format-patch command being used
  3. Add logging after patch generation:
    • Patch file size
    • Number of commits included
    • List of commit SHAs in the patch

Files to Modify

  • Likely in pkg/workflow/js/ directory (JavaScript files handling push_to_pull_request_branch)
  • May be in Go files that generate the patch steps
  • Check for references to git format-patch or patch generation logic

Acceptance Criteria

  • Logs show git state before patch generation
  • Logs show the exact git command used to generate patch
  • Logs show patch metadata after generation (size, commits included)
  • Logging is controlled by appropriate log level (info or debug)
  • Changes don't break existing patch generation functionality
    Related to Push to branch issue #2553

AI generated by Plan Command for #2553

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions