-
Notifications
You must be signed in to change notification settings - Fork 367
Recompile workflow lockfiles to align generated Actions with current compiler output #27003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -477,9 +477,9 @@ Test that TAVILY_API_KEY is passed to gateway container. | |
| "Docker command should include -e TAVILY_API_KEY before the container image") | ||
| } | ||
|
|
||
| // TestMCPGatewayDockerCommandUsesRunnerIdentityAndSocketGroup verifies the gateway docker command | ||
| // computes and uses runner UID/GID and docker socket group values in the generated command. | ||
| func TestMCPGatewayDockerCommandUsesRunnerIdentityAndSocketGroup(t *testing.T) { | ||
| // TestMCPGatewayDockerCommandIncludesDockerSocketGroup verifies the gateway docker command | ||
| // adds the docker socket group as a supplementary group for non-root execution. | ||
| func TestMCPGatewayDockerCommandIncludesDockerSocketGroup(t *testing.T) { | ||
| frontmatter := `--- | ||
| on: workflow_dispatch | ||
| engine: copilot | ||
|
|
@@ -508,31 +508,16 @@ tools: | |
| require.NoError(t, err, "Failed to read output file") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good cleanup — removing the |
||
| yamlStr := string(content) | ||
|
|
||
| userSnippet := `--user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"'` | ||
| groupAddSnippet := `--group-add '"${DOCKER_SOCK_GID}"'` | ||
| mountSnippet := `-v /var/run/docker.sock:/var/run/docker.sock` | ||
| uidComputeSnippet := `MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0')` | ||
| runnerGIDComputeSnippet := `MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0')` | ||
| socketGIDComputeSnippet := `DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0')` | ||
| require.Contains(t, yamlStr, uidComputeSnippet, | ||
| "Shell should compute MCP_GATEWAY_UID before docker command") | ||
| require.Contains(t, yamlStr, runnerGIDComputeSnippet, | ||
| "Shell should compute MCP_GATEWAY_GID before docker command") | ||
| require.Contains(t, yamlStr, userSnippet, | ||
| "Docker command should include runner UID/GID user mapping") | ||
| require.Contains(t, yamlStr, socketGIDComputeSnippet, | ||
| gidComputeSnippet := `DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0')` | ||
| require.Contains(t, yamlStr, gidComputeSnippet, | ||
| "Shell should compute DOCKER_SOCK_GID before docker command") | ||
| require.Contains(t, yamlStr, groupAddSnippet, | ||
| "Docker command should include docker socket supplementary group mapping") | ||
| require.Contains(t, yamlStr, mountSnippet, | ||
| "Docker command should mount the Docker socket") | ||
| require.Less(t, strings.Index(yamlStr, uidComputeSnippet), strings.Index(yamlStr, userSnippet), | ||
| "MCP_GATEWAY_UID should be computed before it is used in the docker command") | ||
| require.Less(t, strings.Index(yamlStr, runnerGIDComputeSnippet), strings.Index(yamlStr, userSnippet), | ||
| "MCP_GATEWAY_GID should be computed before it is used in the docker command") | ||
| require.Less(t, strings.Index(yamlStr, userSnippet), strings.Index(yamlStr, groupAddSnippet), | ||
| "Docker command should include user mapping before supplementary group mapping") | ||
| require.Less(t, strings.Index(yamlStr, socketGIDComputeSnippet), strings.Index(yamlStr, groupAddSnippet), | ||
| require.Less(t, strings.Index(yamlStr, gidComputeSnippet), strings.Index(yamlStr, groupAddSnippet), | ||
| "DOCKER_SOCK_GID should be computed before it is used in the docker command") | ||
| require.Less(t, strings.Index(yamlStr, groupAddSnippet), strings.Index(yamlStr, mountSnippet), | ||
| "Docker command should add supplementary group before mounting the Docker socket") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of
--user \$\{MCP_GATEWAY_UID}:\$\{MCP_GATEWAY_GID}simplifies the docker command. Since the gateway now runs as the default container user, confirm that any files it writes to/tmpare still accessible by downstream steps (e.g., log redaction). A comment here noting the intended user context would help future readers.