Skip to content

fix(smoke-services): add GitHub Actions services block and use --allow-host-service-ports#1729

Merged
lpcox merged 3 commits intomainfrom
copilot/fix-smoke-services-failure
Apr 6, 2026
Merged

fix(smoke-services): add GitHub Actions services block and use --allow-host-service-ports#1729
lpcox merged 3 commits intomainfrom
copilot/fix-smoke-services-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 6, 2026

The smoke-services workflow could never succeed: no GitHub Actions services: block existed to start Redis or PostgreSQL, and the AWF sandbox used --enable-host-access (broad) instead of --allow-host-service-ports (the flag the workflow is supposed to validate).

Changes

  • smoke-services.lock.yml — agent job: Add services: block with Redis 7-alpine (6379) and PostgreSQL 15-alpine (5432), each with health checks. Replace --enable-host-access with --allow-host-service-ports 6379,5432 in the AWF invocation. The detection job retains --enable-host-access.

  • postprocess-smoke-workflows.ts: Add smoke-services-specific post-processing so both changes survive recompiles from the .md source (idempotent; warns if expected patterns are missing). The --allow-host-service-ports replacement is scoped to the agent job via a regex anchored to the long single-quoted --allow-domains list, which is unique to that job.

services:
  redis:
    image: redis:7-alpine
    ports: [6379:6379]
    options: --health-cmd "redis-cli ping" ...
  postgres:
    image: postgres:15-alpine
    env: { POSTGRES_USER: postgres, POSTGRES_PASSWORD: testpass, POSTGRES_DB: smoketest }
    ports: [5432:5432]
    options: --health-cmd pg_isready ...

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/repos/github/gh-aw-firewall/actions/artifacts/6294810963/zip
    • Triggering command: /usr/bin/gh gh api repos/github/gh-aw-firewall/actions/artifacts/6294810963/zip --header Accept: application/vnd.github+json (http block)
  • https://api.github.com/repos/github/gh-aw-firewall/actions/runs/24052321097/artifacts
    • Triggering command: /usr/bin/gh gh run download 24052321097 --repo github/gh-aw-firewall --name agent --dir /tmp/agent-logs-run (http block)

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

Copilot AI linked an issue Apr 6, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix smoke services workflow failure fix(smoke-services): add GitHub Actions services block and use --allow-host-service-ports Apr 6, 2026
Copilot AI requested a review from lpcox April 6, 2026 22:45
Copilot finished work on behalf of lpcox April 6, 2026 22:45
@lpcox lpcox marked this pull request as ready for review April 6, 2026 23:06
@lpcox lpcox requested a review from Mossaka as a code owner April 6, 2026 23:06
Copilot AI review requested due to automatic review settings April 6, 2026 23:06
Copy link
Copy Markdown
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

Fixes the smoke-services workflow so it can actually validate host service port access by starting required GitHub Actions service containers (Redis/PostgreSQL) and using the narrower --allow-host-service-ports flag in the agent sandbox.

Changes:

  • Add a GitHub Actions services: block to the smoke-services agent job for Redis (6379) and PostgreSQL (5432), including health checks.
  • Replace --enable-host-access with --allow-host-service-ports 6379,5432 in the agent job’s awf invocation.
  • Extend postprocess-smoke-workflows.ts to re-apply these workflow adjustments after recompilation from the .md source.
