qwen-code/scripts/tests
易良 fc874dfe0b
fix(ci): retry sandbox image builds and file an issue when a release build fails (#9916)
* fix(ci): retry sandbox image builds and file an issue when a release build fails

The v0.22.0 tag build died on a transient ETXTBSY during `npm ci` and was
never retried, so ghcr.io/qwenlm/qwen-code:0.22.0 was never published while
npm already served 0.22.0. Every sandbox-based CI lane (/resolve, sandboxed
review, autofix) then crashes with "manifest unknown" until the image exists.

Add one bounded retry to the buildx step: the first attempt carries
continue-on-error so a successful retry turns the job green, and the retry
gates on the first attempt's outcome alone (a failure() gate would read false
once continue-on-error absorbs the first attempt). The publish condition is
shared through one job-level env so the two build steps cannot drift.

Add a follow-up job that files or updates one issue per version when both
attempts fail — for tag pushes and for publishing dispatches alike, since the
issue body itself recommends that dispatch as the recovery path. Dedup uses
an exact body marker matched client-side, because GitHub search tokenizes the
colon out of the marker and never finds these issues.

Extend the existing workflow gate test to pin the retry contract and the
issue-job gate.

Fixes #9898

* fix(ci): move the image-build failure issue logic to .github/scripts/

