Skip to content
Merged
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
18 changes: 18 additions & 0 deletions .github/workflows/qwen-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,15 @@ jobs:
find tmp -maxdepth 2 -type d -name '*-tmux-*' -exec rm -rf {} + 2>/dev/null || true
fi
git worktree prune -v || true
# Restore workspace ownership to the runner user so the next job's
# checkout step can clean the tree without EACCES. The prepare step
# chowned everything to node:node; without this, node_modules and
# .qwen/ remain node-owned and the next checkout's rm -rf fails.
Comment on lines +1525 to +1528

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[Suggestion] 重复代码无交叉引用 — Concrete cost: 这个 9 行块在 tmux-testing(此处)和 verify(约第 2837 行)的 cleanup 步骤中完全相同地出现了两次。修改其中一处(如添加 chmod)时,维护者可能不知道另一处也需要同步更新。

Suggested change
# Restore workspace ownership to the runner user so the next job's
# checkout step can clean the tree without EACCES. The prepare step
# chowned everything to node:node; without this, node_modules and
# .qwen/ remain node-owned and the next checkout's rm -rf fails.
# Restore workspace ownership to the runner user so the next job's
# checkout step can clean the tree without EACCES. The prepare step
# chowned everything to node:node; without this, node_modules and
# .qwen/ remain node-owned and the next checkout's rm -rf fails.
# (duplicated near line ~2837 in verify job — keep in sync)
中文说明

这 9 行代码在 tmux-testing 和 verify 两个 job 的 cleanup 步骤中完全一样。未来修改其中一处时(比如加 chmod),维护者可能不知道另一处也需要改。建议在注释中添加交叉引用,说明两处需保持同步。

— qwen3.7-max via Qwen Code /review

RUNNER_UID="$(stat -c '%u' "$RUNNER_TEMP" 2>/dev/null || stat -f '%u' "$RUNNER_TEMP" 2>/dev/null || echo 0)"
RUNNER_GID="$(stat -c '%g' "$RUNNER_TEMP" 2>/dev/null || stat -f '%g' "$RUNNER_TEMP" 2>/dev/null || echo 0)"
Comment on lines +1529 to +1530

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[Suggestion] 静默失败路径缺少诊断日志 — Concrete cost: 如果两个 stat 命令都失败($RUNNER_TEMP 未设置或不可读),UID/GID 静默回退到 "0",chown 被跳过,没有任何日志输出说明发生了什么。下一个 job 出现 EACCES 时,日志无法指示根本原因。

Suggested change
RUNNER_UID="$(stat -c '%u' "$RUNNER_TEMP" 2>/dev/null || stat -f '%u' "$RUNNER_TEMP" 2>/dev/null || echo 0)"
RUNNER_GID="$(stat -c '%g' "$RUNNER_TEMP" 2>/dev/null || stat -f '%g' "$RUNNER_TEMP" 2>/dev/null || echo 0)"
RUNNER_UID="$(stat -c '%u' "$RUNNER_TEMP" 2>/dev/null || stat -f '%u' "$RUNNER_TEMP" 2>/dev/null || echo 0)"
RUNNER_GID="$(stat -c '%g' "$RUNNER_TEMP" 2>/dev/null || stat -f '%g' "$RUNNER_TEMP" 2>/dev/null || echo 0)"
echo "Ownership restoration: RUNNER_UID=$RUNNER_UID, RUNNER_GID=$RUNNER_GID"
中文说明

如果 stat 失败导致 UID 回退为 "0",chown 被跳过但没有任何日志输出。当后续 job 出现 EACCES 时,运维人员无法从日志判断是否因为所有权恢复被跳过。建议添加 echo 输出检测到的 UID/GID。

— qwen3.7-max via Qwen Code /review

if [ "$RUNNER_UID" != "0" ]; then
chown -R "$RUNNER_UID:$RUNNER_GID" "$GITHUB_WORKSPACE" 2>/dev/null || true
fi

# Post the tmux verdict back to the PR. Runs on a clean GitHub-hosted runner
# with the write PAT and never checks out PR code, so the write credential is
Expand Down Expand Up @@ -2825,6 +2834,15 @@ jobs:
esac
done
git worktree prune -v || true
# Restore workspace ownership to the runner user so the next job's
# checkout step can clean the tree without EACCES. The prepare step
# chowned everything to node:node; without this, node_modules and
# .qwen/ remain node-owned and the next checkout's rm -rf fails.
RUNNER_UID="$(stat -c '%u' "$RUNNER_TEMP" 2>/dev/null || stat -f '%u' "$RUNNER_TEMP" 2>/dev/null || echo 0)"
RUNNER_GID="$(stat -c '%g' "$RUNNER_TEMP" 2>/dev/null || stat -f '%g' "$RUNNER_TEMP" 2>/dev/null || echo 0)"
if [ "$RUNNER_UID" != "0" ]; then
chown -R "$RUNNER_UID:$RUNNER_GID" "$GITHUB_WORKSPACE" 2>/dev/null || true
fi
Comment on lines +2844 to +2845

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[Critical] verify lane 仍然失败:chown -R 恢复了所有权但没有恢复写权限 — Failure scenario: verify job 的 "Re-pin the verifier" 步骤(第 2365 行)执行 chmod -R a-w,a+rX .qwen 将 .qwen 变为 dr-xr-xr-x。cleanup 的 chown -R 恢复了 runner user 所有权,但没有写权限的目录不允许 unlink/rmdir。下一个 job 的 actions/checkout(在宿主机上以 runner user 身份运行,不在容器内)失败:EACCES: permission denied, unlink '.../.qwen/e2e-tests/...'。审查者 @wenshao 通过本地 A/B 复现验证了此问题(comment 5104025458):tmux-testing lane 通过,verify lane 仍然失败。

Suggested change
chown -R "$RUNNER_UID:$RUNNER_GID" "$GITHUB_WORKSPACE" 2>/dev/null || true
fi
chown -R "$RUNNER_UID:$RUNNER_GID" "$GITHUB_WORKSPACE" 2>/dev/null || true
chmod -R u+rwX "$GITHUB_WORKSPACE" 2>/dev/null || true
fi
中文说明

verify job 的 "Re-pin the verifier" 步骤执行 chmod -R a-w,a+rX .qwen 去掉了写权限。仅恢复所有者(chown)不够——unlink/rmdir 需要父目录的写权限,不仅仅是所有权。下一个 job 的 actions/checkout 在宿主机上以 runner user 运行(不在容器内),遇到 EACCES。建议在 chown -R 后添加 chmod -R u+rwX。大写 X 只在已有 x 位处补回执行位,不会造成 mode 漂移。

— qwen3.7-max via Qwen Code /review


# Post the verification report back to the PR. Runs on a clean GitHub-hosted
# runner with the write PAT and never checks out PR code, so the write
Expand Down
Loading