Show a summary per file
File Description
scripts/ci/postprocess-smoke-workflows.ts Adds smoke-services-specific post-processing to inject services: and rewrite the awf host-access flag in the compiled lock workflow.
.github/workflows/smoke-services.lock.yml Adds Redis/PostgreSQL services: to the agent job and swaps --enable-host-access for --allow-host-service-ports 6379,5432.

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment on lines +353 to +360
if (!agentJobHostServicePortsRegex.test(content)) {
if (agentJobEnableHostAccessRegex.test(content)) {
const matchCount = (content.match(agentJobEnableHostAccessRegex) || []).length;
if (matchCount > 1) {
console.warn(
` WARNING: Found ${matchCount} matches for agent job --enable-host-access pattern. ` +
`Only the first will be replaced. Manual review recommended.`
);
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

matchCount is computed via content.match(agentJobEnableHostAccessRegex).length, but since the regex is non-global this returns the length of the match array (full match + capture groups), not the number of occurrences. With two capture groups, this will always be 3 on a single match and will always trigger the “multiple matches” warning incorrectly. Use a global regex (or matchAll) for counting occurrences, or remove the count/warning if the pattern is guaranteed unique.

Copilot uses AI. Check for mistakes.
Comment on lines +345 to +346
// in single quotes (the detection job uses a shorter unquoted domain list). We use
// a non-greedy match anchored to --build-local to avoid cross-line over-matching.
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

The comment says the --allow-domains ... match is “non-greedy”, but the regex uses [^\n]* which is greedy. Either make the quantifier non-greedy (to match the comment) or update the comment so future readers aren’t misled about how much of the command line can be consumed by the pattern.

Suggested change
// in single quotes (the detection job uses a shorter unquoted domain list). We use
// a non-greedy match anchored to --build-local to avoid cross-line over-matching.
// in single quotes (the detection job uses a shorter unquoted domain list). We match
// only within a single line and bound the match with the later --build-local flag to
// avoid cross-line over-matching.

Copilot uses AI. Check for mistakes.
@lpcox
Copy link
Copy Markdown
Collaborator

lpcox commented Apr 6, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 6, 2026

@copilot apply changes based on the comments in this thread

Fixed in 367f53c:

  1. Match count bug: Replaced content.match(agentJobEnableHostAccessRegex).length (which always returned 3 due to capture groups) with content.match(new RegExp(..., 'g')).length to count actual occurrences.
  2. Misleading comment: Updated "non-greedy" to accurately describe the greedy [^\n]* quantifier.

Copilot finished work on behalf of lpcox April 6, 2026 23:13
@lpcox lpcox enabled auto-merge (squash) April 6, 2026 23:17
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 86.20% 86.29% 📈 +0.09%
Statements 86.07% 86.16% 📈 +0.09%
Functions 87.41% 87.41% ➡️ +0.00%
Branches 78.56% 78.61% 📈 +0.05%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/docker-manager.ts 86.6% → 87.0% (+0.39%) 86.1% → 86.5% (+0.38%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Smoke test results — run 24055842277

✅ GitHub MCP: #1722 "feat: propagate host.docker.internal to child containers", #1721 "fix: enforce shared net namespace for child containers"
✅ Playwright: github.com title contains "GitHub"
✅ File write: /tmp/gh-aw/agent/smoke-test-claude-24055842277.txt created and verified
✅ Bash: file content confirmed

Overall: PASS

💥 [THE END] — Illustrated by Smoke Claude

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Smoke Test Results

Test Result
GitHub MCP connectivity ✅ Listed PRs successfully
GitHub.com HTTP ⚠️ Pre-step data unavailable (template vars not expanded)
File write/read ⚠️ Pre-step data unavailable (template vars not expanded)

PR: fix(smoke-services): add GitHub Actions services block and use --allow-host-service-ports
Author: @Copilot | Assignees: @lpcox, @Copilot

Overall: PARTIAL — MCP ✅, pre-step smoke data missing (workflow outputs not populated)

📰 BREAKING: Report filed by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Smoke Test: GitHub Actions Services Connectivity

Service Check Result
Redis (host.docker.internal:6379) PING PONG
PostgreSQL (host.docker.internal:5432) pg_isready ✅ accepting connections
PostgreSQL smoketest DB psql SELECT 1 ✅ returned 1

All checks passed. (redis-cli was not pre-installed; Redis connectivity verified via Python socket.)

🔌 Service connectivity validated by Smoke Services

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Smoke test results:
PR titles: "feat: support npm install -g in agent container"; "fix: enable color output when --tty flag is set"

  1. GitHub MCP (last 2 merged PRs): ✅
  2. safeinputs-gh PR query: ❌ (tool unavailable in this runtime)
  3. Playwright github.com title contains "GitHub": ❌ (Playwright EACCES log-path error)
  4. Tavily web search results returned: ❌ (Tavily MCP unavailable)
  5. File write in /tmp/gh-aw/agent: ✅
  6. Bash cat readback: ✅
  7. Discussion query + oracle comment: ✅ (fallback query method; comment posted)
  8. npm ci && npm run build: ✅
    Overall status: FAIL

🔮 The oracle has spoken through Smoke Codex

@github-actions github-actions bot mentioned this pull request Apr 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx All passed ✅ PASS
Node.js execa All passed ✅ PASS
Node.js p-limit All passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for issue #1729 · ● 613.1K ·

@lpcox lpcox merged commit 8205cfd into main Apr 6, 2026
57 of 59 checks passed
@lpcox lpcox deleted the copilot/fix-smoke-services-failure branch April 6, 2026 23:39
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.

[aw] Smoke Services failed

3 participants