Commit graph

112 commits

Author SHA1 Message Date
易良
62ab5f47de fix(installer): validate Aliyun latest version without findstr 2026-05-18 13:06:47 +08:00
易良
584bb59ab5 fix(installer): parse Aliyun latest version in batch 2026-05-18 11:59:51 +08:00
易良
98315b2110 test(installer): use stable fake Aliyun version on Windows 2026-05-18 11:22:21 +08:00
易良
4a8fea5363 test(release): avoid Windows shim lookup in oss upload tests 2026-05-18 10:58:27 +08:00
yiliang114
3caf3e2f2a test(installer): cover Windows release script regressions 2026-05-18 10:33:13 +08:00
yiliang114
bab96dc094 revert(installer): drop over-engineered ossutil/upload changes
Roll back two changes from a1ef8697b/0a5d308c9 that were not justified
by the actual threat model or release-pipeline needs:

- .github/workflows/release.yml: restore the supported `ossutil config -k`
  invocation. The earlier switch to writing the .ossutilconfig INI file
  in-process was meant to keep the access-key out of /proc/<pid>/cmdline,
  but GitHub-hosted runners are single-tenant ephemeral VMs where no other
  user can read that namespace. The benefit was theoretical; the cost was
  taking on a brittle dependency on ossutil's undocumented config format.

- scripts/upload-aliyun-oss-assets.js: revert the uploadAssets parallel
  rewrite (Promise.all + spawn + setTimeout) back to the original sync
  spawnSync loop with retry. Release-time uploads of ~6 small files do
  not need parallelism, and the async refactor changed the public
  contract (sync→async) for no real wall-clock win.

Kept from those commits:
- The cleanup `if: always()` step that removes RUNNER_TEMP/.ossutilconfig
  at the end of the publish job.
- The cross-platform sleepSync(ms) helper, since `spawnSync('sleep', ...)`
  still does not work on Windows runners.
- The INSTALLATION_GUIDE.md doc fix.
- All other round-2 fixes.

Test assertions updated for the restored sync uploadAssets contract.
2026-05-18 00:05:38 +08:00
yiliang114
547713af7f test(installer): add uploadAssets integration tests with fake ossutil
Add two integration tests that route a temp-directory ossutil shim onto
PATH so uploadAssets actually spawns the real binary with the real cp
argv:

- happy-path test asserts the destination URI, `-c <config>`, `--acl
  public-read`, and per-asset cp invocations land for both inputs.
- failure-path test asserts non-zero ossutil exits surface as an
  aggregate `asset uploads failed` error after the retry budget runs out.
2026-05-17 23:45:37 +08:00
yiliang114
89b272dc15 test(installer): add parseUploadArgs unit tests and align verify derivation
- scripts/tests/upload-aliyun-oss-assets.test.js: cover --help short-circuit,
  required-option validation (--bucket/--config/--prefix/empty assets),
  unknown options, missing option values, and trailing-slash prefix
  normalization.
- scripts/verify-installation-release.js: switch the win-only zip branch
  from `startsWith('win-')` to the strict `=== 'win-x64'` check used by
  build-standalone-release.js, and add a comment recording that the two
  derivations must stay aligned. Without this the helpers would diverge
  the moment a non-x64 win target gets added.
2026-05-17 23:44:20 +08:00
yiliang114
a1ef8697b7 fix(installer): address review feedback round 2
Workflow:
- Move 'Publish Aliyun OSS Latest VERSION' to run after the hosted installer
  assets are uploaded and verified, so the latest/VERSION pointer only flips
  once every release artifact is in place. Previously a hosted-sync failure
  could leave the pointer ahead of the actual installer scripts.

upload-aliyun-oss-assets.js:
- Replace `spawnSync('sleep', ...)` retry backoff with an Atomics.wait-based
  cross-platform sleep so retries also work on Windows runners.

install-qwen-standalone.bat:
- :DetectTarget no longer emits TARGET=win-arm64 because RELEASE_TARGETS has
  no win-arm64 archive; ARM64 hosts now fall through to the unsupported-arch
  branch and (in detect mode) get the npm fallback instead of a 404.
- Add QWEN_INSTALL_CURL_EXE to :ValidateRawEnvironmentOptions so this curl
  override is checked for shell metacharacters like every other knob.
- Replace `call echo %%i>>...` with plain `echo %%i>>...` when capturing
  pre-install qwen.cmd paths; `call` triggered an extra parse pass that
  could interpret &/|/<,>/etc. inside a directory name as command separators.
