qwen-code/scripts/tests
qwen-code-dev-bot 955ad27fc7
fix(scripts): handle missing NPM dist-tags gracefully in release versioning (#6476) (#6481)
* fix(scripts): handle missing NPM dist-tags gracefully in release versioning (#6476)

getAndVerifyTags now returns null instead of throwing when no baseline
version exists on NPM. getPreviewVersion and getStableVersion fall back
to the package.json base version, matching the pattern already used by
getNightlyVersion. This prevents the release workflow from failing when
no nightly or preview dist-tag has been published yet.

* fix(scripts): harden release versioning against transient NPM errors and missing dist-tags (#6476)

- Distinguish 404 from transient errors in getVersionFromNPM so NPM
  outages halt the release instead of silently falling back
- Consult getAllVersionsFromNPM when dist-tag is missing to derive
  baseline from published versions rather than returning empty
- Add console.error logging when getAndVerifyTags returns null
- Validate package.json fallback version in getStableVersion and
  getPreviewVersion
- Add tests for promote-nightly/patch throw paths, true greenfield
  scenario, versions-list derivation, and transient error propagation

* fix(scripts): propagate transient NPM errors in getAllVersionsFromNPM (#6476)

getAllVersionsFromNPM silently swallowed all errors including transient
network failures (ETIMEDOUT, ECONNRESET), which became load-bearing now
that the missing-dist-tag fallback depends on it. Match the same 404-only
pattern already used by getVersionFromNPM. Also fix a DRY violation in
getPreviewVersion, correct misleading test comments, and add test
coverage for the versions-list error path and latest filter branch.

* fix(scripts): tighten 404 detection and tolerate transient versions-list failures (#6476)

- Remove redundant '404' substring check; E404 is the canonical npm error code
  and bare '404' could false-match unrelated errors (port 4043, E4040)
- Catch transient versions-list errors in detectRollbackAndGetBaseline when
  distTagVersion is already resolved, avoiding hard-blocking a release when
  rollback detection is merely a safety net
- Update and add tests for the new fallback behavior and deprecated-versions path

* fix(scripts): guard release version fallback edge cases

* test(scripts): cover greenfield versions list E404

---------

Co-authored-by: Qwen Code Autofix <qwen-code-bot@alibabacloud.com>
Co-authored-by: qwen-code[bot] <qwen-code[bot]@users.noreply.github.com>
Co-authored-by: Qwen Code Autofix <qwen-code@autofix.bot>
Co-authored-by: yiliang114 <effortyiliang@gmail.com>
2026-07-08 12:21:14 +00:00
..
build-and-publish-image-workflow.test.js ci(autofix): restore sandbox image flow (#6261) 2026-07-03 15:30:58 +00:00
check-i18n.test.ts fix(i18n): Correct zh-TW translations to match Traditional Chinese conventions (#4129) 2026-05-15 15:26:12 +08:00
chrome-extension-package.test.js fix(ci): cover release integration regressions (#5994) 2026-06-29 11:54:11 +00:00
dev.test.js feat(web-shell): show the qwen-code version in the sidebar footer (#6222) 2026-07-03 08:56:08 +00:00
generate-changelog.test.js feat(ci): add auto-generated CHANGELOG.md synced from releases (#4872) (#4881) 2026-06-10 14:04:43 +08: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 fix(scripts): handle missing NPM dist-tags gracefully in release versioning (#6476) (#6481) 2026-07-08 12:21:14 +00:00
install-script.test.js feat(channels): Add channel agent bridge abstraction (#5978) 2026-06-29 10:03:28 +00:00
lint.test.js ci: stabilize actionlint on self-hosted runners (#6113) 2026-07-01 09:25:42 +00:00
no-ak-integration-ci.test.js ci: route the merge queue's Linux jobs onto ECS (#5854) 2026-06-25 09:25:09 +00:00
package-assets.test.js feat(core): add dataviz bundled skill (#6198) 2026-07-03 01:06:39 +00:00
package-scripts.test.js perf(ci): optimize autofix pipeline — fast-track, skip duplicate build, scoped tests (#6315) 2026-07-05 02:32:04 +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
qwen-autofix-workflow.test.js fix(autofix): report review handoff failures (#6415) 2026-07-07 12:27:13 +00:00
qwen-resolve-workflow.test.js fix(ci): skip stale PR review runs (#6313) 2026-07-04 20:15:30 +00:00
qwen-triage-workflow.test.js fix(ci): Stop review bots for closed PRs (#6304) 2026-07-04 14:16:47 +00:00
release-helpers.test.js refactor: extract shared release helper utilities (#3834) 2026-05-05 10:15:17 +08:00
sandbox-command.test.js fix(scripts): avoid shell injection in sandbox command detection (#6108) 2026-07-01 16:20:40 +08:00
serve-fast-path-bundle-check.test.js fix(cli): Handle ACP read_file for managed local paths (#6021) 2026-06-30 11:15:49 +00:00
test-setup.ts feat(installer): add standalone archive installation (#3776) 2026-05-11 13:25:48 +08: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
vitest.config.ts refactor(auth): unify provider config in core, simplify /auth as "Connect a Provider" (#4287) 2026-05-20 23:48:52 +08:00
workspaces.test.js feat(desktop): Add desktop app package with Qwen ACP SDK integration (#3778) 2026-06-11 21:57:20 +08:00