fix(self-heal): make the CI regression signal deterministic

The loop read the latest completed Actions run with per_page=1 and an
empty default workflow scope, so the conclusion flickered: on RoboCo's
8-workflow repo a green run from an unrelated workflow (or a green run on
an older commit) masked a red ci.yml run, and a single transient GitHub
error silently skipped the whole cycle — so self-heal sometimes fired on
a real regression and sometimes did not.

- Default self_heal_ci_workflow to "ci.yml" so the signal is scoped to
  the gate workflow, not "latest run across all workflows".
- Fetch a window of recent completed runs and resolve the conclusion
  against the branch's current HEAD (newest commit's latest attempt), so
  a stale/unrelated green run can't mask the HEAD failure and a green
  re-run supersedes the original failure.
- Retry transient network / 429 / 5xx errors within the cycle instead of
  treating one blip as "all green".
This commit is contained in:
Renn F
2026-06-20 19:10:21 +02:00
parent a211fc17c2
commit 65683394d4
3 changed files with 166 additions and 32 deletions
+7 -6
View File
@@ -380,13 +380,14 @@ class Settings(BaseSettings):
),
)
self_heal_ci_workflow: str = Field(
default="",
default="ci.yml",
description=(
"Optional GitHub Actions workflow file name (e.g. 'ci.yml') to scope "
"the CI signal to. Empty = use the latest completed run across ALL "
"workflows on the default branch, which is imprecise when the repo "
"has several workflows; set this to the real CI workflow for a "
"reliable signal."
"GitHub Actions workflow file name to scope the CI signal to. "
"Defaults to 'ci.yml' (RoboCo's own gate). Set empty ONLY for a "
"single-workflow repo — an empty value reads the latest completed run "
"across ALL workflows on the default branch, which on a "
"multi-workflow repo lets an unrelated green run mask a red CI run "
"and makes the self-heal signal flicker."
),
)
self_heal_originate_enabled: bool = Field(