Repository navigation
fix(triage): finalize the status comment on cancellation too #8436
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 2 commits
7ee7cea
8569cd7
4014085
d453112
b257a03
a2aa71b
90fc940
0958ea8
c67187c
1ec4150
fa10cfe
5c55b2f
8e130d0
1beca48
efda1e2
40a1ff0
3ce449b
f2fa5f5
ad440db
e475fa4
2d14f51
4708d1a
060c2c2
02aad77
b8ac04e
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -923,15 +923,20 @@ jobs: | |||||
| # "running" line doesn't outlive the run. Neutral wording — the verdict | ||||||
| # lives in the stage comments above; this only records that the run ended | ||||||
| # and keeps the run link. Same marker → edits the one comment, no second | ||||||
| # post. Best-effort, on both success and failure. | ||||||
| # post. Best-effort, on success, failure, AND cancellation: always() (not | ||||||
| # success() || failure()) because the job-level timeout-minutes and a | ||||||
| # manual cancel both surface as cancellation, which would skip this step | ||||||
| # and leave the comment claiming the run is still in progress — the verify | ||||||
| # lane has publish-verify to catch that case, this lane only has us. | ||||||
| - name: 'Finalize triage status comment' | ||||||
| if: "(success() || failure()) && steps.resolve.outputs.number != ''" | ||||||
| if: "always() && steps.resolve.outputs.number != ''" | ||||||
| shell: 'bash' | ||||||
| env: | ||||||
| GH_TOKEN: '${{ secrets.QWEN_CODE_BOT_TOKEN || secrets.CI_BOT_PAT }}' | ||||||
| NUMBER: '${{ steps.resolve.outputs.number }}' | ||||||
| RUN_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' | ||||||
| TRIAGE_OUTCOME: '${{ steps.triage.outcome }}' | ||||||
| JOB_STATUS: '${{ job.status }}' | ||||||
| run: |- | ||||||
| set -uo pipefail | ||||||
| MARKER='<!-- qwen-triage lifecycle -->' | ||||||
|
|
@@ -942,6 +947,9 @@ jobs: | |||||
| if [ "${TRIAGE_OUTCOME:-}" = 'success' ]; then | ||||||
|
Collaborator
Author
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. [Critical] Failure scenario: The suggestion keeps the deliberate
Suggested change
中文说明严重: 失败场景: 建议保留了 |
||||||
| EN="✅ **Qwen Triage finished** — [view run]($RUN_URL). See the stage comments in this thread for the result." | ||||||
| ZH="✅ **Qwen Triage 已完成** —— [查看运行]($RUN_URL)。结果见本线程中的各阶段评论。" | ||||||
| elif [ "${JOB_STATUS:-}" = 'cancelled' ]; then | ||||||
| EN="🚫 **Qwen Triage was cancelled** — [view run]($RUN_URL). The run hit its time limit or was cancelled before finishing; re-run to get a result." | ||||||
| ZH="🚫 **Qwen Triage 已取消** —— [查看运行]($RUN_URL)。运行超时或被取消,未跑完;重新运行以获得结果。" | ||||||
|
Collaborator
Author
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. [Suggestion] Nit: the new Chinese string uses half-width ASCII
Suggested change
中文说明建议:细节——新增的中文串在 CJK 文本中使用了半角 ASCII 的 对这个 4237 行的 workflow 执行 |
||||||
| else | ||||||
| EN="⚠️ **Qwen Triage ended early** — [view run]($RUN_URL). It stopped before finishing; check the run log." | ||||||
| ZH="⚠️ **Qwen Triage 提前结束** —— [查看运行]($RUN_URL)。未跑完,请查看运行日志。" | ||||||
|
|
||||||
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.
[Suggestion] This comment enumerates "the job-level timeout-minutes and a manual cancel" as the causes of cancellation, and the new user-facing string at L979 asserts the same two — but neither is the dominant source of cancellation in this job.
The job sets
cancel-in-progress: trueforpull_request_target,issue_comment,issuesandworkflow_dispatch(L392-402), so every push to an open PR cancels the in-flight triage. That run'salways()finalize fires immediately, while the successor still has to acquire a runner, runauthorize, and check out (≥1 min) — so the losing run's message usually wins the race and the PR shows "🚫 Qwen Triage was cancelled — … The run hit its time limit or was cancelled before finishing; re-run to get a result" while a newer run is already in flight and no re-run is needed.job.status == 'cancelled'alone cannot tell supersession from a timeout;github.event_nameplus a supersession probe can. At minimum the wording should not prescribe a re-run it cannot know is necessary.中文说明
建议:该注释把「job 级 timeout-minutes 和手动取消」列为取消的成因,L979 新增的用户可见文案也断言了同样两点——但这两者都不是本 job 取消的主要来源。
该 job 对
pull_request_target、issue_comment、issues与workflow_dispatch设置了cancel-in-progress: true(L392-402),因此向开放 PR 的每一次 push 都会取消进行中的 triage。被取消 run 的always()收尾会立刻触发,而后继 run 还要抢 runner、跑authorize、checkout(≥1 分钟)——于是通常是失败方的消息赢得竞速,PR 上显示 "🚫 Qwen Triage was cancelled — … The run hit its time limit or was cancelled before finishing; re-run to get a result",而此时更新的 run 已在运行,根本不需要重跑。仅凭job.status == 'cancelled'无法区分被取代与超时;结合github.event_name及一次取代探测则可以。至少,文案不应给出一个它无从判断是否必要的重跑建议。