Skip to content

Fix MCP config tests for --validate-actor flag and GITHUB_REPOSITORY env var#15154

Merged
pelikhan merged 2 commits intocopilot/add-actor-flag-supportfrom
copilot/fix-tests-please-work
Feb 12, 2026
Merged

Fix MCP config tests for --validate-actor flag and GITHUB_REPOSITORY env var#15154
pelikhan merged 2 commits intocopilot/add-actor-flag-supportfrom
copilot/fix-tests-please-work

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

Tests failed after recent changes to the MCP server configuration that switched from --actor "${GITHUB_ACTOR}" to --validate-actor flag and added GITHUB_REPOSITORY environment variable.

Changes

Updated test expectations in mcp_config_refactor_test.go:

  • Entrypoint args: Changed from ["mcp-server", "--actor", "${GITHUB_ACTOR}"] to ["mcp-server", "--validate-actor"]
  • Environment variables: Added GITHUB_REPOSITORY to expected list: ["DEBUG", "GITHUB_TOKEN", "GITHUB_ACTOR", "GITHUB_REPOSITORY"]

Affected tests:

  • TestRenderAgenticWorkflowsMCPConfigWithOptions
  • TestRenderAgenticWorkflowsMCPConfigTOML

The --validate-actor flag now reads actor and repository context from environment variables instead of CLI arguments, enabling cleaner role-based access control validation.

Original prompt

Reference: https://github.com/github/gh-aw/actions/runs/21946871892/job/63386687743#step:9:1

Fix tests


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…env var

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing tests in the codebase Fix MCP config tests for --validate-actor flag and GITHUB_REPOSITORY env var Feb 12, 2026
Copilot AI requested a review from pelikhan February 12, 2026 12:49
@pelikhan pelikhan marked this pull request as ready for review February 12, 2026 14:12
Copilot AI review requested due to automatic review settings February 12, 2026 14:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates MCP config rendering tests to match the recent MCP server config changes (switching to --validate-actor and including GITHUB_REPOSITORY in the environment context).

Changes:

  • Updated expected entrypointArgs from --actor ${GITHUB_ACTOR} to --validate-actor.
  • Updated expected environment variable set to include GITHUB_REPOSITORY in both JSON and TOML test assertions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 141 to +145
`"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
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.
@pelikhan pelikhan merged commit 398e4d1 into copilot/add-actor-flag-support Feb 12, 2026
6 checks passed
@pelikhan pelikhan deleted the copilot/fix-tests-please-work branch February 12, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants