Skip to content

Update AWF to v0.5.0 and migrate to new container/log naming conventions#4877

Merged
Mossaka merged 9 commits into
mainfrom
copilot/update-awf-to-v0-5-0
Nov 26, 2025
Merged

Update AWF to v0.5.0 and migrate to new container/log naming conventions#4877
Mossaka merged 9 commits into
mainfrom
copilot/update-awf-to-v0-5-0

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 26, 2025

  • Update AWF version to v0.5.0
  • Migrate log directory from .copilot/logs/ to .agent/logs/
  • Update log discovery pattern from copilot-logs-* to awf-agent-logs-*
  • Add backward compatibility for legacy copilot-logs-* pattern
  • Update shell variables from COPILOT_LOGS_DIR to AGENT_LOGS_DIR
  • Update CI artifacts from copilot-logs to agent-logs
  • Update all test assertions

Test Failure Investigation

The CI failure in workflow run 19717558809 was investigated. The failing tests are:

  1. TestTopLevelGitHubTokenPrecedence/safe-outputs_github-token_overrides_top-level
  2. TestNeutralToolsIntegration

Finding: These are pre-existing test failures on main, not caused by this PR's changes.

Evidence:

  • Same tests fail on main branch CI (19717645326)
  • Failures were introduced by PRs merged after commit 258450b ("Add smoke-copilot-no-firewall workflow")
  • Last passing main CI was 19716106451

The AWF v0.5.0 migration changes (version bump, log directory naming, backward-compatible log discovery) are unrelated to these test failures.

Original prompt

you are tasked to update the awf version to v0.5.0 and migrate to the following breaking changes:

The new change renames internal "copilot" references to "agent" to better reflect support for multiple AI coding agents (GitHub Copilot CLI, Claude Code). This is a breaking change.

Breaking Changes Summary

Component Before After
Container name awf-copilot awf-agent
Docker image ghcr.io/.../copilot:* ghcr.io/.../agent:*
Log directories /tmp/copilot-logs-* /tmp/awf-agent-logs-*
Container directory containers/copilot/ containers/agent/
Config field copilotCommand agentCommand
Function name runCopilotCommand() runAgentCommand()
Internal variables copilotIp, copilotVolumes, copilotService agentIp, agentVolumes, agentService

Unchanged: External references to GitHub Copilot CLI (@github/copilot npm package, ~/.copilot/ paths) remain unchanged.


Docker Image Backward Compatibility

Existing published images are NOT deleted. The rename only affects new releases.

Image Status After Merge
ghcr.io/.../copilot:v0.3.0 Still available in GHCR
ghcr.io/.../copilot:latest Still available, frozen at last pre-rename release
ghcr.io/.../agent:v0.4.0+ New images going forward
ghcr.io/.../agent:latest Will be the new "latest" after first release

Safe migration path:

  1. Consumers pinned to v0.3.0 continue working with old copilot images
  2. Update consumer code (gh-aw) to expect new log paths
  3. Bump version to new release which uses agent images

Code Quality Analysis

Strengths

  • Clean, systematic rename across all source files
  • Good separation of internal naming (agent) vs external product references (GitHub Copilot CLI)
  • Documentation updated comprehensively (12 files)
  • CI/CD workflows properly updated

Potential Issues

  • No backward compatibility layer - This is intentional per PR description ("clean cut")
  • Consumer repos must update simultaneously or coordinate version pinning

Migration Guide for Consumer Repo (gh-aw)

Critical Files Requiring Updates

1. Log Directory Constants

File: pkg/workflow/copilot_engine.go

// Line 14: Update log folder constant
// BEFORE:
const logsFolder = "/tmp/gh-aw/.copilot/logs/"

// AFTER:
const logsFolder = "/tmp/gh-aw/.agent/logs/"

2. Log Discovery Pattern

File: pkg/workflow/copilot_engine.go

# Lines 260-267: Update log directory search pattern
# BEFORE (embedded in command string at line 255-267):
COPILOT_LOGS_DIR="$(find /tmp -maxdepth 1 -type d -name 'copilot-logs-*' -print0 2>/dev/null | xargs -0 ls -td 2>/dev/null | head -1)"
if [ -n "$COPILOT_LOGS_DIR" ] && [ -d "$COPILOT_LOGS_DIR" ]; then
  echo "Moving Copilot logs from $COPILOT_LOGS_DIR to %s"

# AFTER:
AGENT_LOGS_DIR="$(find /tmp -maxdepth 1 -type d -name 'awf-agent-logs-*' -print0 2>/dev/null | xargs -0 ls -td 2>/dev/null | head -1)"
if [ -n "$AGENT_LOGS_DIR" ] && [ -d "$AGENT_LOGS_DIR" ]; then
  echo "Moving agent logs from $AGENT_LOGS_DIR to %s"

