style: 修复pr_auto_scan.py的ruff lint问题
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 42s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m2s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m4s
CI/CD Pipeline / Validate - Code Quality (pull_request) Failing after 1m4s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1m5s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m11s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 1m14s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m11s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 2m43s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 2m51s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 4m0s
AI Code Review / AI Code Review (pull_request) Successful in 4m28s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 4m59s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 10m3s

This commit is contained in:
2026-07-23 00:56:25 +08:00
parent 5b212bb571
commit 5241ec7d42
+11 -13
View File
@@ -6,8 +6,6 @@ PR自动扫描器:扫描所有open PR,对CI全绿的进行自动审批/合
import argparse
import json
import os
import sys
import time
import urllib.error
import urllib.request
@@ -272,12 +270,12 @@ def main():
# === 自动审批 ===
if args.approve and all_ok and not failed:
if has_approval(args.token, args.repo, pr_num):
print(f" ✅ 已有审批,跳过")
print(" ✅ 已有审批,跳过")
else:
if dry_run:
print(f" 🎯 [DRY-RUN] 将自动审批")
print(" 🎯 [DRY-RUN] 将自动审批")
else:
print(f" 🎯 执行自动审批...")
print(" 🎯 执行自动审批...")
ok, msg = approve_pr(args.token, args.repo, pr_num)
if ok:
print(f" ✅ 审批成功: {msg}")
@@ -285,9 +283,9 @@ def main():
else:
print(f" ❌ 审批失败: {msg}")
elif failed:
print(f" ❌ CI有失败项,跳过审批")
print(" ❌ CI有失败项,跳过审批")
elif pending:
print(f" ⏳ CI仍在运行,跳过")
print(" ⏳ CI仍在运行,跳过")
# === 自动合并 ===
if args.merge:
@@ -301,9 +299,9 @@ def main():
if merge_ok and approved and not merge_failed:
if dry_run:
print(f" 🎯 [DRY-RUN] 将自动合并")
print(" 🎯 [DRY-RUN] 将自动合并")
else:
print(f" 🎯 执行自动合并...")
print(" 🎯 执行自动合并...")
ok, msg = merge_pr(args.token, args.repo, pr_num)
if ok:
print(f" ✅ 合并成功: {msg}")
@@ -311,13 +309,13 @@ def main():
else:
print(f" ⚠️ 合并失败: {msg}")
elif merge_pending:
print(f" ⏳ 合并条件未满足: CI运行中")
print(" ⏳ 合并条件未满足: CI运行中")
elif merge_failed:
print(f" ❌ 合并条件未满足: CI有失败")
print(" ❌ 合并条件未满足: CI有失败")
elif not approved:
print(f" ⏳ 合并条件未满足: 无审批")
print(" ⏳ 合并条件未满足: 无审批")
print(f"\n=== 扫描结果 ===")
print("\n=== 扫描结果 ===")
print(f" 处理PR数: {min(len(prs), args.max_prs)}")
print(f" 自动审批: {approved_count}")
print(f" 自动合并: {merged_count}")