Skip to content

fix(pipeline): fail deploying step when ROS deployment fails - #300

Closed
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/2852f480
Closed

fix(pipeline): fail deploying step when ROS deployment fails#300
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/2852f480

Conversation

@ruanzhengxin-zhuxing

Copy link
Copy Markdown
Collaborator

背景

Harness work item 2852f480-259b-464d-a095-5b02914a3c1d

ros_deploy 返回 CREATE_FAILED 时,deploying 步骤仍被标记为 completed,未触发回滚/重试,也未向用户报告 status_reason

根因

成功的 complete_step 调用一律产出 StepStatus.COMPLETEDdeploying 步骤 forward: null 且没有任何 exit/failure 映射,因此 PipelineRunner 直接 advance() 并以成功状态结束流水线:没有 STEP_FAILED 事件、没有回滚,status_reason 也无法保证传达给用户。

变更

  • StepSpec 新增声明式 failure_condition(field / value / reason_fields),loader 提供严格校验。
  • StepExecutor 在新执行路径与恢复路径上,把匹配 failure_condition 的结论映射为 StepStatus.FAILED 并携带用户可见 error,同时保留 set_conclusionon_exit 与既有 rollback_request 行为。
  • selling/pipeline.yamldeploying 步骤声明 failure_condition 以及针对 status: failed 的 completion guard(强制 status_reason)。
  • prompts/deploying.mdskills/iac-aliyun-deploying/SKILL.md 明确要求先上报 status_reason,再重试/回滚到候选选择,最后才允许收敛为 failed
  • hooks/deploying.py 新增 on_exit,在缺失时用 error 回填 status_reason
  • 6 种语言的 i18n 目录补齐新增文案。

验证

  • ruff check src/ tests/ 通过
  • ty check src/ 通过
  • pytest tests/pipeline:1628 passed(1 项既有失败,与本变更无关)
  • pytest tests/web tests/agent tests/cli tests/acp tests/ui tests/skill_bridge:4068 passed(5 项既有失败)
  • 新增 14 个测试用例

ros_deploy returning CREATE_FAILED still ended the selling pipeline as a
successful run: complete_step always produced StepStatus.COMPLETED, so the
deploying step was marked completed, no STEP_FAILED/rollback path ran, and
the ROS status_reason was never guaranteed to reach the user.

- add a declarative step-level failure_condition (field/value/reason_fields)
  parsed strictly by the loader
- map a matching failure conclusion to StepStatus.FAILED in StepExecutor
  (both fresh and resumed steps), keeping on_exit/set_conclusion and the
  existing rollback_request path intact
- require status_reason on a failed deploying conclusion via a new
  completion guard plus the deploying skill conclusion schema
- make prompt/skill mandate reporting status_reason and entering
  retry/rollback before giving up
@guima-why guima-why closed this Aug 25, 2026
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