diff --git a/.github/workflows/campaign-generator.lock.yml b/.github/workflows/campaign-generator.lock.yml index a1e2c1487b..84c5c75a07 100644 --- a/.github/workflows/campaign-generator.lock.yml +++ b/.github/workflows/campaign-generator.lock.yml @@ -202,7 +202,7 @@ jobs: const determineAutomaticLockdown = require('/opt/gh-aw/actions/determine_automatic_lockdown.cjs'); await determineAutomaticLockdown(github, context, core); - name: Downloading container images - run: bash /opt/gh-aw/actions/download_docker_images.sh ghcr.io/github/github-mcp-server:v0.27.0 ghcr.io/githubnext/gh-aw-mcpg:v0.0.20 node:lts-alpine + run: bash /opt/gh-aw/actions/download_docker_images.sh ghcr.io/github/github-mcp-server:v0.27.0 ghcr.io/githubnext/gh-aw-mcpg:v0.0.24 node:lts-alpine - name: Write Safe Outputs Config run: | mkdir -p /opt/gh-aw/safeoutputs @@ -538,7 +538,7 @@ jobs: # Register API key as secret to mask it from logs echo "::add-mask::${MCP_GATEWAY_API_KEY}" export GH_AW_ENGINE="copilot" - export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e DEBUG="*" -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_LOCKDOWN -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GH_AW_SAFE_INPUTS_PORT -e GH_AW_SAFE_INPUTS_API_KEY -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/githubnext/gh-aw-mcpg:v0.0.20' + export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e DEBUG="*" -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_LOCKDOWN -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GH_AW_SAFE_INPUTS_PORT -e GH_AW_SAFE_INPUTS_API_KEY -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/githubnext/gh-aw-mcpg:v0.0.24' mkdir -p /home/runner/.copilot cat << MCPCONFIG_EOF | bash /opt/gh-aw/actions/start_mcp_gateway.sh @@ -613,7 +613,7 @@ jobs: allowed_domains: [], firewall_enabled: true, awf_version: "v0.8.2", - awmg_version: "v0.0.20", + awmg_version: "v0.0.24", steps: { firewall: "squid" }, diff --git a/actions/setup/js/parse_mcp_gateway_log.cjs b/actions/setup/js/parse_mcp_gateway_log.cjs index aa0c83e9ab..130b199c83 100644 --- a/actions/setup/js/parse_mcp_gateway_log.cjs +++ b/actions/setup/js/parse_mcp_gateway_log.cjs @@ -7,8 +7,9 @@ const { getErrorMessage } = require("./error_helpers.cjs"); /** * Parses MCP gateway logs and creates a step summary * Log file locations: - * - /tmp/gh-aw/mcp-logs/gateway.log (main gateway log) - * - /tmp/gh-aw/mcp-logs/stderr.log (stderr output) + * - /tmp/gh-aw/mcp-logs/gateway.md (markdown summary from gateway, preferred) + * - /tmp/gh-aw/mcp-logs/gateway.log (main gateway log, fallback) + * - /tmp/gh-aw/mcp-logs/stderr.log (stderr output, fallback) */ /** @@ -16,9 +17,25 @@ const { getErrorMessage } = require("./error_helpers.cjs"); */ async function main() { try { + const gatewayMdPath = "/tmp/gh-aw/mcp-logs/gateway.md"; const gatewayLogPath = "/tmp/gh-aw/mcp-logs/gateway.log"; const stderrLogPath = "/tmp/gh-aw/mcp-logs/stderr.log"; + // First, try to read gateway.md if it exists + if (fs.existsSync(gatewayMdPath)) { + const gatewayMdContent = fs.readFileSync(gatewayMdPath, "utf8"); + if (gatewayMdContent && gatewayMdContent.trim().length > 0) { + core.info(`Found gateway.md (${gatewayMdContent.length} bytes)`); + // Write the markdown directly to the step summary + core.summary.addRaw(gatewayMdContent).write(); + core.info("MCP gateway markdown summary added to step summary"); + return; + } + } else { + core.info(`No gateway.md found at: ${gatewayMdPath}, falling back to log files`); + } + + // Fallback to legacy log files let gatewayLogContent = ""; let stderrLogContent = ""; diff --git a/actions/setup/js/parse_mcp_gateway_log.test.cjs b/actions/setup/js/parse_mcp_gateway_log.test.cjs index 8ba4430124..6fb90c3d35 100644 --- a/actions/setup/js/parse_mcp_gateway_log.test.cjs +++ b/actions/setup/js/parse_mcp_gateway_log.test.cjs @@ -4,6 +4,10 @@ const { generateGatewayLogSummary } = require("./parse_mcp_gateway_log.cjs"); describe("parse_mcp_gateway_log", () => { + // Note: The main() function now checks for gateway.md first before falling back to log files. + // If gateway.md exists, its content is written directly to the step summary. + // These tests focus on the fallback generateGatewayLogSummary function used when gateway.md is not present. + describe("generateGatewayLogSummary", () => { test("generates summary with both gateway.log and stderr.log", () => { const gatewayLogContent = "Gateway started\nServer listening on port 8080"; diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 961445cbcc..55ca9f3f4e 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -235,7 +235,7 @@ const DefaultGitHubMCPServerVersion Version = "v0.27.0" const DefaultFirewallVersion Version = "v0.8.2" // DefaultMCPGatewayVersion is the default version of the MCP Gateway (gh-aw-mcpg) Docker image -const DefaultMCPGatewayVersion Version = "v0.0.20" +const DefaultMCPGatewayVersion Version = "v0.0.24" // DefaultMCPGatewayContainer is the default container image for the MCP Gateway const DefaultMCPGatewayContainer = "ghcr.io/githubnext/gh-aw-mcpg" diff --git a/pkg/constants/constants_test.go b/pkg/constants/constants_test.go index 4a3d75b9b7..94f0343685 100644 --- a/pkg/constants/constants_test.go +++ b/pkg/constants/constants_test.go @@ -270,7 +270,7 @@ func TestVersionConstants(t *testing.T) { {"DefaultCopilotVersion", DefaultCopilotVersion, "0.0.376"}, {"DefaultCodexVersion", DefaultCodexVersion, "0.79.0"}, {"DefaultGitHubMCPServerVersion", DefaultGitHubMCPServerVersion, "v0.27.0"}, - {"DefaultMCPGatewayVersion", DefaultMCPGatewayVersion, "v0.0.20"}, + {"DefaultMCPGatewayVersion", DefaultMCPGatewayVersion, "v0.0.24"}, {"DefaultSandboxRuntimeVersion", DefaultSandboxRuntimeVersion, "0.0.25"}, {"DefaultFirewallVersion", DefaultFirewallVersion, "v0.8.2"}, {"DefaultPlaywrightMCPVersion", DefaultPlaywrightMCPVersion, "0.0.54"},