Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(ci): report blocked managed PRs
  • Loading branch information
qqqys committed Aug 5, 2026
commit e41f39d4495847d7db1fc26f4298d3a386fcbb5c
7 changes: 6 additions & 1 deletion .github/workflows/qwen-autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,9 @@ jobs:
report_forced_takeover_blocked() {
local reason="$1" actor status_ids status_id body attempt status_lookup_ok next_en next_zh
[[ "${DRY_RUN}" == 'true' ]] && return 0
[[ "$(jq -r --arg take "${TAKEOVER_LABEL}" '[.labels[]?.name] | index($take) != null' <<< "${META}")" == 'true' ]] || return 0
[[ "$(jq -r --arg ab "${AUTOFIX_BOT}" --arg take "${TAKEOVER_LABEL}" '
((.author.login // "") == $ab) or ([.labels[]?.name] | index($take) != null)
' <<< "${META}")" == 'true' ]] || return 0
case "${reason}" in
permission_lookup_failed|author_permission_*|maintainer_edits_disabled|cross_repo_state_missing) ;;
*) return 0 ;;
Expand All @@ -1791,6 +1793,9 @@ jobs:
if [[ "${reason}" == 'maintainer_edits_disabled' ]]; then
next_en='Re-enable maintainer edits on the fork PR to resume takeover.'
next_zh='请在 fork PR 上重新允许 maintainer edits,以恢复 takeover。'
elif [[ "${reason}" == author_permission_* ]]; then
next_en='Grant the fork author write access, or remove the autofix/takeover label, to resume takeover.'
next_zh='请授予 fork 作者 write 权限,或移除 autofix/takeover 标签,以恢复 takeover。'
else
next_en='A later scheduled scan will retry without advancing the feedback watermark.'
next_zh='后续定时扫描会重试,本次不会推进反馈水位。'
Comment on lines +2023 to +2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

已修复 + 验证证据:author_permission_* 现在明确提示授予 write 权限或移除 autofix/takeover 标签,新增文案分支回归;聚焦用例 1/1 通过,完整 workflow 111/111 断言通过,Prettier 与 git diff --check 通过。

Expand Down
30 changes: 30 additions & 0 deletions scripts/tests/qwen-autofix-workflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3372,6 +3372,36 @@ exit 1
'A later scheduled scan will retry',
);

writeFileSync(callsFile, '');
const authorPermissionReporter = runReporter(
{},
'author_permission_read',
);
expect(authorPermissionReporter.status).toBe(0);
const authorPermissionCalls = readFileSync(callsFile, 'utf8');
expect(authorPermissionCalls).toContain(
'Grant the fork author write access',
);
expect(authorPermissionCalls).toContain(
'remove the autofix/takeover label',
);
expect(authorPermissionCalls).not.toContain(
'A later scheduled scan will retry',
);

writeFileSync(callsFile, '');
const botManagedMeta = JSON.stringify({
...JSON.parse(meta),
author: { login: 'qwen-code-dev-bot' },
labels: [],
});
const botManagedReporter = runReporter(
{ META: botManagedMeta },
'maintainer_edits_disabled',
);
expect(botManagedReporter.status).toBe(0);
expect(readFileSync(callsFile, 'utf8')).toContain('AutoFix blocked');

const failedReporter = runReporter({ FAIL_STATUS_LOOKUP: 'true' });
expect(failedReporter.status).toBe(1);
expect(failedReporter.stdout).toContain('(attempt 3/3)');
Expand Down
Loading