- Add `--retry 2` to curl.exe downloads (`:DownloadFile` / `:DownloadFileQuiet`)
  to match the shell installer.
- Include expected vs actual hash in the checksum-mismatch error message.

install-qwen-standalone.ps1:
- Stage the downloaded installer at a cryptographically random temp path
  (`qwen-installer-<random>.bat`) so a same-user attacker cannot pre-stage a
  malicious .bat at a predictable path and race the verify/execute window.
- Atomically install the current-session cmd shim by writing to a sibling
  `.new` temp file then renaming, so a partial write cannot leave a
  half-written shim on PATH.
- Add `--retry 2` to the curl.exe download path.
- Include expected vs actual hash in the checksum-mismatch error message.

install-qwen-standalone.sh:
- Include expected vs actual hash in the checksum-mismatch error message.

uninstall-qwen-standalone.ps1:
- Accept `-Purge` and `-Help` parameters; previously every CLI flag was
  silently dropped, so users running with `-Purge` got no purge and no error.
  `-Purge` maps to `QWEN_UNINSTALL_PURGE=1`.

uninstall-qwen-standalone.sh:
- `remove_install_wrapper` additionally requires the wrapper file to start
  with a `#!` shebang before it deletes it; a user-authored script that just
  happens to mention the install path now stays untouched.

verify-installation-release.js, build-hosted-installation-assets.js:
- Include expected vs actual hash in the checksum-mismatch error messages.

scripts/tests/install-script.test.js:
- Update assertions for the new error wording, the curl `--retry 2` flag,
  the dropped ARM64 detection, and the new release-step ordering.
