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
16 changes: 13 additions & 3 deletions .github/workflows/qwen-code-pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ jobs:
REPO="${GITHUB_REPOSITORY}"
REVIEW_URL="${GITHUB_SERVER_URL}/${REPO}/pull/${PR_NUMBER}"
LOG_PATH="${RUNNER_TEMP:-/tmp}/qwen-review-pr-${PR_NUMBER}.jsonl"
trap 'rm -f "$LOG_PATH"' EXIT
# Set by configure_qwen_network once the wrapper dir exists.
PROXY_BIN=""
trap 'rm -f "$LOG_PATH"; [ -z "$PROXY_BIN" ] || rm -rf "$PROXY_BIN"' EXIT

if [ -z "${GH_TOKEN:-}" ]; then
fail "CI_BOT_PAT secret is required for Qwen PR review."
Expand Down Expand Up @@ -535,8 +537,16 @@ jobs:
export QWEN_CI_https_proxy="${https_proxy:-}"
export QWEN_CI_HTTP_PROXY="${HTTP_PROXY:-}"
export QWEN_CI_http_proxy="${http_proxy:-}"
proxy_bin="${RUNNER_TEMP:-/tmp}/qwen-network-bin"
mkdir -p "$proxy_bin"
# A fixed path is a landmine on the shared self-hosted runner:
# RUNNER_TEMP survives across jobs, and the triage workflow's
# containerised jobs write this same path as root through the
# RUNNER_TEMP bind mount. This job runs as the unprivileged runner
# user, so once that happens it can neither overwrite the wrapper
# nor remove the root-owned directory holding it, and every review
# landing on that runner dies here with EACCES. Use a private
# directory per run, cleaned up by the EXIT trap.
proxy_bin="$(mktemp -d "${RUNNER_TEMP:-/tmp}/qwen-network-bin.XXXXXX")"
PROXY_BIN="$proxy_bin"

if command -v gh >/dev/null 2>&1; then
local real_gh
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/qwen-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1162,8 +1162,13 @@ jobs:
export QWEN_CI_https_proxy="${https_proxy:-}"
export QWEN_CI_HTTP_PROXY="${HTTP_PROXY:-}"
export QWEN_CI_http_proxy="${http_proxy:-}"
proxy_bin="${RUNNER_TEMP:-/tmp}/qwen-network-bin"
mkdir -p "$proxy_bin"
# This job runs in a container, and RUNNER_TEMP is bind-mounted
# from the self-hosted runner's host filesystem. Writing the
# wrappers there leaves root-owned files on the host that later
# non-container jobs (the PR review) can neither overwrite nor
# delete, breaking every review scheduled on that runner. Keep
# them on the container's own disk, under a per-run directory.
proxy_bin="$(mktemp -d /tmp/qwen-network-bin.XXXXXX)"

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] No test asserts that the triage workflow's proxy wrappers use container-local /tmp rather than RUNNER_TEMP. — Failure scenario: if a future edit reverts this line to ${RUNNER_TEMP:-/tmp}/qwen-network-bin.XXXXXX (matching the review workflow's pattern, which looks like the more defensive choice), the original bug recurs — root-owned files on the host via the RUNNER_TEMP bind mount cause EACCES for every subsequent non-container review job on that runner.

The triage test file (scripts/tests/qwen-triage-workflow.test.js) has zero assertions on proxy_bin, configure_qwen_network, or network-bin, despite asserting RUNNER_TEMP paths for 22 other concerns — showing the established pattern for guarding path choices.

Suggested change
proxy_bin="$(mktemp -d /tmp/qwen-network-bin.XXXXXX)"
proxy_bin="$(mktemp -d /tmp/qwen-network-bin.XXXXXX)" # container-local; NOT $RUNNER_TEMP (host bind mount)
中文说明

[Suggestion] 没有测试断言 triage workflow 的代理脚本包装器使用的是容器内的 /tmp 而不是 RUNNER_TEMP。—— 失败场景:如果未来的编辑将此行改回 ${RUNNER_TEMP:-/tmp}/qwen-network-bin.XXXXXX(与 review workflow 的模式一致,看起来更像更稳妥的选择),原来的 bug 就会重现 —— 通过 RUNNER_TEMP bind mount 在宿主机上留下 root 所属的文件,导致该 runner 上所有后续的非容器 review job 出现 EACCES。

triage 测试文件 (scripts/tests/qwen-triage-workflow.test.js) 对 proxy_binconfigure_qwen_networknetwork-bin 没有任何断言,尽管它对 22 个其他路径使用了 RUNNER_TEMP 断言 —— 说明已有现成的路径保护模式可以复用。

— qwen3.7-max via Qwen Code /review


if command -v gh >/dev/null 2>&1; then
local real_gh
Expand Down Expand Up @@ -2415,8 +2420,13 @@ jobs:
export QWEN_CI_https_proxy="${https_proxy:-}"
export QWEN_CI_HTTP_PROXY="${HTTP_PROXY:-}"
export QWEN_CI_http_proxy="${http_proxy:-}"
proxy_bin="${RUNNER_TEMP:-/tmp}/qwen-network-bin"
mkdir -p "$proxy_bin"
# This job runs in a container, and RUNNER_TEMP is bind-mounted
# from the self-hosted runner's host filesystem. Writing the
# wrappers there leaves root-owned files on the host that later
# non-container jobs (the PR review) can neither overwrite nor
# delete, breaking every review scheduled on that runner. Keep
# them on the container's own disk, under a per-run directory.
proxy_bin="$(mktemp -d /tmp/qwen-network-bin.XXXXXX)"

if command -v gh >/dev/null 2>&1; then
local real_gh
Expand Down
Loading