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
6 changes: 3 additions & 3 deletions .github/workflows/campaign-generator.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 19 additions & 2 deletions actions/setup/js/parse_mcp_gateway_log.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,35 @@ 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)
*/

/**
* Main function to parse and display MCP gateway logs
*/
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 = "";

Expand Down
4 changes: 4 additions & 0 deletions actions/setup/js/parse_mcp_gateway_log.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/constants/constants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
Loading