Skip to content

fix: add draft review comments to debug logs#106

Merged
parkerbxyz merged 7 commits intomainfrom
copilot/fix-105
Oct 19, 2025
Merged

fix: add draft review comments to debug logs#106
parkerbxyz merged 7 commits intomainfrom
copilot/fix-105

Conversation

Copy link
Contributor

Copilot AI commented Aug 25, 2025

Previously, the debug output only included information about the diff input and review creation status, but did not show the actual content of generated suggestions. This made debugging difficult when trying to understand what suggestions were being generated.

This change adds comprehensive debug output that shows the complete draft review comment structure immediately after they are created by generateReviewComments(). The debug output includes:

  • The total number of generated suggestions
  • For each suggestion: all properties of the draft review comment including:
    • path: The file path
    • line: The target line number
    • start_line: The starting line number (for multi-line suggestions)
    • start_side: The side of the diff (when applicable)
    • body: The complete suggestion content with proper indentation

Example debug output:

::debug::Generated suggestions: 1
::debug::- Draft review comment:
::debug::  path: test.md
::debug::  line: 1
::debug::  body:
::debug::  ````suggestion
::debug::  new line
::debug::  ````

The suggestion body content is properly indented to align with the other review comment properties, making the debug output clean and easy to read. This makes it much easier to debug issues with suggestion generation by allowing developers to see the complete structure of each draft review comment before they go through filtering and review creation.

Fixes #105.


💡 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.

Co-authored-by: parkerbxyz <17183625+parkerbxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Include generated suggestions in debug output Include generated suggestions in debug output Aug 25, 2025
Copilot AI requested a review from parkerbxyz August 25, 2025 00:17
Copy link
Owner

@parkerbxyz parkerbxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot For the debug logging, I was thinking we should include more than just the line numbers and instead include the entire draft review comment.

Co-authored-by: parkerbxyz <17183625+parkerbxyz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 25, 2025

@copilot For the debug logging, I was thinking we should include more than just the line numbers and instead include the entire draft review comment.

Updated the debug logging to include the entire draft review comment with all properties (path, line, start_line, start_side, body) rather than just the condensed line numbers format. This provides complete visibility into the generated comment structure for debugging. The change is in commit ad52bca.

Copilot AI changed the title Include generated suggestions in debug output Include complete draft review comment details in debug output Aug 25, 2025
Copilot AI requested a review from parkerbxyz August 25, 2025 00:24
@parkerbxyz parkerbxyz changed the title Include complete draft review comment details in debug output fix: add draft review comments to debug logs Aug 25, 2025
… line

Co-authored-by: parkerbxyz <17183625+parkerbxyz@users.noreply.github.com>
@parkerbxyz
Copy link
Owner

@copilot Please update the example in the pull request body to reflect the latest changes.

Copy link
Contributor Author

Copilot AI commented Aug 25, 2025

@copilot Please update the example in the pull request body to reflect the latest changes.

Updated the example in the PR description to reflect the current debug output format where the comment body appears on a separate line. The corrected example now shows:

::debug::Generated suggestions: 1
::debug::- Draft review comment:
::debug::  path: test.md
::debug::  line: 1
::debug::  body:
::debug::````suggestion
::debug::new line
::debug::````

This matches the current implementation where the body content is displayed on its own line after the "body:" label for better readability (commit 5e19a22).

@parkerbxyz
Copy link
Owner

@copilot Is there a way to have the entire suggestion body indented so it lines up with the rest of the details about the review comment?

…perties

Co-authored-by: parkerbxyz <17183625+parkerbxyz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 25, 2025

@copilot Is there a way to have the entire suggestion body indented so it lines up with the rest of the details about the review comment?

Yes! I've updated the debug logging to properly indent the entire suggestion body content so it aligns with the other review comment properties. Each line of the comment body now has 2 spaces of indentation to match the format of the other fields. This change is in commit 49e3453.

Copilot AI changed the title fix: add draft review comments to debug logs fix: add draft review comments to debug logs with proper indentation Aug 25, 2025
@parkerbxyz parkerbxyz changed the title fix: add draft review comments to debug logs with proper indentation fix: add draft review comments to debug logs Aug 25, 2025
@parkerbxyz parkerbxyz marked this pull request as ready for review August 25, 2025 15:29
Copilot AI review requested due to automatic review settings August 25, 2025 15:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive debug logging for draft review comments to improve troubleshooting capabilities. Previously, debug output only showed diff input and review creation status but omitted the actual generated suggestions content.

  • Adds detailed debug output showing the complete structure of all generated draft review comments
  • Includes proper indentation for suggestion body content to maintain readability
  • Provides count of generated suggestions and handles zero-suggestion case

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@parkerbxyz parkerbxyz enabled auto-merge (squash) August 25, 2025 15:30
@parkerbxyz parkerbxyz disabled auto-merge August 25, 2025 15:30
@parkerbxyz parkerbxyz merged commit 5efd0b7 into main Oct 19, 2025
2 checks passed
@parkerbxyz parkerbxyz deleted the copilot/fix-105 branch October 19, 2025 05:13
@parkerbxyz parkerbxyz bot mentioned this pull request Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include generated suggestions in debug output

3 participants