|
66 | 66 | EXHAUSTED_LABEL: evergreen-exhausted |
67 | 67 | REQUIRED_CHECKS_JSON: '["Test & Lint","Playground E2E (Playwright)","Build","Validate Python Examples"]' |
68 | 68 | CHECK_GATE_MODE: configured |
69 | | - CI_ACTIVATION_WAIT_SECONDS: "300" |
70 | 69 | MANUAL_PR: ${{ github.event.inputs.pr || '' }} |
71 | 70 | MANUAL_HEAD_SHA: ${{ github.event.inputs.head_sha || '' }} |
72 | 71 | MANUAL_REASON: ${{ github.event.inputs.reason || '' }} |
@@ -365,42 +364,6 @@ jobs: |
365 | 364 | return 1 |
366 | 365 | } |
367 | 366 |
|
368 | | - wait_for_ci_activation() { |
369 | | - local pr="$1" |
370 | | - local head_sha="$2" |
371 | | - local timeout="${CI_ACTIVATION_WAIT_SECONDS:-0}" |
372 | | - local deadline payload current_head state |
373 | | -
|
374 | | - if ! grep -Eq '^[0-9]+$' <<<"$timeout" || [ "$timeout" -le 0 ]; then |
375 | | - return 1 |
376 | | - fi |
377 | | -
|
378 | | - deadline=$((SECONDS + timeout)) |
379 | | - while [ "$SECONDS" -lt "$deadline" ]; do |
380 | | - sleep 10 |
381 | | - payload="$(pr_json "$pr")" |
382 | | - current_head="$(jq -r '.headRefOid' <<<"$payload")" |
383 | | - if [ "$current_head" != "$head_sha" ]; then |
384 | | - echo "PR #$pr head changed from $head_sha to $current_head while waiting for CI." |
385 | | - return 0 |
386 | | - fi |
387 | | -
|
388 | | - state="$(evaluate_readiness "$payload")" |
389 | | - case "$state" in |
390 | | - waiting|needs_ci) |
391 | | - echo "CI for PR #$pr is still $state; continuing to wait." |
392 | | - ;; |
393 | | - *) |
394 | | - echo "CI for PR #$pr settled to $state." |
395 | | - return 0 |
396 | | - ;; |
397 | | - esac |
398 | | - done |
399 | | -
|
400 | | - echo "CI for PR #$pr did not settle within ${timeout}s; a later Evergreen run will continue." |
401 | | - return 1 |
402 | | - } |
403 | | -
|
404 | 367 | update_branch_if_needed() { |
405 | 368 | # Deterministic branch freshness handling. Keep base-branch merges out |
406 | 369 | # of agent patches so safe outputs only contain repair edits. |
@@ -476,25 +439,7 @@ jobs: |
476 | 439 | return 1 |
477 | 440 | ;; |
478 | 441 | needs_ci) |
479 | | - if trigger_ci_if_needed "$pr" "$head_sha" && |
480 | | - wait_for_ci_activation "$pr" "$head_sha"; then |
481 | | - payload="$(pr_json "$pr")" |
482 | | - head_sha="$(jq -r '.headRefOid' <<<"$payload")" |
483 | | - state="$(evaluate_readiness "$payload")" |
484 | | - if ! reconcile_ready_label "$pr" "$state" "$payload"; then |
485 | | - echo "Could not reconcile $READY_LABEL for PR #$pr after CI activation; refusing to dispatch the agent." |
486 | | - set_result "false" "$pr" "$head_sha" "blocked" "$reason:ready_label_failed" |
487 | | - return 1 |
488 | | - fi |
489 | | -
|
490 | | - if [ "$state" = "needs_repair" ]; then |
491 | | - if ! claim_active_label "$pr" "$head_sha" "$reason:ci_failed_after_activation"; then |
492 | | - return 1 |
493 | | - fi |
494 | | - set_result "true" "$pr" "$head_sha" "$state" "$reason:ci_failed_after_activation" |
495 | | - return 0 |
496 | | - fi |
497 | | - fi |
| 442 | + trigger_ci_if_needed "$pr" "$head_sha" || true |
498 | 443 | return 1 |
499 | 444 | ;; |
500 | 445 | needs_branch_update) |
|
0 commit comments