Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/workflow/codex_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func TestCodexEngineRenderMCPConfig(t *testing.T) {
"user_agent = \"test-workflow\"",
"startup_timeout_sec = 120",
"tool_timeout_sec = 60",
"container = \"ghcr.io/github/github-mcp-server:v0.31.0\"",
fmt.Sprintf("container = \"ghcr.io/github/github-mcp-server:%s\"", constants.DefaultGitHubMCPServerVersion),
"env = { \"GITHUB_PERSONAL_ACCESS_TOKEN\" = \"$GH_AW_GITHUB_TOKEN\", \"GITHUB_READ_ONLY\" = \"1\", \"GITHUB_TOOLSETS\" = \"context,repos,issues,pull_requests\" }",
"env_vars = [\"GITHUB_PERSONAL_ACCESS_TOKEN\", \"GITHUB_READ_ONLY\", \"GITHUB_TOOLSETS\"]",
"GH_AW_MCP_CONFIG_EOF",
Expand All @@ -318,7 +318,7 @@ func TestCodexEngineRenderMCPConfig(t *testing.T) {
"{",
"\"mcpServers\": {",
"\"github\": {",
"\"container\": \"ghcr.io/github/github-mcp-server:v0.31.0\",",
fmt.Sprintf("\"container\": \"ghcr.io/github/github-mcp-server:%s\",", constants.DefaultGitHubMCPServerVersion),
"\"env\": {",
"\"GITHUB_LOCKDOWN_MODE\": \"$GITHUB_MCP_LOCKDOWN\",",
"\"GITHUB_PERSONAL_ACCESS_TOKEN\": \"$GITHUB_MCP_SERVER_TOKEN\",",
Expand Down
4 changes: 2 additions & 2 deletions pkg/workflow/copilot_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ func TestCopilotEngineRenderGitHubMCPConfig(t *testing.T) {
expectedStrs: []string{
`"github": {`,
`"type": "stdio",`,
`"container": "ghcr.io/github/github-mcp-server:v0.31.0"`,
`"container": "ghcr.io/github/github-mcp-server:` + string(constants.DefaultGitHubMCPServerVersion) + `"`,
`"env": {`,
`"GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}"`,
`},`,
Expand Down Expand Up @@ -752,7 +752,7 @@ func TestCopilotEngineRenderGitHubMCPConfig(t *testing.T) {
expectedStrs: []string{
`"github": {`,
`"type": "stdio",`,
`"container": "ghcr.io/github/github-mcp-server:v0.31.0"`,
`"container": "ghcr.io/github/github-mcp-server:` + string(constants.DefaultGitHubMCPServerVersion) + `"`,
`"env": {`,
`}`,
},
Expand Down
8 changes: 5 additions & 3 deletions pkg/workflow/copilot_github_mcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ package workflow
import (
"strings"
"testing"

"github.com/github/gh-aw/pkg/constants"
)

func TestRenderGitHubCopilotMCPConfig_AllowedTools(t *testing.T) {
Expand All @@ -24,7 +26,7 @@ func TestRenderGitHubCopilotMCPConfig_AllowedTools(t *testing.T) {
expectedContent: []string{
`"github": {`,
`"type": "stdio"`,
`"container": "ghcr.io/github/github-mcp-server:v0.31.0"`,
`"container": "ghcr.io/github/github-mcp-server:` + string(constants.DefaultGitHubMCPServerVersion) + `"`,
`"env": {`,
`"GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}"`,
},
Expand All @@ -37,7 +39,7 @@ func TestRenderGitHubCopilotMCPConfig_AllowedTools(t *testing.T) {
expectedContent: []string{
`"github": {`,
`"type": "stdio"`,
`"container": "ghcr.io/github/github-mcp-server:v0.31.0"`,
`"container": "ghcr.io/github/github-mcp-server:` + string(constants.DefaultGitHubMCPServerVersion) + `"`,
`"env": {`,
},
unexpectedContent: []string{},
Expand All @@ -51,7 +53,7 @@ func TestRenderGitHubCopilotMCPConfig_AllowedTools(t *testing.T) {
expectedContent: []string{
`"github": {`,
`"type": "stdio"`,
`"container": "ghcr.io/github/github-mcp-server:v0.31.0"`,
`"container": "ghcr.io/github/github-mcp-server:` + string(constants.DefaultGitHubMCPServerVersion) + `"`,
`"env": {`,
},
unexpectedContent: []string{},
Expand Down
3 changes: 2 additions & 1 deletion pkg/workflow/github_remote_mode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"
"testing"

"github.com/github/gh-aw/pkg/constants"
"github.com/github/gh-aw/pkg/stringutil"

"github.com/github/gh-aw/pkg/testutil"
Expand Down Expand Up @@ -317,7 +318,7 @@ This is a test workflow for GitHub remote mode configuration.
t.Errorf("Expected container field but didn't find it in:\n%s", lockContent)
}
}
if !strings.Contains(lockContent, `ghcr.io/github/github-mcp-server:v0.31.0`) {
if !strings.Contains(lockContent, "ghcr.io/github/github-mcp-server:"+string(constants.DefaultGitHubMCPServerVersion)) {
t.Errorf("Expected Docker image but didn't find it in:\n%s", lockContent)
}
// Should NOT contain HTTP type
Expand Down
6 changes: 4 additions & 2 deletions pkg/workflow/mcp_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
package workflow

import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"

"github.com/github/gh-aw/pkg/constants"
"github.com/github/gh-aw/pkg/stringutil"

"github.com/github/gh-aw/pkg/testutil"
Expand Down Expand Up @@ -38,7 +40,7 @@ tools:
// With Docker MCP always enabled, default is docker (not services)
expectedType: "docker",
expectedCommand: "docker",
expectedDockerImage: "ghcr.io/github/github-mcp-server:v0.31.0",
expectedDockerImage: fmt.Sprintf("ghcr.io/github/github-mcp-server:%s", constants.DefaultGitHubMCPServerVersion),
},
}

Expand Down Expand Up @@ -173,7 +175,7 @@ func TestGenerateGitHubMCPConfig(t *testing.T) {

switch tt.expectedType {
case "docker":
if !strings.Contains(result, `"container": "ghcr.io/github/github-mcp-server:v0.31.0"`) {
if !strings.Contains(result, fmt.Sprintf(`"container": "ghcr.io/github/github-mcp-server:%s"`, constants.DefaultGitHubMCPServerVersion)) {
t.Errorf("Expected container field with GitHub MCP image but got:\n%s", result)
}
if strings.Contains(result, `"type": "http"`) {
Expand Down
Loading