Fix test suite for GitHub MCP toolset permission validation#2800
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Fix JSON formatting in pkg/workflow/schemas/github-workflow.json - Add required permissions (issues: read, pull-requests: read) to test workflows - Update test frontmatter to comply with default GitHub MCP toolset requirements - Fix missing frontmatter closing markers in some tests Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Replace `allowed:` with `toolsets:` in checkout optimization tests - Fix JSON formatting for github-workflow.json schema - Tests now use appropriate GitHub MCP toolsets matching their permissions - TestCheckoutOptimization now passes completely Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR fixes 150+ test failures caused by GitHub MCP toolset permission validation that was introduced recently. The default GitHub toolsets (issues, pull_requests, repos) now require corresponding permissions, which were missing from test workflows.
Key Changes:
- Added
issues: readandpull-requests: readpermissions to 120+ test workflows - Fixed malformed YAML frontmatter (missing closing
---markers) - Updated deprecated
allowed:syntax totoolsets:in checkout optimization tests - Updated action SHA pins in generated workflow files
Reviewed Changes
Copilot reviewed 61 out of 61 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/*_test.go (40+ files) | Added missing issues: read and pull-requests: read permissions to test workflow fixtures |
| pkg/workflow/reaction_outputs_test.go | Removed duplicate closing frontmatter delimiter |
| pkg/workflow/permissions_import_test.go | Fixed malformed frontmatter and added missing permissions |
| pkg/workflow/compiler_template_validation_test.go | Removed duplicate closing frontmatter delimiters |
| pkg/workflow/checkout_optimization_test.go | Replaced deprecated allowed: with toolsets: syntax |
| pkg/cli/*_test.go (3 files) | Added missing permissions to CLI test fixtures |
| .github/workflows/*.lock.yml (3 files) | Updated actions/setup-node SHA pin |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --- | ||
| pull-requests: read | ||
| # Content`, | ||
| expected: `{"contents":"read","issues":"write"}`, |
There was a problem hiding this comment.
The expected permissions JSON doesn't match the actual test input. The test input now includes pull-requests: read on line 298, but the expected output still only includes contents and issues. This should be updated to {\"contents\":\"read\",\"issues\":\"write\",\"pull-requests\":\"read\"}.
| expected: `{"contents":"read","issues":"write"}`, | |
| expected: `{"contents":"read","issues":"write","pull-requests":"read"}`, |
|
Agentic Changeset Generator triggered by this pull request. |
Recent introduction of GitHub MCP toolset permission validation broke 150+ tests. Tests using default GitHub toolsets (
issues,pull_requests,repos) now require corresponding permissions but lacked them.Changes
Test fixtures updated
issues: readandpull-requests: readto 120+ test workflows---markers)allowed:withtoolsets:in checkout optimization testsJSON formatting
pkg/workflow/schemas/github-workflow.jsonformattingResults
Remaining 26 failures are edge cases requiring individual investigation (network-dependent tests, complex integration scenarios).
Example fix
The default GitHub MCP configuration enables
[context, repos, issues, pull_requests, users]toolsets, which require corresponding permissions.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.