Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the user-facing error message for Dependabot alert API failures by adding a permission/scope hint when requests are denied, and updates unit tests to validate the new messaging.
Changes:
- Enhance Dependabot tool error messages by appending a token-permission hint for certain HTTP failures.
- Update/extend Dependabot tool tests to assert the improved error output for forbidden/not-found scenarios.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/dependabot.go | Adds dependabotErrMsg helper to enrich Dependabot API error messages with token permission guidance. |
| pkg/github/dependabot_test.go | Updates and extends tests to assert the new token-permission hint is present in error results. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 2
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.
This pull request improves error handling for Dependabot alert API failures by providing more informative error messages when access is denied due to insufficient token permissions. It also updates and extends tests to verify these enhanced messages.
Why
When in environments where the github token is provided, like a codespace, the error message is a bit vague in helping the user understand why their tool call failed.
MCP impact
Prompts tested (tool changes only)
n/a
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testDocs