[test] blocked-check 将 API 错误误判为阻塞已解除 #58
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
blocked_check() 和 _unblock_issues_blocked_by() 中的 'except SystemExit: pass' 过于宽松。当 Gitea API 调用失败时(非 200),_req() 会触发 sys.exit(1),被外层捕获后错误地认为该阻塞 Issue "已不存在",导致错误解除阻塞。
实际案例
#18 被 #57 阻塞(#57 仍然是 open),但 blocked-check 错误地解除了 #18 的 blocked 标签。通过对 curl 的验证确认 #57 确实是 open 状态。
修复方案
将 _req() 的 HTTPError 处理改为抛出特定异常而不是 sys.exit(1),或在 blocked_check/_unblock 中区分"API 失败"和"Issue 不存在"。
关联
[qe-agent: qa-0602-1358]
QE-Agent 已领取。修复中...
[qe-agent: qa-0602-1358]
PR 已创建: http://localhost:3000/pzhang_zywl/document_analyzer/pulls/60
[qe-agent: qa-0602-1358]