fix: address review feedback — recipe engine robustness and correctness

- Bug: chicken-egg-ci create-per-file-issues was aliased to shellcheck-only
  function. Added generic playbook_lint_per_file() that handles any linter
  output format. Renamed action to lint-per-file.
- Bug: cascade-rebase fired retry-merge synchronously after async rebase.
  Removed retry-merge and re-approve from recipe — rebase settles, CI reruns,
  normal flow handles merge on subsequent cycle.
- Warning: jq calls on PR data lacked || true under set -euo pipefail. Fixed.
- Warning: playbook_rebase_pr and playbook_retrigger_ci incremented
  _PB_SUB_CREATED before confirming API success. Now check HTTP status code.
- Warning: Python import tomllib fails on < 3.11. Added try/except fallback
  to tomli package.
- Nit: failures_on_unchanged regex broadened to handle generic linter formats
  (file.sh:line:col patterns in addition to ShellCheck's "In file line N:").
- Info: match_recipe now logs Python stderr on error instead of silently
  falling back to generic recipe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-18 03:05:09 +00:00
parent cb8a9bc6e5
commit d6e91b2466
3 changed files with 111 additions and 28 deletions

View file

@ -1,7 +1,8 @@
# gardener/recipes/cascade-rebase.toml — PR outdated after main moved
#
# Trigger: PR mergeable=false (stale branch or dismissed approval)
# Playbook: rebase, re-approve if dismissed, retry merge
# Playbook: rebase only — merge and re-approval happen on subsequent cycles
# after CI reruns on the rebased branch (rebase is async via Gitea API)
name = "cascade-rebase"
description = "PR outdated after main moved — mergeable=false or stale approval"
@ -12,12 +13,4 @@ pr_mergeable = false
[[playbook]]
action = "rebase-pr"
description = "Rebase PR onto main"
[[playbook]]
action = "re-approve-if-dismissed"
description = "Re-approve if approval was dismissed by push"
[[playbook]]
action = "retry-merge"
description = "Retry merge"
description = "Rebase PR onto main (async — CI reruns, merge on next cycle)"

View file

@ -17,8 +17,8 @@ action = "make-step-non-blocking"
description = "Make failing step non-blocking (|| true) in the PR"
[[playbook]]
action = "create-per-file-issues"
description = "Create per-file fix issues for pre-existing violations"
action = "lint-per-file"
description = "Create per-file fix issues for pre-existing violations (generic linter support)"
[[playbook]]
action = "create-followup-remove-bypass"