qwen-code/scripts/tests
顾盼 32fbedabd6
feat(ci): add auto-generated CHANGELOG.md synced from releases (#4872) (#4881)
* feat(ci): add auto-generated CHANGELOG.md synced from releases (#4872)

Add a Keep a Changelog CHANGELOG.md that is fully derived from the project's
GitHub Releases, so users no longer have to dig through commit history to see
what changed between versions.

- scripts/generate-changelog.js: fetch releases via the gh CLI, keep only
  stable vX.Y.Z tags (nightly/preview omitted), and re-group each release's
  auto-generated "What's Changed" list into Added/Changed/Fixed/Performance/
  Documentation/Other sections by the conventional-commit prefix every PR title
  uses. Zero runtime deps (node builtins + gh).
- release.yml: regenerate and commit CHANGELOG.md on stable releases; the
  commit rides the existing release-branch PR into main.
- package.json: add 'npm run changelog'.
- .prettierignore: skip the generated file.
- Seed CHANGELOG.md from the current stable release history.

Closes #4872

* ci(release): make CHANGELOG regeneration non-blocking

Add continue-on-error to the CHANGELOG step. Its only realistic failures
(the gh API read and the git push) are transient, and the generator rebuilds
from the full release history each run, so a skipped update self-heals on the
next stable release. This keeps a changelog hiccup from blocking the
version-bump PR to main that follows.

* fix(ci): harden changelog generator per review

Address review findings on the changelog generator:

- Command injection: fetchReleasesJsonl built a shell string with the repo
  interpolated; switch to execFileSync (no shell) plus an owner/name format
  check so --repo can never be a shell payload.
- Empty-response clobber: if the API returns zero stable releases (rate limit,
  auth, 5xx), refuse to overwrite CHANGELOG.md and exit 1 instead of committing
  a header-only stub. Paired with set -euo pipefail in the workflow so the
  failure is visible and the non-blocking step self-heals next release.
- Arg parsing: switch getArgs() to parseArgs() (already imported) so a --dryrun
  typo errors instead of silently overwriting, and -h works as documented.
- Breaking changes: capture the conventional-commit ! marker and prefix the
  entry with **BREAKING** (the repo uses feat()!:/refactor()!: in practice).
- Bot authors: ENTRY_RE now accepts a trailing [bot] so GitHub App authors
  (e.g. @dependabot[bot]) are not dropped from release notes.

Regenerates CHANGELOG.md (two entries now flagged **BREAKING**).

* refactor(ci): simplify changelog generator

Quality-only cleanup (output is byte-identical; 23 tests green):

- Single source of truth for sections: derive TYPE_TO_SECTION and
  SECTION_ORDER from one SECTIONS list so they can't drift.
- Parse each entry once: formatRelease now reuses the categorize() result for
  the noise check, section lookup, and formatEntry (was parsed up to 3x).
- Drop the redundant sortKey field; sort directly from version.
- Collapse the duplicated double-.map() setup in the selectStableReleases test.
2026-06-10 14:04:43 +08: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
dev.test.js fix(ci): normalize dev launcher path assertions on Windows (#4915) 2026-06-10 10:20:29 +08: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 📦 Release qwen-code CLI as a Standalone Bundled Package (#866) 2025-10-24 17:08:59 +08:00
install-script.test.js fix(installer): correct 'for more info' URL to GitHub repo instead of docs site (#4916) 2026-06-10 10:46:58 +08:00
package-assets.test.js fix(cli): bundle extension examples (#4719) 2026-06-08 13:57:39 +08:00
release-helpers.test.js refactor: extract shared release helper utilities (#3834) 2026-05-05 10:15:17 +08: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