[3e552255] fix(ci): scope agent-image-smoke.yml trigger to paths only, add PR comment

The workflow was gated by `branches: [master]` on both push and
pull_request, but this repo's task-hierarchy PRs open against nested
parent feature branches, not master, until root->master assembly - so
the workflow never fired on a dev-level PR and produced zero evidence.
Drop the branch filter (path scoping is sufficient) and post the
size-delta table + smoke-check output as a PR comment via
actions/github-script, since no agent role has gh CLI or GitHub API
read access to pull check-run output directly.
This commit is contained in:
Backend Developer 1
2026-07-10 05:43:22 +00:00
parent 29f8f095f0
commit 747e4d748c
+29 -6
View File
@@ -9,16 +9,18 @@ name: Agent Image Smoke (Playwright)
on: on:
push: push:
branches:
- master
paths: paths:
- 'docker/agent-base.Dockerfile' - 'docker/agent-base.Dockerfile'
- 'docker/agent-qa-fe.Dockerfile' - 'docker/agent-qa-fe.Dockerfile'
- 'docker/agent-ux.Dockerfile' - 'docker/agent-ux.Dockerfile'
- '.github/workflows/agent-image-smoke.yml' - '.github/workflows/agent-image-smoke.yml'
pull_request: pull_request:
branches: # No `branches:` filter — this repo's task hierarchy opens dev-level
- master # PRs against nested parent feature branches (e.g.
# feature/backend/<root>--<cell>--<subcell>), not directly against
# master, so a `branches: [master]` filter here would only ever fire
# once the assembled PR reaches root->master — too late to give QA/PM
# real evidence at the dev-PR review stage this task exists for.
paths: paths:
- 'docker/agent-base.Dockerfile' - 'docker/agent-base.Dockerfile'
- 'docker/agent-qa-fe.Dockerfile' - 'docker/agent-qa-fe.Dockerfile'
@@ -30,6 +32,8 @@ jobs:
playwright-smoke: playwright-smoke:
name: Build QA images, verify headless chromium launch + size delta name: Build QA images, verify headless chromium launch + size delta
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
pull-requests: write
steps: steps:
- name: Checkout code - name: Checkout code
@@ -68,10 +72,15 @@ jobs:
delta_mb=$(( (after_bytes - before_bytes) / 1024 / 1024 )) delta_mb=$(( (after_bytes - before_bytes) / 1024 / 1024 ))
echo "| ${name} | $(( before_bytes / 1024 / 1024 ))MB | $(( after_bytes / 1024 / 1024 ))MB | +${delta_mb}MB |" echo "| ${name} | $(( before_bytes / 1024 / 1024 ))MB | $(( after_bytes / 1024 / 1024 ))MB | +${delta_mb}MB |"
done done
} | tee -a "$GITHUB_STEP_SUMMARY" } | tee -a "$GITHUB_STEP_SUMMARY" /tmp/smoke-report.md
- name: Headless chromium launch smoke check - name: Headless chromium launch smoke check
run: | run: |
{
echo
echo "### Headless chromium launch smoke check"
echo
} | tee -a /tmp/smoke-report.md
for name in agent-qa-fe agent-ux; do for name in agent-qa-fe agent-ux; do
echo "::group::${name} headless launch smoke" echo "::group::${name} headless launch smoke"
docker run --rm --entrypoint /app/.venv/bin/python "${name}:after" -c ' docker run --rm --entrypoint /app/.venv/bin/python "${name}:after" -c '
@@ -83,6 +92,20 @@ jobs:
assert page.title() == "" assert page.title() == ""
browser.close() browser.close()
print("PLAYWRIGHT_SMOKE_OK") print("PLAYWRIGHT_SMOKE_OK")
' ' | tee -a /tmp/smoke-report.md
echo "::endgroup::" echo "::endgroup::"
done done
- name: Post results as a PR comment
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const body = fs.readFileSync('/tmp/smoke-report.md', 'utf8');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `## Agent Image Smoke (Playwright) results\n\n${body}`,
});