2026-05-17 23:34:25 +08:00
yiliang114
625dfbfa3e test(installer): keep dist backup on same filesystem 2026-05-17 18:18:29 +08:00
yiliang114
3eb6d6c7c3 fix(installer): address hosted release review feedback 2026-05-17 13:44:34 +08:00
yiliang114
c2a3e5cbff Merge remote-tracking branch 'origin/main' into codex/pr-3828-installer-assets 2026-05-17 13:04:09 +08:00
yiliang114
308358d716 fix(release): make ossutil download configurable 2026-05-16 17:02:49 +08:00
yiliang114
0155a4fd88 fix(installer): bound hosted installer probes 2026-05-16 16:59:30 +08:00
yiliang114
63ec525f88 fix(installer): bound Windows download timeouts 2026-05-16 16:00:42 +08:00
yiliang114
0994a809aa fix(installer): harden Windows latest pointer parsing 2026-05-16 15:52:33 +08:00
yiliang114
b3e21a56ae fix(installer): harden hosted release publishing 2026-05-16 00:33:09 +08:00
yiliang114
ecfad9995f test(installer): inject Windows arch overrides in cmd 2026-05-15 23:58:34 +08:00
yiliang114
778919f616 test(installer): cover Windows fake curl helper 2026-05-15 23:32:18 +08:00
yiliang114
1d272f6024 test(installer): use cmd fake curl on Windows 2026-05-15 23:06:33 +08:00
yiliang114
308fe4da93 fix(installer): allow explicit Windows curl path 2026-05-15 22:45:58 +08:00
yiliang114
b2b43b51da test(installer): stabilize Windows fake tool path 2026-05-15 22:22:28 +08:00
yiliang114
c959913dfc fix(installer): harden Windows target detection 2026-05-15 21:49:41 +08:00
yiliang114
7d665f39df fix(installer): address release review follow-ups 2026-05-15 21:00:13 +08:00
yiliang114
7fd314a358 fix(installer): print standalone uninstall commands 2026-05-15 18:26:49 +08:00
yiliang114
a79745b4d8 style(installer): align standalone install output 2026-05-15 17:13:11 +08:00
MikeWang0316tw
02a65f90c4
fix(i18n): Correct zh-TW translations to match Traditional Chinese conventions (#4129)
* fix(i18n): Correct zh-TW translations to match Traditional Chinese conventions

Fix ~131 lines of Traditional Chinese (zh-TW) translations that used
Simplified Chinese character forms instead of standard Traditional
Chinese usage.

Changes:
- 文件 → 檔案 (47 occurrences)
- 爲 → 為 (45 occurrences)
- 啓 → 啟 (44 occurrences)
- 曆史 → 歷史 (6 occurrences)
- 鏈接 → 連結 (4 occurrences)
- 菜單 → 選單 (3 occurrences)

* fix(i18n): Replace 服務器 with 伺服器 (15 occurrences)

Align with Traditional Chinese convention where 伺服器 is the standard
term for 'server' in computing contexts.

* fix(i18n): Update zh-TW.js header comment to prevent accidental overwrite

Clarify that the file is the authoritative source and should not be
overwritten with auto-generated output, to prevent future maintainers
from regenerating with raw OpenCC and losing manual corrections.

* fix(i18n): Add zh-TW regression check and maintenance docs

Addresses reviewer feedback on PR #4129 (points 2 and 3):

- scripts/check-i18n.ts: Iterate over parsed zh-TW translation values
  (not raw file content) and report the offending key. Replace the
  earlier substring list with ZH_TW_FORBIDDEN_PATTERNS, which targets
  the three real regression categories: variant Traditional characters
  produced by OpenCC s2t (爲, 啓), Mainland-Chinese vocabulary (服務器,
  菜單, 鏈接), and pure Simplified characters. Excludes 禁用 / 配置 /
  文件 / 打開 to avoid false positives on Taiwan-valid usage.
- scripts/tests/check-i18n.test.ts: Cover the new check, including
  negative cases for Taiwan-valid vocabulary.
- docs/users/features/language.md: Document zh-TW maintenance — the
  vocabulary table, why raw OpenCC s2t output is not acceptable, and
  where the CI-enforced list lives.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(i18n): Address review feedback on zh-TW check (#4129)

- check-i18n.ts: Sort ZH_TW_FORBIDDEN_PATTERNS longest-first and break
  on first match so e.g. `历史` reports the specific bigram instead of
  also firing the bare `历` rule (no duplicate CI errors).
- check-i18n.ts: Add ZH_TW_ALLOWED_EXCEPTIONS escape hatch so a future
  legitimate translation (e.g. 區塊鏈 in a UI string) can opt out by key
  without weakening the global pattern list.
- docs/users/features/language.md: Add a "CI enforced?" column so
  contributors can tell which rows block CI vs. which are review-only
  style guidance. Replace bare `曆` in the table with the `曆史` bigram
  and note that `曆` is correct in calendar terms (日曆, 農曆, 西曆) —
  prevents a future maintainer from globally replacing 曆→歷.
- Tests: Cover the dedup behavior on overlapping patterns.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs(i18n): Note word-boundary limitation of zh-TW substring check

Document the known limitation that `includes()`-based pattern matching
does not respect Chinese word boundaries — a bigram like `鏈接` will
false-positive on `區塊鏈接口` (區塊鏈 + 接口). Direct contributors to
`ZH_TW_ALLOWED_EXCEPTIONS` when this happens instead of weakening the
pattern list.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 15:26:12 +08:00
yiliang114
bae933332e fix(installer): address standalone review feedback 2026-05-15 15:14:34 +08:00
yiliang114
40ac124927 fix(installer): harden standalone release fallback 2026-05-15 01:54:27 +08:00
yiliang114
8fb2bc1254 fix(installer): resolve Aliyun latest via version pointer 2026-05-14 22:49:07 +08:00
yiliang114
db0a44d620 fix(installer): update download commands to use progress indicators for curl and wget 2026-05-14 20:22:27 +08:00
yiliang114
d2ebed9ac1 fix(uninstall): match shell-quoted paths when removing the wrapper
The installer's write_unix_wrapper shell-quotes the binary path, so
paths containing single quotes (or other shell metacharacters) appear
as shell-quoted strings in the generated wrapper file. The uninstall
script's literal grep -qF missed these, leaving the wrapper orphaned.

Add shell_quote to the uninstall script and match against both the raw
and shell-quoted forms before removing the wrapper.
2026-05-14 17:44:17 +08:00
yiliang114
75e5b58806 feat(installer): add standalone uninstall scripts 2026-05-14 17:31:44 +08:00
yiliang114
74130fc79e fix(installer): make Windows standalone shim available in cmd 2026-05-14 17:00:03 +08:00
yiliang114
ccbdd34f39 fix(installer): auto-backup non-qwen directories and simplify output
- ensure_managed_install_dir / :EnsureManagedInstallDir now back up
  non-qwen directories instead of refusing to install, so users
  upgrading from npm or old installers don't hit a hard error
- Simplify header/footer output: remove banner bars, verbose INFO
  lines, and redundant "Installation completed!" message
- Match bun.sh / code-server style: minimal, to the point
2026-05-14 15:23:18 +08:00
yiliang114
046d200293 fix(installer): suppress progress bars for small downloads and Expand-Archive
- .ps1: replace curl.exe -# with silent mode, suppress Invoke-WebRequest
  progress bar; save/restore $global:ProgressPreference
- .bat: add $ProgressPreference = 'SilentlyContinue' before Expand-Archive
  to prevent full-screen extraction progress UI
- .sh: remove --progress-bar / --show-progress from download_file, always
  use silent curl/wget
2026-05-14 15:09:45 +08:00
yiliang114
01e9767421 fix(installer): use curl.exe -# progress bar in Windows downloads
Prefer curl.exe with -# (hash-mark progress bar) for archive and installer
downloads on Windows 10+. Falls back to Invoke-WebRequest (which shows its
own progress bar) when curl.exe is unavailable. Matches the approach used
by code-server (curl -#fL) and bun.sh (curl.exe -#SfLo).
2026-05-14 13:47:04 +08:00
yiliang114
4b950aba7c fix(installer): suppress PowerShell progress bar in bat installer downloads
Add $ProgressPreference = 'SilentlyContinue' to DownloadFile so the
full-screen progress UI does not appear during archive downloads in
interactive PowerShell sessions, consistent with the .ps1 shim.
2026-05-14 13:34:08 +08:00
yiliang114
4095171f64 fix(installer): suppress PowerShell progress bar in hosted entrypoint shim
Add $ProgressPreference = 'SilentlyContinue' to the .ps1 wrapper so
Invoke-WebRequest downloads don't render a progress bar when invoked
via the irm | iex one-liner.
2026-05-14 13:29:01 +08:00
yiliang114
540bcb8c28 fix(installer): harden hosted release script checks 2026-05-14 10:34:46 +08:00
yiliang114
c6005a74bb feat(installer): refactor argument parsing and utility functions for release scripts 2026-05-14 01:11:19 +08:00
yiliang114
0c8022d491 fix(installer): address hosted installer review gaps 2026-05-13 23:54:05 +08:00
yiliang114
645edb8ec2 chore(installer): remove temporary OSS smoke workflow 2026-05-13 23:35:44 +08:00
yiliang114
48977aeef9 fix(installer): make OSS release assets public-readable
Some checks failed
OSS Smoke Test / Verify Aliyun OSS Credentials (push) Has been cancelled
2026-05-13 23:19:30 +08:00
yiliang114
b0ae7f89f9 ci(installer): add temporary OSS smoke test 2026-05-13 23:12:40 +08:00
yiliang114
7d328be114 feat(installer): wire Aliyun OSS sync, address review followups
- Add Aliyun OSS sync steps to release workflow: package hosted assets,
  install pinned ossutil, configure credentials, upload versioned and
  latest paths, and verify upload via verify:installation-release plus
  curl probes against the hosted installer endpoint.
- Document required production-release environment secrets and bucket
  variables in INSTALLATION_GUIDE.md.
- Restructure hosted endpoint guidance to lead with the pre-sync
  warning, splitting "Run today" (local checkout) from "After the OSS
  sync" (hosted one-liners) so users no longer copy a one-liner that
  silently installs latest.
- Distinguish mirror auto-selection timeout from successful selection
  in install-qwen-standalone.sh and install-qwen-standalone.bat: emit
  a "timed out; defaulting to github" log instead of pretending the
  HEAD probe picked github.
- Support QWEN_INSTALLER_BAT_URL override (https only) in the
  PowerShell shim so staging mirrors can be exercised without forking
  the file.
- Strip a leading UTF-8 BOM in verify-installation-release.js
  parseSha256Sums so BOM-prefixed SHA256SUMS reports a useful
  "Missing checksum entry" error instead of "Malformed SHA256SUMS
  line 1".
- Add tests for verifier HEAD→Range fallback, partial-failure
  formatting, all-failure wording, and BOM tolerance.
2026-05-13 21:22:39 +08:00
yiliang114
72a5efe744 fix(installer): make Windows option validation readable 2026-05-13 20:43:30 +08:00
yiliang114
90935774a2 fix(installer): stabilize Windows installer tests 2026-05-13 19:58:07 +08:00
yiliang114
984b1a9a0e fix(installer): address hosted installer review followups 2026-05-13 19:29:49 +08:00
yiliang114
5f649c9523 chore(installer): stage standalone hosted entrypoints 2026-05-13 19:09:20 +08:00