Add CLI build steps for dev mode in agentic-workflows action#13996
Add CLI build steps for dev mode in agentic-workflows action#13996
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
❌ Changeset Generator failed. Please review the logs for details. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident... |
|
@copilot you are not creating a release build. use the build command from ci.yml build |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent Container Tool Check
Result: 10/12 tools fully verified ✅, 2 tools present but untestable due to shell corruption Note: Java and .NET binaries are present in the container (
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
✅ Changeset Generator completed successfully! |
Agent Container Tool Check
Result: 12/12 tools available ✅ *Note: Java and dotnet binaries are present and executable but version detection encountered shell environment issues. Java binary confirmed at
|
Smoke Test Results✅ PASS - All tests passed Recent PRs:
Test Status:
Run: §21733013111 cc: @pelikhan
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
There was a problem hiding this comment.
Pull request overview
This pull request enhances the agentic-workflows action dev mode by implementing local CLI build steps and optimizing the MCP server configuration. The changes enable workflows to build the gh-aw CLI and Docker image locally during execution in dev mode, eliminating the need for external binary mounts while simplifying the configuration.
Changes:
- Added CLI build steps generation in dev mode for workflows using the agentic-workflows tool
- Updated MCP server configuration to use locally built Docker image (
localhost/gh-aw:dev) in dev mode versus Alpine with mounted binaries in release mode - Modified Docker image predownload logic to skip the locally-built image and updated Dockerfile CMD to run MCP server by default
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pkg/constants/constants.go |
Added DevModeGhAwImage constant for locally built Docker image tag |
pkg/workflow/docker.go |
Updated collectDockerImages() to skip alpine:latest in dev mode since localhost/gh-aw:dev is built locally |
pkg/workflow/compiler_yaml_main_job.go |
Added generateDevModeCLIBuildSteps() function that conditionally generates Go setup, CLI build, Docker Buildx setup, and image build steps |
pkg/workflow/mcp_config_builtin.go |
Refactored renderAgenticWorkflowsMCPConfigWithOptions() and renderAgenticWorkflowsMCPConfigTOML() to use different container images, entrypoints, and mounts based on action mode |
pkg/workflow/mcp_renderer.go |
Updated renderAgenticWorkflowsTOML() to handle dev vs release mode configuration differences |
pkg/workflow/mcp_setup_generator.go |
Updated collectDockerImages() call to pass actionMode parameter |
Dockerfile |
Changed default CMD from ["--help"] to ["mcp-server", "--cmd", "gh-aw"] to align with dev mode container usage |
| Test files | Updated tests to verify dev mode behavior, including new tests for container selection, entrypoint/args absence, mount verification, and environment variables |
| Lock files (.github/workflows/*.lock.yml) | Regenerated 23 workflows with build steps and updated MCP configuration; 122 workflows without agentic-workflows tool remain unchanged |
.changeset/patch-document-agentic-workflows-cli.md |
Added changeset documenting the changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Completed: Update agentic-workflows action dev mode to build CLI locally
Summary
Successfully implemented CLI build steps for dev mode and fully optimized the MCP configuration to use the built Docker image's defaults for minimal configuration overhead.
Implementation Steps
DevModeGhAwImage = "localhost/gh-aw:dev"/opt/gh-aw:/opt/gh-aw:romount (binary is in the image)/usr/bin/gh:/usr/bin/gh:romount (gh CLI is in the image)DEBUGenvironment variable (set to "*" for full logging)GH_TOKENenvironment variableGITHUB_TOKENenvironment variableCMD ["--help"]toCMD ["mcp-server", "--cmd", "gh-aw"]-ldflags "-X 'github.com/github/gh-aw/pkg/workflow.isReleaseBuild=false'"-ldflags "-s -w -X main.version=${VERSION}"(matches CI/Makefile)Conditional Build Steps
Build steps are now only generated when:
devANDagentic-workflowstool is enabled in the workflowThis optimization removed unnecessary build steps from 122 workflows that don't use the agentic-workflows tool, avoiding wasteful build operations.
Container Predownload Optimization
In dev mode,
localhost/gh-aw:devis NOT added to the predownload list because:Dockerfile Changes
Dev Mode Configuration
Minimal configuration - leverages container's ENTRYPOINT and CMD defaults:
{ "agentic_workflows": { "container": "localhost/gh-aw:dev", "mounts": [ "${{ github.workspace }}:${{ github.workspace }}:rw", "/tmp/gh-aw:/tmp/gh-aw:rw" ], "env": { "DEBUG": "*", "GH_TOKEN": "\${GH_TOKEN}", "GITHUB_TOKEN": "\${GITHUB_TOKEN}" } } }Release Mode Configuration
Full configuration with explicit entrypoint and args:
{ "agentic_workflows": { "container": "alpine:latest", "entrypoint": "/opt/gh-aw/gh-aw", "entrypointArgs": ["mcp-server"], "mounts": [ "/opt/gh-aw:/opt/gh-aw:ro", "/usr/bin/gh:/usr/bin/gh:ro", "${{ github.workspace }}:${{ github.workspace }}:rw", "/tmp/gh-aw:/tmp/gh-aw:rw" ], "env": { "DEBUG": "*", "GH_TOKEN": "\${GH_TOKEN}", "GITHUB_TOKEN": "\${GITHUB_TOKEN}" } } }Container Predownload
localhost/gh-aw:dev(built locally in workflow)alpine:latest(pulled from Docker Hub)Build command:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Changeset
.github/awinstructions,.github/agents/agentic-workflowsdispatcher, and the supporting workflow definitions added in this PR.