Repository navigation
Add git patch preview to fallback issue creation in create_pull_request handler - #1558
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
marked this pull request as ready for review
October 11, 2025 18:07
Contributor
|
Agentic Changeset Generator triggered by this pull request |
Copilot
AI
changed the title
[WIP] Add git patch preview in issue message for fallback
Add git patch preview to fallback issue creation in create_pull_request handler
Oct 11, 2025
pelikhan
reviewed
Oct 11, 2025
| const maxLines = 500; | ||
|
|
||
| if (lines.length <= maxLines) { | ||
| return `\n\n<details><summary>Show patch (${lines.length} lines)</summary>\n\n\`\`\`diff\n${patchContent}\n\`\`\`\n\n</details>`; |
Contributor
Author
There was a problem hiding this comment.
Done. Updated the patch preview to enforce both a 500 line limit and a 2000 character limit. The character limit is applied after the line limit. Added a test to verify the character limit is enforced. (commit: TBD)
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
reviewed
Oct 11, 2025
| * @param {string} patchContent - The full patch content | ||
| * @returns {string} Formatted patch preview | ||
| */ | ||
| function generatePatchPreview(patchContent) { |
Contributor
Author
There was a problem hiding this comment.
Done. Moved generatePatchPreview to module level. Also updated the test extraction logic to include top-level helper functions. (commit: TBD)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
approved these changes
Oct 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactored
generatePatchPreview()to be a top-level helper function instead of being nested insidemain().Changes Made
File:
pkg/workflow/js/create_pull_request.cjsgeneratePatchPreview()function out ofmain()to module levelmain()File:
pkg/workflow/js/create_pull_request.test.cjsmain()body to extracting entire script beforeawait main()const fsandconst cryptodeclarations to avoid conflicts with test mocksValidation Results
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.