Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/qwen-autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2966,6 +2966,12 @@ jobs:
set -uo pipefail
MARKER='<!-- autofix-status -->'
ROUND_DISPLAY="${EFFECTIVE_ROUND:-${ROUND}}"
# ROUND counts rounds already DONE; every other message numbers the
# round being performed (the report posts ROUND + 1). Match it, or
# the same round carries two different numbers in one thread.
if [[ "${ROUND_DISPLAY}" =~ ^[0-9]+$ ]]; then
ROUND_DISPLAY="$((ROUND_DISPLAY + 1))"
fi
BODY="$(printf '%s\n\n🔄 **AutoFix is working on this PR** — round %s/%s. [Watch live progress](%s); this round posts its report here when it finishes.\n\n<details>\n<summary>中文说明</summary>\n\n🔄 **AutoFix 正在处理此 PR** —— 第 %s/%s 轮。[查看实时进度](%s);本轮结束后会在此发布报告。\n\n</details>' \
"${MARKER}" "${ROUND_DISPLAY}" "${MAX_ROUNDS}" "${RUN_URL}" \
"${ROUND_DISPLAY}" "${MAX_ROUNDS}" "${RUN_URL}")"
Expand Down Expand Up @@ -3747,6 +3753,12 @@ jobs:
exit 0
fi
ROUND_DISPLAY="${EFFECTIVE_ROUND:-${ROUND}}"
# ROUND counts rounds already DONE; every other message numbers the
# round being performed (the report posts ROUND + 1). Match it, or
# the same round carries two different numbers in one thread.
if [[ "${ROUND_DISPLAY}" =~ ^[0-9]+$ ]]; then
ROUND_DISPLAY="$((ROUND_DISPLAY + 1))"
fi
# 'fixed'/'noop' are the two outcomes that published a round report;
# anything else means the round stopped before publishing one.
if [[ "${OUTCOME:-}" == 'fixed' || "${OUTCOME:-}" == 'noop' ]]; then
Expand Down
12 changes: 12 additions & 0 deletions scripts/tests/qwen-autofix-workflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4885,6 +4885,18 @@ describe('qwen-autofix workflow', () => {
"STATUS_ID: '${{ steps.post_status.outputs.comment_id }}'",
);
expect(finalizeStatusCommentStep).not.toContain('--paginate');
// Both status messages number the round being PERFORMED, like every other
// message the loop posts. `effective_round` counts rounds already done and
// "Push and report" prints ROUND + 1, so using it raw made the status say
// "round 5 finished" in the same thread where the report said "round 6/100"
// — observed on #7724. Same round must not carry two numbers.
for (const statusStep of [
postStatusCommentStep,
finalizeStatusCommentStep,
]) {
expect(statusStep).toContain('ROUND_DISPLAY="$((ROUND_DISPLAY + 1))"');
expect(statusStep).toContain('^[0-9]+$');
}
// Tells a round that published a report from one that died before it.
expect(finalizeStatusCommentStep).toContain("== 'fixed'");
expect(finalizeStatusCommentStep).toContain(
Expand Down
Loading