- Notifications
You must be signed in to change notification settings - Fork3.2k
Remove migueleliasweb/go-github-mock#1656
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
base:main
Are you sure you want to change the base?
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 removes themigueleliasweb/go-github-mock dependency and replaces it with an in-house HTTP handler-map based mocking approach using testify for assertions. The change simplifies the testing infrastructure while maintaining all existing test functionality.
Key Changes:
- Removed
go-github-mockand its transitive dependencies (gorilla/mux, golang.org/x/time/rate) - Introduced new mocking infrastructure using HTTP handler maps (
MockHTTPClientWithHandlers) - Updated all test files to use the new mocking approach
- Updated license files and documentation to reflect dependency removals
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod / go.sum | Removed migueleliasweb/go-github-mock and transitive dependencies (gorilla/mux, go-github/v71, golang.org/x/time) |
| third-party/**/LICENSE | Removed license files for removed dependencies |
| third-party-licenses.*.md | Updated to remove references to removed dependencies |
| pkg/github/mock_shim_test.go | New file implementing compatibility shim for legacy test patterns with handler-map based mocking |
| pkg/github/helper_test.go | Added endpoint constants for Projects V2 API, renamed testify/mock import to avoid collision |
| pkg/raw/raw_mock.go | Changed endpoint patterns from structs to string constants |
| pkg/github/*_test.go | Updated all test files to use new MockHTTPClientWithHandlers approach |
| docs/testing.md | Updated testing documentation to reference new HTTP handler-map helpers |
| .github/copilot-instructions.md | Updated instructions to document new mocking approach |
Uh oh!
There was an error while loading.Please reload this page.
Summary
Remove
migueleliasweb/go-github-mockand use testify for mocksWhy
Fixes#1492
MCP impact
Security / limits
Lint & tests
./script/lint./script/testDocs