Skip to content

Commit 40b6527

Browse files
committed
ci(experiment): trigger via PR-label wrapper; drop issue comment
1 parent ac816b6 commit 40b6527

2 files changed

Lines changed: 39 additions & 25 deletions

File tree

.github/workflows/_bug-fix-agent-experimental.yml

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@ name: Bug Fix Agent (Experimental — Visual)
55
# (xdotool, screenshots) when a unit-test reproduction is impractical. PR flow
66
# is identical to the production agent — base = main, head = fix/auto-<issue#>.
77
#
8-
# Trigger: push a commit to this branch.
9-
# git commit --allow-empty -m "trigger experiment" && git push
10-
# To push without firing a run, prefix the commit message with [skip ci].
11-
#
12-
# The branch filter pins this workflow to its dedicated experiment branch, so
13-
# it cannot fire from main or any other branch even if the file ends up there.
8+
# This workflow is `workflow_call`-only (mirrors the production agent's shape,
9+
# so the underlying `claude-code-action` only ever sees an event type it
10+
# accepts). It is invoked from `experiment-bug-fix-trigger.yml`, which fires
11+
# on `pull_request: labeled` against the experiment PR.
1412
#
1513
# This workflow operates on a single fixed issue (set in env.ISSUE_NUMBER
1614
# below). To target a different issue, edit the env var and push.
1715

1816
on:
19-
push:
20-
branches:
21-
- experiment/bug-fix-visual
17+
workflow_call:
2218

2319
concurrency:
2420
group: bug-fix-experimental-663
@@ -35,8 +31,8 @@ jobs:
3531
issues: write
3632
id-token: write
3733
env:
38-
# Issue this experiment is targeting. Hardcoded so the workflow can
39-
# be a `push:`-triggered file with no inputs. Change + push to retarget.
34+
# Issue this experiment is targeting. Hardcoded for this POC; change +
35+
# push + re-label to retarget another issue.
4036
ISSUE_NUMBER: '663'
4137
# Required by .devcontainer/devcontainer.json runArgs port mapping.
4238
# In CI we don't need the host-side noVNC tunnel; just pick a free port
@@ -297,20 +293,6 @@ jobs:
297293
--head "$BRANCH" \
298294
--label "auto-fix-experimental"
299295
300-
- name: Comment on issue (failure path)
301-
if: always() && steps.verify.outputs.result != 'success' && steps.phase1.outcome != 'skipped'
302-
env:
303-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
304-
run: |
305-
if [ -f bug-analysis.md ]; then
306-
ANALYSIS=$(cat bug-analysis.md)
307-
else
308-
ANALYSIS="The experimental agent could not analyze this bug."
309-
fi
310-
printf '## Bug Fix Agent (Experimental — Visual) — Analysis\n\n%s\n\n---\n_This is from the experimental visual flow. The production fixer may behave differently._\n' \
311-
"$ANALYSIS" > /tmp/comment-body.md
312-
gh issue comment "$ISSUE_NUMBER" --body-file /tmp/comment-body.md
313-
314296
- name: Diagnostics on failure
315297
if: failure() || steps.verify.outputs.result != 'success'
316298
run: |
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Experiment Bug-Fix Trigger
2+
3+
# Branch-only trigger for the experimental visual bug-fix agent.
4+
# Fires when label `run-experiment-bug-fix` is added to the experiment PR
5+
# (head ref `experiment/bug-fix-visual`). For same-repo PRs, GitHub uses the
6+
# workflow file from the head ref, so this workflow does not need to exist
7+
# on `main` to be eligible to run.
8+
#
9+
# To fire a run:
10+
# gh pr edit 2120 --add-label run-experiment-bug-fix
11+
# To fire again, remove the label and re-add it:
12+
# gh pr edit 2120 --remove-label run-experiment-bug-fix \
13+
# && gh pr edit 2120 --add-label run-experiment-bug-fix
14+
15+
on:
16+
pull_request:
17+
types: [labeled]
18+
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
issues: write
23+
id-token: write
24+
25+
jobs:
26+
run-experiment:
27+
name: Run Experimental Bug-Fix Agent
28+
if: >-
29+
github.event.label.name == 'run-experiment-bug-fix'
30+
&& github.head_ref == 'experiment/bug-fix-visual'
31+
uses: ./.github/workflows/_bug-fix-agent-experimental.yml
32+
secrets: inherit

0 commit comments

Comments
 (0)