Skip to content

Conversation

@JoannaaKL
Copy link
Contributor

@JoannaaKL JoannaaKL commented Dec 19, 2025

Summary

Remove migueleliasweb/go-github-mock and use testify for mocks

Why

Fixes #1492

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

@JoannaaKL JoannaaKL requested a review from a team as a code owner December 19, 2025 15:16
Copilot AI review requested due to automatic review settings December 19, 2025 15:16
Copy link
Contributor

Copilot AI left a 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 the migueleliasweb/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-mock and 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chore: replace migueleliasweb/go-github-mock with stretchr/testify/mock

3 participants