- Notifications
You must be signed in to change notification settings - Fork3.1k
Instruct LLM to use pull request template when creating PRs#1442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this 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 enhances the GitHub MCP Server by instructing LLMs to search for and use pull request templates when creating PRs. The instruction is conditionally added only when both the "pull_requests" and "repos" toolsets are enabled, ensuring the LLM has access to the necessary file retrieval tools.
Key Changes
- Modified
getToolsetInstructions()to accept anenabledToolsetsparameter for conditional instruction generation - Added new instruction text for pull request template discovery and usage when repos toolset is available
- Enhanced test coverage with assertions to verify the conditional template instruction behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/github/instructions.go | Updated function signature to accept enabled toolsets; added conditional logic to include PR template instructions when repos toolset is available |
| pkg/github/instructions_test.go | Addedstrings import; expanded test structure with fields for conditional assertions; added test cases to verify template instructions appear/disappear based on enabled toolsets |
Comments suppressed due to low confidence (1)
pkg/github/instructions_test.go:161
- The test cases for "issues", "discussions", and "nonexistent" toolsets are missing the
enabledToolsetsfield. SincegetToolsetInstructionsnow requires this parameter, these test cases should provide it (even if it's justnilor an empty slice[]string{}) to be explicit about the expected behavior and avoid potential issues if the function logic changes to use this parameter for these toolsets.
{toolset: "issues",expectedEmpty: false,},{toolset: "discussions",expectedEmpty: false,},{toolset: "nonexistent",expectedEmpty: true,},ec6afa7 intomainUh oh!
There was an error while loading.Please reload this page.
Adds server instructions that tell LLM to search for PR templates and use them for creating PRs.
xref#1076