Skip to content

fix(debug): 收敛调试终止后的节点状态 --story=135505027 - #840

Merged
dengyh merged 1 commit into
TencentBlueKing:developfrom
dengyh:ai/fix-debug-revoked-waiting-state-develop
Jul 30, 2026
Merged

fix(debug): 收敛调试终止后的节点状态 --story=135505027#840
dengyh merged 1 commit into
TencentBlueKing:developfrom
dengyh:ai/fix-debug-revoked-waiting-state-develop

Conversation

@dengyh

@dengyh dengyh commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

问题

调试任务整体已经进入 REVOKED 并释放 active 锁后,子节点在引擎状态树中仍可能保持 RUNNING / SUSPENDED。BKFlow 将这些节点继续映射为 runningwaitingpaused,导致页面长期显示“调试中”。

修复

  • DebugNodeState 增加节点级 revoked 状态及迁移。
  • 根调试任务为 REVOKED 时,将仍处于 runningwaitingpaused 的节点统一收敛为 revoked
  • 保留节点耗时和已经完成/失败节点的原结果,并清空等待原因。
  • 回归测试覆盖运行中、轮询等待和暂停三种残留状态。

验证

  • 最新 upstream/develop 基线:调试模块 79 passed
  • master 调试功能分支:调试模块 77 passed
  • pre-commit: black / isort / flake8 / pyupgrade passed

联动

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

本 PR 为调试节点状态新增 revoked 状态,处理引擎任务被撤销时的节点状态收敛逻辑。变更包含:

  1. Model 字段扩展DebugNodeState.STATUS_CHOICES 新增 revoked,附带正确的 migration 文件 ✅
  2. Service 逻辑 — 在 sync_from_debug_task 中检测 REVOKED 引擎状态后批量更新活跃节点 ✅
  3. 测试覆盖 — 参数化测试覆盖了 running/waiting/paused 三种活跃状态的收敛 ✅

整体实现简洁正确,ENGINE_RUN_STATE_MAPENGINE_FINISHED_STATES 已预先包含 REVOKED 映射,上下游逻辑自洽。

✨ 小建议

service.py:575if engine_state == "FAILED" 可改为 elif,因为与上方 REVOKED 分支互斥,语义更清晰(非阻塞建议)。

整体质量良好,无 Critical / Important 级别问题。

@dengyh
dengyh merged commit cfbf9a4 into TencentBlueKing:develop Jul 30, 2026
7 of 8 checks passed
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.60%. Comparing base (4da513d) to head (30e6161).
⚠️ Report is 11 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #840   +/-   ##
========================================
  Coverage    83.60%   83.60%           
========================================
  Files          324      324           
  Lines        20722    20724    +2     
========================================
+ Hits         17324    17326    +2     
  Misses        3398     3398           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants