Plan: E2E Targeted Workflow — Wait for Result#
Summary#
Modify .github/workflows/e2e-targeted.yml so the dispatch-e2e job polls the dispatched agent-core-e2e run to completion and fails the PR check if E2E tests fail. Currently the workflow fires-and-forgets, making the PR check cosmetic.
Files#
| File | Action | Description |
|---|---|---|
.github/workflows/e2e-targeted.yml | modify | Add poll-and-wait logic after dispatch; report E2E conclusion as job exit code |
Steps#
- Add
statuses: writepermission to the workflow'spermissionsblock — needed to create commit statuses reporting E2E results back to the PR. - Capture the dispatched run ID — after
gh workflow run, usegh run list --repo AgentSDE/agent-core-e2e --workflow=e2e.ymlfiltered bycreatedtimestamp to identify the specific run triggered by this dispatch. Use a short retry loop (up to ~60s) to handle the delay between dispatch and run creation. - Poll the run to completion — use
gh run watch <run-id> --repo AgentSDE/agent-core-e2e --exit-statusto block until the run finishes. Set atimeout-minuteson the job (30 min) as a safety cap. - Fail on non-success conclusion —
gh run watch --exit-statusexits non-zero if the run fails or is cancelled, which will fail the job automatically. Capture the conclusion for the status message. - Post commit status to the PR — use
gh api repos/AgentSDE/agent-core/statuses/${{ github.event.pull_request.head.sha }}to create a commit status with the E2E conclusion (success/failure), linking to the dispatched run URL. - Handle concurrent dispatches — each dispatch captures its own run ID by filtering on a unique identifier (timestamp window + module list). Each job instance tracks only its own run.
Verification#
- Open a PR touching
src/invoke/**→ workflow dispatches E2E, waits, and reports pass/fail as a commit status on the PR. - If E2E fails, the
dispatch-e2ejob shows red — not green. - Two concurrent PRs each track their own dispatched run independently.
Risks#
- Run identification race: Between dispatch and
gh run list, another dispatch could create a run. Mitigated by filtering on a narrow timestamp window and the specific workflow. - E2E concurrency queue:
agent-core-e2ehascancel-in-progress: false, so queued runs may take longer. The 30-min timeout handles this.