qwen-code/.github
Shaojin Wen 57285a94f1
fix(review): repair permissions before giving up on worktree cleanup (#9748)
* fix(review): repair permissions before giving up on worktree cleanup

The review job's end-of-job sweep gave up on the first EACCES and left
foreign-owned leftovers in the shared runner workspace; the next review's
checkout then died on them (run 32577821716, PR #9718: a scratch-verify
tree whose contents this job's user could not unlink, on a pool member
without passwordless sudo). Give the removal a repair ladder — chmod what
this user owns, then passwordless sudo chown/chmod where the pool member
has it, each followed by a retry — and refuse the ladder on paths that
resolve through symlinks, since its sudo leg escalates to root. Members
without sudo still degrade to a named warning: nothing unprivileged can
remove a foreign-owned tree, but the sweep must never fail the job.

Pin the ladder in the cleanup contract test so a rewrite cannot silently
drop it back to warn-and-leave.

* fix(ci): record qwen-code-pr-review.yml's shipped size in the workflow size baseline

The permission-repair ladder added to the review cleanup step (repair
before giving up on a worktree removal, refuse the sudo leg through
symlinks) plus its incident comments grew the file past its recorded
size plus allowance. The growth is the fix itself — the repair logic and
the rationale a future reader needs — not drift, so record the shipped
size rather than trimming the rationale.

* fix(review): pin the repair ladder by effect and enrich its failure warnings

Review feedback on the permission-repair ladder:

- Pin the ladder's effect in the contract test (three removal attempts,
  isolated non-sudo chmod rung, refusal-comparison direction) — the old
  mechanism substrings stayed green when the post-repair retry was
  deleted, when the non-sudo rung was deleted, and when the refusal
  comparison was inverted (all reproduced by mutation before the fix).
- Retry the removal after the chmod rung so a chmod-repaired tree never
  escalates to passwordless sudo; the step comment's "each followed by a
  retry" is now literally true.
- Strip newlines from leftover paths before echoing: leftover names are
  untrusted glob entries, and a fresh line on the runner's stdout would
  parse as a workflow command.
- Both warnings now carry the deciding state: the refusal names the
  branch that fired; the failure warning reports the sudo probe result
  and the survivor's owner.
- Return 0 unconditionally so a failed warning echo can never fail the
  if: always() job via errexit.

* fix(review): close the remaining command-injection entrances in worktree warnings (#9748)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* test(review): execute remove_review_tree against fixtures and pin its sudo ok-state (#9748)

* test(review): gate the removal-failure fixture on realpath and pin the ladder's guards (#9748)

* test(review): execute the ladder's unpinned arms against behavioral fixtures (#9748)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* fix(review): strip CR and LF from registered-worktree skip warnings (#9748)

---------

Co-authored-by: qwen-code-ci-bot <qwen-code-ci-bot@users.noreply.github.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: qwen-code-dev-bot <qwen-code-dev@service.alibaba.com>
2026-08-23 14:27:46 +00:00
..
actions ci: run Windows merge queue tests on ECS (#8386) 2026-08-05 12:14:42 +00:00
assets fix(cli): echo resume command to main screen on exit (#8455) 2026-08-08 04:29:31 +00:00
ISSUE_TEMPLATE chore: re-organize labels for better triage results (#819) 2025-10-17 19:49:11 +08:00
scripts fix(autofix): give the repair pass a budget it can finish in (#9691) 2026-08-23 00:32:36 +00:00
workflows fix(review): repair permissions before giving up on worktree cleanup (#9748) 2026-08-23 14:27:46 +00:00
actionlint.yaml ci: add Windows runner smoke test (#8008) 2026-07-29 08:44:36 +00:00
CODEOWNERS chore(ci): Disable install scripts in release CI and guard security-checks workflow (#9577) 2026-08-21 03:48:03 +00:00
dependabot.yml Limit dependabot PRs to security updates (#6657) 2025-08-20 22:24:43 +00:00
issue-owners.json feat(ci): auto-assign issues to area owners from labels (#8668) 2026-08-08 23:01:03 +00:00
pull_request_template.md docs(agents,pr-template): add Working Principles and restructure PR template (#4496) 2026-05-25 19:15:35 +08:00
release.yml ci: auto-skip internal CI changes in release notes (#7251) 2026-07-20 11:10:55 +00:00
spam-blocklist.txt ci: auto-minimize comments from org-blocked users (#7899) 2026-07-29 23:37:42 +00:00