@andwhy/e2e-pipeline 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andwhy/e2e-pipeline",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Scaffolds the full e2e testing pipeline: agent-assisted Playwright tests, CI runs against Vercel previews, and Checkly monitors that follow production deploys",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -261,7 +261,12 @@ jobs:
261
261
  git config user.name "github-actions[bot]"
262
262
  git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
263
263
  git checkout -b "$branch"
264
- git add -A -- ':(exclude).checkly-heal'
264
+ # Stage everything, then unstage the agent's scratch dir. An
265
+ # ':(exclude).checkly-heal' pathspec looks equivalent but exits 1
266
+ # when the path is gitignored (as init makes it), which killed
267
+ # every PR step before a commit existed.
268
+ git add -A
269
+ git reset -q -- .checkly-heal
265
270
  git commit -m "Heal Checkly check: $CHECK_NAME"
266
271
  git push -u origin "$branch"
267
272
 
@@ -309,11 +314,23 @@ jobs:
309
314
  APP_CHANGE: ${{ steps.outcome.outputs.app_change }}
310
315
  PR_URL: ${{ steps.pr.outputs.url }}
311
316
  RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
317
+ BRANCH: checkly-heal/${{ steps.guard.outputs.slug }}-${{ github.run_id }}
312
318
  run: |
313
- case "${MODE}:${CLASSIFICATION}" in
319
+ # A fix only reaches review through a PR. When the PR step failed,
320
+ # "fix ready for review" would be false: report the failure and
321
+ # offer the re-run instead.
322
+ outcome="$CLASSIFICATION"
323
+ if { [ "$CLASSIFICATION" = "healed" ] || [ "$CLASSIFICATION" = "flaky" ]; } && [ -z "$PR_URL" ]; then
324
+ outcome="pr-failed"
325
+ fi
326
+
327
+ case "${MODE}:${outcome}" in
314
328
  repeat:*)
315
329
  title=":rotating_light: *\`$CHECK_NAME\` is failing again*"
316
330
  body="A heal PR for this check merged within the last $REPEAT_WINDOW_DAYS days, so no second automatic fix was attempted. This needs a developer." ;;
331
+ *:pr-failed)
332
+ title=":rotating_light: *\`$CHECK_NAME\` failed — fix made, but the PR could not be opened*"
333
+ body="The agent classified this as $CLASSIFICATION and made a fix, then opening the PR failed, so nothing reached review. If branch \`$BRANCH\` exists, open the PR from it; otherwise check the run logs and re-run the heal. Agent diagnosis: $SUMMARY" ;;
317
334
  *:healed)
318
335
  title=":wrench: *\`$CHECK_NAME\` failed — fix ready for review*"
319
336
  body="$SUMMARY" ;;
@@ -339,6 +356,8 @@ jobs:
339
356
  # label it as what it is rather than defaulting to agent-failed.
340
357
  label="${CLASSIFICATION:-agent-failed}"
341
358
  [ "$MODE" = "repeat" ] && label="repeat-offender"
359
+ # agent-failed also renders the Re-run heal button.
360
+ [ "$outcome" = "pr-failed" ] && label="agent-failed"
342
361
 
343
362
  # Failing test titles, best effort from the Checkly result's embedded
344
363
  # Playwright report — the recursive search tolerates schema changes,