The workflow-size ratchet rejects growth past the recorded baseline +4096
bytes; the inline issue-filing step grew build-and-publish-image.yml by
~5.2 KB. Move the step body to .github/scripts/image-build-failure-issue.sh
(the gate's own recommended remedy), leaving the job as a thin env + script
call. No behavior change; the gate test now pins the script call and reads
the dedup contract from the script.

* fix(ci): grant the failure-issue job contents permission and normalize dispatch versions

* test(ci): pin the failure-issue gate and retry step invariants

* fix(ci): gate the failure-issue job on the exported publish decision

* fix(ci): skip the failure-issue job for versionless publishing dispatches

* test(ci): pin the PUSH_IMAGE value and the login gate at the definition site

* test(ci): replay the image-build failure-issue script under a gh stub

* fix(ci): describe release build job failures without asserting a buildx cause

* fix(ci): preserve annotations and recorded runs when updating the failure issue

* test(ci): pin the dedup label on create and the open-state filter on lookup

* fix(ci): document the pre-first-step gap in the failure-issue gate

A build job that fails before its first step runs (runner provisioning
failure) never executes publish-decision, so push_image stays empty and
file-failure-issue is skipped despite failure() being true. Closing the
gap structurally would restate the publish predicate and re-introduce
the drift this PR removes, so document it on the job comment instead:
future "failed publish, no issue filed" investigations start here, and
a scheduled npm-vs-GHCR reconciliation remains the backstop.

* fix(ci): record build-and-publish-image.yml's shipped size in the workflow size baseline

The retry logic and failure-issue filing steps added by this PR grew the
workflow from 4638 to 8887 bytes, past the 4096-byte allowance. Record
the new size so the size gate passes.

* fix(ci): harden the image-build failure reporter per review round 4 (#9916)

- Replace GNU-only `head -n -1` with POSIX `sed '$d'` so the stranded-heading
  strip no longer corrupts the body on BSD userland (R4-1).
- Skip the bash replay suite on win32, where backslash RUNNER_TEMP and the
  ';'-separated PATH cannot express it; the YAML pins still run there (R4-2).
- Re-check head readability AFTER the normalization strip, which can itself
  empty the head and used to drop the narrative permanently (R4-8).
- Admit only recorded-run shapes into the machine block so a bullet-shaped
  human annotation is no longer reordered into it or clipped by the cap (R4-13).
- Remove the marker-restore branch: with the run shape pinned, every body that
  matched the dedup carries its marker in head+tail, so it was unreachable (R4-9).
- Cross-reference the sibling split/merge contract in both implementations (R4-5),
  disable SC2016 with rationale on the literal-backtick formats (R4-6), and
  document the label-removal residual gap on the job (R4-11).
- Behavioral witnesses: run-cap, stranded-heading, marker-survival, empty-head
  and empty-after-strip prose fallbacks, and the annotation shape; each guard
  mutation-probed red. Pin the dedup label on the list call too (R4-10).

* fix(ci): document the version-marker dedup gap on the failure-issue job (#9916)

Round 4 removed the unreachable marker-restore branch (R4-9) but left its
residual gap undocumented: the dedup lookup only finds the tracked issue
while the version marker survives in the body, so a human edit deleting
the marker orphans the issue and the next failure files a duplicate. Fold
the marker into the job's existing known-gap note alongside its sibling,
the scope/ci-cd label (R4-11), and record the workflow's new size.
2026-08-26 08:52:56 +00:00
..
acp-serve-boundary-guard.test.js refactor(cli): keep acp-integration off serve internals (#8084) (#9144) 2026-08-22 12:39:08 +00:00
ai-release-notes-workflow.test.js chore(ci): Disable install scripts in release CI and guard security-checks workflow (#9577) 2026-08-21 03:48:03 +00:00
audit-runtime-critical.test.js ci: run Windows merge queue tests on ECS (#8386) 2026-08-05 12:14:42 +00:00
build-and-publish-image-workflow.test.js fix(ci): retry sandbox image builds and file an issue when a release build fails (#9916) 2026-08-26 08:52:56 +00:00
capture-tmux-ci.test.js ci: install tmux and zip tooling on the Linux test lane, and pin it (#8792) 2026-08-11 05:47:39 +00:00
check-build-status.test.js fix(review): report what the transcripts prove; build the roster in one call (#7033) 2026-07-18 00:43:57 +00:00
check-i18n.test.ts fix(cli): localize approval mode UI labels (#6592) 2026-07-11 00:07:03 +00:00
chrome-extension-package.test.js fix(ci): cover release integration regressions (#5994) 2026-06-29 11:54:11 +00:00
ci-flaky-rerun-workflow.test.js fix(ci): stop dropping agent settings in resolve and follow-up workflows (#9252) 2026-08-16 03:27:00 +00:00
ci-flaky-rerun.test.js feat(ci): auto-open a deflake fix issue for confirmed flaky tests (#7231) 2026-07-19 16:49:29 +00:00
ci-platform-lanes.test.js ci: take the macOS and Windows lanes off pull requests (#10059) 2026-08-26 03:31:55 +00:00
clean-package-build-artifacts.test.js test(core): stabilize file history eviction test (#6637) 2026-07-10 06:39:52 +00:00
cli-entry.test.js fix(cli): preserve Qwen Review startup version in footers (#8431) 2026-08-04 14:58:56 +00:00
comment-attachment-guard-workflow.test.js ci: route trusted-author fork PRs and no-checkout jobs to the ECS pool (#8502) 2026-08-04 03:48:24 +00:00
cross-package-contracts.test.js refactor(cli): keep acp-integration off serve internals (#8084) (#9144) 2026-08-22 12:39:08 +00:00
cua-driver-release-workflow.test.js feat(computer-use): replace built-in tools with bundled skill (#9856) 2026-08-24 11:05:23 +00:00
desktop-oss-workflow.test.js fix(desktop): harden release pipeline (#9009) 2026-08-12 16:38:12 +00:00
dev.test.js fix(review): report what the transcripts prove; build the roster in one call (#7033) 2026-07-18 00:43:57 +00:00
e2e-workflow.test.js fix(ci): keep the post-merge E2E signal on main alive (#7795) 2026-07-28 11:54:52 +00:00
event-loop-yield.test.js fix(ci): yield the event loop between script tests to avoid vitest RPC timeouts (#10037) (#10050) 2026-08-26 07:11:15 +00:00
generate-changelog.test.js feat(release): user-facing bilingual digest for release notes (#9216) 2026-08-17 00:12:04 +00:00
generate-release-notes.test.js feat(release): user-facing bilingual digest for release notes (#9216) 2026-08-17 00:12:04 +00:00
get-release-version-python-sdk.test.js feat(sdk-python): add network timeouts to release version helper (#3833) 2026-05-05 19:25:00 +08:00
get-release-version.test.js feat(channels): add DingTalk Workspace channel (#9394) 2026-08-25 06:40:47 +00:00
install-script.test.js fix(install): avoid Get-FileHash for Windows checksums (#9112) 2026-08-14 01:12:08 +00:00
integration-vitest-config.test.ts fix(tests): apply integration worker limits to forks (#8689) 2026-08-08 00:53:33 +00:00
issue-triage-ownership-workflow.test.js ci: remove broken legacy scheduled PR triage workflow (#8434) 2026-08-03 10:20:42 +00:00
lint.test.js fix(ci): cache downloaded linters on ECS runners (#9001) 2026-08-13 05:13:23 +00:00
live-host-oss-workflow.test.js fix(live): restore Live Host after desktop removal (#9994) 2026-08-25 12:32:31 +00:00
main-ci-failure-issue-workflow.test.js fix(ci): give the macOS and Windows lanes a trigger again (#9370) 2026-08-25 11:53:05 +00:00
no-ak-integration-ci.test.js fix(ci): give the macOS and Windows lanes a trigger again (#9370) 2026-08-25 11:53:05 +00:00
no-core-root-barrel-config.test.js refactor(core): remove root barrel self-imports and enforce the boundary (#9635) 2026-08-22 13:42:10 +00:00
no-core-root-barrel-import.test.js refactor(core): remove root barrel self-imports and enforce the boundary (#9635) 2026-08-22 13:42:10 +00:00
no-core-utils-upward-import.test.js refactor(core): make utils/ a leaf layer (#9778) 2026-08-24 07:43:01 +00:00
no-utils-upward-import-config.test.js refactor(cli): enforce utils leaf-layer dependency direction (#9146) (#9737) 2026-08-23 14:41:49 +00:00
no-utils-upward-import.test.js refactor(cli): enforce utils leaf-layer dependency direction (#9146) (#9737) 2026-08-23 14:41:49 +00:00
package-assets.test.js fix(review): harden the pipeline against four live-run failures (#9086) 2026-08-14 04:38:49 +00:00
package-scripts.test.js feat(channels): add DingTalk Workspace channel (#9394) 2026-08-25 06:40:47 +00:00
pr-force-push-reminder-workflow.test.js ci(autofix): run agents on dedicated ECS runners (#6207) 2026-07-03 07:40:07 +00:00
pr-self-report-label.test.js feat(autofix): escalate stopped takeover PRs and age out unanswered pauses (#8960) 2026-08-15 17:32:23 +00:00
qwen-autofix-fork-bridge-workflow.test.js fix(ci): gate the fork signal on fields the review payload delivers (#9469) 2026-08-22 18:47:00 +00:00
qwen-autofix-workflow.test.js fix(ci): give the macOS and Windows lanes a trigger again (#9370) 2026-08-25 11:53:05 +00:00
qwen-fleet-shepherd-workflow.test.js fix(ci): stop counting wedged queued runs as in-flight in the shepherd (#9518) 2026-08-20 13:37:22 +00:00
qwen-pr-review-workflow.test.js fix(ci): give the macOS and Windows lanes a trigger again (#9370) 2026-08-25 11:53:05 +00:00
qwen-repo-hygiene-workflow.test.js fix(ci): route workflow label mutations through REST (#8761) 2026-08-09 15:05:15 +00:00
qwen-resolve-workflow.test.js fix(ci): keep the review workflow under the expression-length limit (#8720) 2026-08-08 05:53:35 +00:00
qwen-triage-finalize-workflow.test.js fix(ci): rename triage status marker to avoid duplicate-guard collision (#7723) 2026-07-26 15:51:22 +00:00
qwen-triage-workflow.test.js fix(ci): heal a symlinked workspace instead of wedging the runner on it (#9498) 2026-08-20 13:54:36 +00:00
release-helpers.test.js refactor: extract shared release helper utilities (#3834) 2026-05-05 10:15:17 +08:00
release-sdk-workflow.test.js fix(ci): skip empty SDK release PR (#6861) 2026-07-14 13:19:42 +00:00
release-workflow.test.js fix(live): restore Live Host after desktop removal (#9994) 2026-08-25 12:32:31 +00:00
review-source-digest.test.ts refactor(cli): enforce utils leaf-layer dependency direction (#9146) (#9737) 2026-08-23 14:41:49 +00:00
review-worktree-cleanup-workflow.test.js fix(ci): move undeletable workspace residue aside instead of leaving it (#9868) 2026-08-24 08:58:16 +00:00
sandbox-command.test.js fix(scripts): avoid shell injection in sandbox command detection (#6108) 2026-07-01 16:20:40 +08:00
sdk-java-workflow.test.js ci: route trusted-author fork PRs and no-checkout jobs to the ECS pool (#8502) 2026-08-04 03:48:24 +00:00
sdk-node-exporter-stub.test.js chore(deps): Clear high-severity CVE baseline and harden the security gate (#9584) 2026-08-21 07:43:32 +00:00
security-workflows.test.js chore(deps): Clear high-severity CVE baseline and harden the security gate (#9584) 2026-08-21 07:43:32 +00:00
serve-ab-workflow.test.js fix(ci): narrow serve-ab's self-hosted wipe to the A/B checkout dirs (#9228) 2026-08-24 13:27:38 +00:00
serve-fast-path-bundle-check.test.js feat(ci): fail the startup bundle check when the CLI entry is hoisted into a chunk (#8203) 2026-07-31 08:57:57 +00:00
start.test.js fix(review): report what the transcripts prove; build the roster in one call (#7033) 2026-07-18 00:43:57 +00:00
test-setup.ts fix(ci): yield the event loop between script tests to avoid vitest RPC timeouts (#10037) (#10050) 2026-08-26 07:11:15 +00:00
update-ecs-runner-qwen-workflow.test.js fix(ci): reconcile ECS runner updater on workflow changes (#8373) 2026-08-02 09:25:17 +00:00
upload-aliyun-oss-assets.test.js feat(installer): add standalone hosted install and uninstall flow (#3828) 2026-05-21 11:57:10 +08:00
verify-capture.test.js fix(ci): avoid verify capture color conflict (#8236) 2026-07-31 14:15:40 +00:00
vitest-global-setup.test.js fix(devx): fail with actionable message when unit-test build prerequisites are missing (#9149) (#9171) 2026-08-18 13:19:09 +00:00
vitest.config.ts fix: repair the Windows and macOS test lane failures (#9728) 2026-08-25 11:49:27 +00:00
workflow-helpers.js ci: run Windows merge queue tests on ECS (#8386) 2026-08-05 12:14:42 +00:00
workflow-size.test.js fix(ci): scope workflow-size ratchet to the PR that grew the file (#9931) 2026-08-25 01:46:34 +00:00
workspaces.test.js feat(desktop): remove packages/desktop after OpenWork fork; keep the Tauri upgrade bridge (#9085) 2026-08-25 05:26:11 +00:00