Skip to content
Merged
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
19 changes: 10 additions & 9 deletions pkg/workflow/mcp_config_refactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,16 @@ func TestRenderAgenticWorkflowsMCPConfigWithOptions(t *testing.T) {
`"type": "stdio"`,
`"container": "alpine:latest"`,
`"entrypoint": "/opt/gh-aw/gh-aw"`,
`"entrypointArgs": ["mcp-server", "--actor", "\${GITHUB_ACTOR}"]`,
`"entrypointArgs": ["mcp-server", "--validate-actor"]`,
`"/opt/gh-aw:/opt/gh-aw:ro"`, // gh-aw binary mount (read-only)
`"/usr/bin/gh:/usr/bin/gh:ro"`, // gh CLI binary mount (read-only)
`"\${GITHUB_WORKSPACE}:\${GITHUB_WORKSPACE}:rw"`, // workspace mount (read-write)
`"/tmp/gh-aw:/tmp/gh-aw:rw"`, // temp directory mount (read-write)
`"args": ["--network", "host", "-w", "\${GITHUB_WORKSPACE}"]`, // Network access + working directory
`"DEBUG": "*"`,
`"GITHUB_TOKEN": "\${GITHUB_TOKEN}"`,
`"GITHUB_ACTOR": "\${GITHUB_ACTOR}"`, // Actor for role-based access control
`"GITHUB_ACTOR": "\${GITHUB_ACTOR}"`, // Actor for role-based access control
`"GITHUB_REPOSITORY": "\${GITHUB_REPOSITORY}"`, // Repository context
Comment on lines 141 to +145
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the JSON-mode tests, the dev-mode cases don’t assert that GITHUB_ACTOR / GITHUB_REPOSITORY are present in the rendered env block. Since dev mode relies on the container image CMD (documented as including --validate-actor), it seems important for the tests to cover that these env vars are wired in dev mode as well (not just release mode).

Copilot uses AI. Check for mistakes.
` },`,
},
unexpectedContent: []string{
Expand Down Expand Up @@ -279,12 +280,12 @@ func TestRenderAgenticWorkflowsMCPConfigTOML(t *testing.T) {
expectedContainer: `container = "alpine:latest"`,
shouldHaveEntrypoint: true,
expectedMounts: []string{
`entrypoint = "/opt/gh-aw/gh-aw"`, // Entrypoint needed in release mode
`entrypointArgs = ["mcp-server", "--actor", "${GITHUB_ACTOR}"]`, // EntrypointArgs needed in release mode with actor flag
`"/opt/gh-aw:/opt/gh-aw:ro"`, // gh-aw binary mount
`"/usr/bin/gh:/usr/bin/gh:ro"`, // gh CLI binary mount
`"\${GITHUB_WORKSPACE}:\${GITHUB_WORKSPACE}:rw"`, // workspace mount
`"/tmp/gh-aw:/tmp/gh-aw:rw"`, // temp directory mount
`entrypoint = "/opt/gh-aw/gh-aw"`, // Entrypoint needed in release mode
`entrypointArgs = ["mcp-server", "--validate-actor"]`, // EntrypointArgs needed in release mode with validate-actor flag
`"/opt/gh-aw:/opt/gh-aw:ro"`, // gh-aw binary mount
`"/usr/bin/gh:/usr/bin/gh:ro"`, // gh CLI binary mount
`"\${GITHUB_WORKSPACE}:\${GITHUB_WORKSPACE}:rw"`, // workspace mount
`"/tmp/gh-aw:/tmp/gh-aw:rw"`, // temp directory mount
},
unexpectedContent: []string{
`--cmd`,
Expand All @@ -304,7 +305,7 @@ func TestRenderAgenticWorkflowsMCPConfigTOML(t *testing.T) {
`[mcp_servers.agenticworkflows]`,
tt.expectedContainer,
`args = ["--network", "host", "-w", "${GITHUB_WORKSPACE}"]`, // Network access + working directory
`env_vars = ["DEBUG", "GITHUB_TOKEN", "GITHUB_ACTOR"]`,
`env_vars = ["DEBUG", "GITHUB_TOKEN", "GITHUB_ACTOR", "GITHUB_REPOSITORY"]`,
}
expectedContent = append(expectedContent, tt.expectedMounts...)

Expand Down
Loading