Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 44 additions & 7 deletions .github/workflows/evergreen.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 43 additions & 6 deletions .github/workflows/evergreen.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,30 @@ jobs:
return 1
}

any_configured_check_failing() {
local payload="$1"
local required="$2"
local count
local state

count="$(jq 'length' <<<"$required")"
if [ "$count" -eq 0 ]; then
has_failing_check "$payload"
return
fi

while IFS= read -r name; do
state="$(check_state_for "$payload" "$name")"
case "$state" in
FAILURE|failure|FAILED|failed|ERROR|error|TIMED_OUT|timed_out|CANCELLED|cancelled)
return 0
;;
esac
done < <(jq -r '.[]' <<<"$required")

return 1
}

evaluate_readiness() {
local payload="$1"
local required
Expand All @@ -210,6 +234,11 @@ jobs:
return 0
fi

if any_configured_check_failing "$payload" "$required"; then
echo "needs_repair"
return 0
fi

if any_configured_check_missing "$payload" "$required"; then
echo "needs_ci"
return 0
Expand Down Expand Up @@ -304,7 +333,7 @@ jobs:

if [ -z "$run_id" ]; then
echo "No CI run found for PR #$pr ($head_sha); leaving for scheduled/PR CI to start."
return 0
return 1
fi

case "$status" in
Expand All @@ -317,14 +346,22 @@ jobs:
case "$conclusion" in
success)
echo "CI run $run_id for PR #$pr ($head_sha) already succeeded; not rerunning green checks."
return 0
return 1
;;
esac

echo "Reactivating CI run $run_id for PR #$pr ($head_sha) (status=$status conclusion=$conclusion)."
ci_gh gh run rerun "$run_id" --repo "$REPO" --failed || \
ci_gh gh run rerun "$run_id" --repo "$REPO" || \
echo "Could not reactivate CI run $run_id; scheduled monitor will retry."
if ci_gh gh run rerun "$run_id" --repo "$REPO" --failed; then
return 0
fi

echo "Failed-jobs rerun was unavailable for CI run $run_id; trying full rerun."
if ci_gh gh run rerun "$run_id" --repo "$REPO"; then
return 0
fi

echo "Could not reactivate CI run $run_id; scheduled monitor will retry."
return 1
}

update_branch_if_needed() {
Expand Down Expand Up @@ -402,7 +439,7 @@ jobs:
return 1
;;
needs_ci)
trigger_ci_if_needed "$pr" "$head_sha"
trigger_ci_if_needed "$pr" "$head_sha" || true
return 1
;;
needs_branch_update)
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/shared/evergreen/repo-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ readiness controller and the agentic orchestrator must both respect this file.
(new head SHA, pending, failing, missing check, conflict, out of scope).
- Current-head SHA policy: readiness is evaluated only against the current PR
head SHA. A new push invalidates prior readiness.
- Pending check policy: `waiting` — do not repair pending or in-progress checks.
- Failing check policy: `needs_repair` — if a configured gate is visibly
failing for the current head SHA, dispatch the repair agent even when other
configured checks are still missing or skipped.
- Pending check policy: `waiting` — do not repair pending or in-progress checks
unless another configured gate has already failed.
- Missing/stale check policy: `needs_ci` — reactivate the latest `CI` run for the
head SHA once (see CI/CD Activation). Never rerun green checks.
head SHA once, then stop so a later reconciliation can classify the resulting
checks (see CI/CD Activation). Never rerun green checks.
- Branch freshness ready criterion: not required to be up to date with `main`;
freshness is only enforced when the branch is conflicted (`DIRTY`/`UNKNOWN`).
- Additional deterministic ready criteria: PR open, has `evergreen`, not
Expand Down
Loading