99 "github.com/github/github-mcp-server/internal/githubv4mock"
1010 "github.com/github/github-mcp-server/internal/toolsnaps"
1111 ghErrors "github.com/github/github-mcp-server/pkg/errors"
12+ "github.com/github/github-mcp-server/pkg/http/headers"
13+ transportpkg "github.com/github/github-mcp-server/pkg/http/transport"
1214 "github.com/github/github-mcp-server/pkg/inventory"
1315 "github.com/github/github-mcp-server/pkg/translations"
1416 gogithub "github.com/google/go-github/v89/github"
@@ -1340,7 +1342,7 @@ func Test_ProjectItemReads_FieldNamesIncludeIssueFieldValues(t *testing.T) {
13401342}
13411343
13421344func Test_ProjectsWrite_UpdateProjectItem_AttachedIssueFieldDispatch (t * testing.T ) {
1343- gqlClient := githubv4 . NewClient ( githubv4mock .NewMockedHTTPClient (
1345+ mockClient := githubv4mock .NewMockedHTTPClient (
13441346 githubv4mock .NewQueryMatcher (
13451347 projectFieldsTestQuery {},
13461348 fieldsQueryVars ("octo-org" , 1 ),
@@ -1367,7 +1369,12 @@ func Test_ProjectsWrite_UpdateProjectItem_AttachedIssueFieldDispatch(t *testing.
13671369 "issue" : map [string ]any {"id" : "ISSUE_1" , "url" : "https://github.com/octo-org/repo/issues/1" },
13681370 }}),
13691371 ),
1370- ))
1372+ )
1373+
1374+ spy := & headerCaptureTransport {inner : mockClient .Transport }
1375+ gqlClient := githubv4 .NewClient (& http.Client {
1376+ Transport : & transportpkg.GraphQLFeaturesTransport {Transport : spy },
1377+ })
13711378 restClient := mustNewGHClient (t , MockHTTPClientWithHandlers (map [string ]http.HandlerFunc {
13721379 GetOrgsProjectsV2ItemsByProjectByItemID : mockResponse (t , http .StatusOK , issueProjectItemFixture ("Issue" )),
13731380 }))
@@ -1384,6 +1391,9 @@ func Test_ProjectsWrite_UpdateProjectItem_AttachedIssueFieldDispatch(t *testing.
13841391 require .NoError (t , err )
13851392 require .False (t , result .IsError , getTextResult (t , result ).Text )
13861393 assert .JSONEq (t , `{"id":"ISSUE_1","url":"https://github.com/octo-org/repo/issues/1"}` , getTextResult (t , result ).Text )
1394+ // The last request captured is the mutation; the preceding field/metadata
1395+ // queries do not require the update_issue_suggestions feature flag.
1396+ assert .Equal (t , "update_issue_suggestions" , spy .captured .Get (headers .GraphQLFeaturesHeader ))
13871397}
13881398
13891399func Test_BuildIssueFieldUpdate (t * testing.T ) {
0 commit comments