Also update the subsequent references from $COPILOT_LOGS_DIR to $AGENT_LOGS_DIR in lines 262-267.

3. Test File Assertions

File: pkg/workflow/copilot_engine_test.go

Update all test assertions that check for .copilot/logs/ paths:

  • Lines 128-130: mkdir -p /tmp/gh-aw/.copilot/logs/.agent/logs/
  • Line 168: Expected path assertion
  • Lines 915-917: GH_AW_AGENT_OUTPUT env var path
  • Line 961: Test data --log-dir parameter

File: pkg/workflow/agentic_output_test.go

  • Lines 242, 281-282, 286-287: Update .copilot/logs/ references to .agent/logs/

4. CI/CD Workflow

File: .github/workflows/test-copilot-github-integration.yml

# Lines 84-88: Update artifact naming and paths
# BEFORE:
name: copilot-logs
path: |
  /tmp/gh-aw/agent-stdio.log
  /tmp/gh-aw/.copilot/logs/

# AFTER:
name: agent-logs
path: |
  /tmp/gh-aw/agent-stdio.log
  /tmp/gh-aw/.agent/logs/

5. Domain Configuration (Optional but Recommended)

File: pkg/workflow/domains.go

Consider renaming for consistency:

  • CopilotDefaultDomainsAgentDefaultDomains
  • GetCopilotAllowedDomains()GetAgentAllowedDomains()

Migration Checklist

For gh-aw Consumers

  • Update logsFolder constant in pkg/workflow/copilot_engine.go
  • Update log discovery pattern from copilot-logs-* to awf-agent-logs-*
  • Update variable names from COPILOT_LOGS_DIR to AGENT_LOGS_DIR
  • Update all test assertions in copilot_engine_test.go
  • Update test assertions in agentic_output_test.go
  • Update CI workflow artifact names and paths
  • (Optional) Rename domain functions/constants for consistency
  • Update DefaultFirewallVersion in pkg/constants/constants.go to the new release version
  • Run full test suite: `go t...

💡 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.

Copilot AI and others added 2 commits November 26, 2025 20:22
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Update awf version to v0.5.0 and migrate copilot references to agent Update AWF to v0.5.0 and migrate to new container/log naming conventions Nov 26, 2025
Copilot AI requested a review from Mossaka November 26, 2025 20:45
@Mossaka Mossaka marked this pull request as ready for review November 26, 2025 20:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 26, 2025

✅ Agentic Changeset Generator completed successfully.

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot make sure to update the workflow run trace parsing (must be backward compatible) for the new naming convention.

github-actions Bot and others added 2 commits November 26, 2025 20:49
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot make sure to update the workflow run trace parsing (must be backward compatible) for the new naming convention.

Added backward compatibility for workflow run trace parsing in commit 867b886.

The log discovery pattern now checks for both the new awf-agent-logs-* naming convention (AWF v0.5.0+) and the legacy copilot-logs-* naming convention, ensuring older workflow runs continue to be parsed correctly:

AGENT_LOGS_DIR="$(find /tmp -maxdepth 1 -type d \( -name 'awf-agent-logs-*' -o -name 'copilot-logs-*' \) -print0 2>/dev/null | xargs -0 ls -td 2>/dev/null | head -1)"

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 26, 2025

✅ Agentic Changeset Generator completed successfully.

@Mossaka
Copy link
Copy Markdown
Contributor

Mossaka commented Nov 26, 2025

@copilot can you figure out why this test is failing, update your pr description with your findings, and then resolve the issue? https://github.com/githubnext/gh-aw/actions/runs/19717558809/job/56493386225?pr=4877

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot can you figure out why this test is failing, update your pr description with your findings, and then resolve the issue? https://github.com/githubnext/gh-aw/actions/runs/19717558809/job/564933...

The test failures are pre-existing issues on main, not caused by this PR's AWF v0.5.0 changes.

Failing tests:

  1. TestTopLevelGitHubTokenPrecedence/safe-outputs_github-token_overrides_top-level
  2. TestNeutralToolsIntegration

Evidence:

  • These tests also fail on the main branch (verified in CI run 19717645326)
  • The failures were introduced by recent PRs merged to main (specifically around "Embed frontmatter YAML" - commit 54de362)
  • The last passing CI on main was 19716106451 before those PRs

This PR's changes (AWF version bump, log directory naming, backward-compatible log discovery) are unrelated to these test failures.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@Mossaka Mossaka merged commit dfd7700 into main Nov 26, 2025
17 checks passed
@Mossaka Mossaka deleted the copilot/update-awf-to-v0-5-0 branch November 26, 2025 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants