-
Notifications
You must be signed in to change notification settings - Fork 39
t1051: Auto-verify deployed tasks without VERIFY.md entries #1494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -269,40 +269,53 @@ process_verify_queue() { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| local verified_count=0 | ||||||||||||||||||||||||||||||||||
| local failed_count=0 | ||||||||||||||||||||||||||||||||||
| local auto_verified_count=0 | ||||||||||||||||||||||||||||||||||
| local max_auto_verify_per_pulse=50 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| while IFS='|' read -r tid trepo _tpr; do | ||||||||||||||||||||||||||||||||||
| [[ -z "$tid" ]] && continue | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| local verify_file="$trepo/todo/VERIFY.md" | ||||||||||||||||||||||||||||||||||
| if [[ ! -f "$verify_file" ]]; then | ||||||||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
| local has_entry=false | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Check if there's a pending verify entry for this task | ||||||||||||||||||||||||||||||||||
| if ! grep -q "^- \[ \] v[0-9]* $tid " "$verify_file" 2>/dev/null; then | ||||||||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||||||||
| if [[ -f "$verify_file" ]] && grep -q "^- \[ \] v[0-9]* $tid " "$verify_file" 2>/dev/null; then | ||||||||||||||||||||||||||||||||||
| has_entry=true | ||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| log_info " $tid: running verification checks" | ||||||||||||||||||||||||||||||||||
| cmd_transition "$tid" "verifying" 2>>"$SUPERVISOR_LOG" || { | ||||||||||||||||||||||||||||||||||
| log_warn " $tid: failed to transition to verifying" | ||||||||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| if [[ "$has_entry" == "true" ]]; then | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+279
to
+285
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of the
Suggested change
|
||||||||||||||||||||||||||||||||||
| # Has VERIFY.md entry — run the defined checks | ||||||||||||||||||||||||||||||||||
| log_info " $tid: running verification checks" | ||||||||||||||||||||||||||||||||||
| cmd_transition "$tid" "verifying" 2>>"$SUPERVISOR_LOG" || { | ||||||||||||||||||||||||||||||||||
| log_warn " $tid: failed to transition to verifying" | ||||||||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if run_verify_checks "$tid" "$trepo"; then | ||||||||||||||||||||||||||||||||||
| cmd_transition "$tid" "verified" 2>>"$SUPERVISOR_LOG" || true | ||||||||||||||||||||||||||||||||||
| verified_count=$((verified_count + 1)) | ||||||||||||||||||||||||||||||||||
| log_success " $tid: VERIFIED" | ||||||||||||||||||||||||||||||||||
| if run_verify_checks "$tid" "$trepo"; then | ||||||||||||||||||||||||||||||||||
| cmd_transition "$tid" "verified" 2>>"$SUPERVISOR_LOG" || true | ||||||||||||||||||||||||||||||||||
| verified_count=$((verified_count + 1)) | ||||||||||||||||||||||||||||||||||
| log_success " $tid: VERIFIED" | ||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||
| cmd_transition "$tid" "verify_failed" 2>>"$SUPERVISOR_LOG" || true | ||||||||||||||||||||||||||||||||||
| failed_count=$((failed_count + 1)) | ||||||||||||||||||||||||||||||||||
| log_warn " $tid: VERIFY FAILED" | ||||||||||||||||||||||||||||||||||
| send_task_notification "$tid" "verify_failed" "Post-merge verification failed" 2>>"$SUPERVISOR_LOG" || true | ||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||
| cmd_transition "$tid" "verify_failed" 2>>"$SUPERVISOR_LOG" || true | ||||||||||||||||||||||||||||||||||
| failed_count=$((failed_count + 1)) | ||||||||||||||||||||||||||||||||||
| log_warn " $tid: VERIFY FAILED" | ||||||||||||||||||||||||||||||||||
| send_task_notification "$tid" "verify_failed" "Post-merge verification failed" 2>>"$SUPERVISOR_LOG" || true | ||||||||||||||||||||||||||||||||||
| # No VERIFY.md entry — auto-verify (PR merged + CI passed is sufficient) | ||||||||||||||||||||||||||||||||||
| # Rate-limit to avoid overwhelming the state machine in one pulse | ||||||||||||||||||||||||||||||||||
| if [[ "$auto_verified_count" -ge "$max_auto_verify_per_pulse" ]]; then | ||||||||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
| cmd_transition "$tid" "verified" 2>>"$SUPERVISOR_LOG" || { | ||||||||||||||||||||||||||||||||||
| log_warn " $tid: failed to auto-verify" | ||||||||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| auto_verified_count=$((auto_verified_count + 1)) | ||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For better observability, it would be helpful to add a log message when a task is auto-verified. This would be consistent with the manual verification path, which logs a success message, and would make it clearer in the logs which specific tasks were auto-verified.
Suggested change
|
||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
| done <<<"$deployed_tasks" | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if [[ $((verified_count + failed_count)) -gt 0 ]]; then | ||||||||||||||||||||||||||||||||||
| log_info "Verification: $verified_count passed, $failed_count failed" | ||||||||||||||||||||||||||||||||||
| if [[ $((verified_count + failed_count + auto_verified_count)) -gt 0 ]]; then | ||||||||||||||||||||||||||||||||||
| log_info "Verification: $verified_count passed, $failed_count failed, $auto_verified_count auto-verified (no VERIFY.md entry)" | ||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| return 0 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the repository style guide (line 39), constants should be named using
UPPER_SNAKE_CASE. Please renamemax_auto_verify_per_pulsetoMAX_AUTO_VERIFY_PER_PULSEand update its usage on line 306 accordingly.References