Skip to content

feat(update): add updateTag config to follow a dist-tag channel - #204

Merged
ranxianglei merged 1 commit into
masterfrom
2026-08-23_auto-update-by-channel
Sep 7, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-08-23_auto-update-by-channel

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Aug 23, 2026 •

Copy link
Copy Markdown
Owner

Rework of #204 (fixes #602) onto current master — single commit d5680a0, mergeable.

What (unchanged from the original PR)

  • updateTag config — file key updateTag, env ACP_UPDATE_TAG, default latest. Both the background auto-updater and bili update fetch the configured channel's registry document instead of always /latest. PR-preview dist-tags (pr-N) are only followed when explicitly configured, so publishing a PR preview never pulls a stable user forward.
  • isVersionNewer replaces the 3-part numeric compare: prereleases order older than their release (0.1.46-pr.202.1 < 0.1.46), prerelease parts compare numeric-then-lexicographic. Fixes a real edge: a beta install (0.1.47-beta.1) parsed equal to its final (0.1.47) and would never see the release.

Rework notes

⚠️ Release sequencing (AGENTS.md §5)

This touches src/update.ts — the updater itself. Per §5 it must not ride the next release directly:

  1. merge nothing update-related yet; cut a no-op release first (pure version bump),
  2. observe a real auto-upgrade succeed on it,
  3. then merge this PR and ship it in the following release.

@github-actions

github-actions Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-08-23_auto-update-by-channel (d5680a0)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-204

Each push to this PR publishes a new version under the pr-204 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr204.tgz
npm install -g package

This comment is automatically updated on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

Review vs master 3cd85b6: ✅ design correct — needs rebase (conflict in src/update.ts) and release-flow sequencing (AGENTS.md §5: any src/update.ts change ships only after a validated no-op release).

Code findings:

  • The semver rewrite (isVersionNewer + parseSemVer) is a genuine fix over the old 3-numeric compare: prerelease ordering (0.1.46-pr.202.1 < 0.1.46), multi-digit segments (0.2.0 < 0.10.0). Behavior edge: non-3-part inputs (1.2) now return "not newer" instead of being tolerated — acceptable for npm dist-tag metadata (always 3-part).
  • updateTag plumbing (env ACP_UPDATE_TAG ?? file ?? "latest", .trim() || "latest" guard) is clean; bili update reloading config via loadOptions() keeps the manual path on the same channel ✓
  • Tests are solid (semver matrix + mocked-fetch URL capture for dev/latest/pr-N).
  • Registry URL uses encodeURIComponent(tag) ✓.

Pre-merge checklist:

  1. Rebase onto current src/update.ts (master diverged: Windows tar fix, etc.).
  2. Add ACP_UPDATE_TAG row to CONFIGURATION.md (+zh-CN) — currently undocumented.
  3. Ship order: no-op release first, then this (updater-path change).

Related: #606 (three-state mode from #86) wants the same config surface — worth merging the config plumbing once.

(tracking: #602)

…se-aware comparison

Rework of PR#204 (issue #602) onto current master:

- updateTag config (file key `updateTag`, env `ACP_UPDATE_TAG`, default
  `latest`): the auto-updater and `bili update` fetch the configured
  channel's registry document instead of always /latest. PR preview tags
  (pr-N) are only followed when explicitly configured.
- isVersionNewer replaces the 3-part numeric compare: prereleases now order
  older than their release (0.1.46-pr.202.1 < 0.1.46) and prerelease parts
  compare numeric-then-lexicographic — fixes a beta install never seeing
  its own final release (0.1.47-beta.1 == 0.1.47 under the old compare).
- Conflicts resolved by union with #609 (resolveProxy egress wiring kept;
  channel rides the same fetch) and #327 (staleInstallStatus branch kept).
- Tests: pure-helper coverage via exported registryUrlFor/normalizeUpdateTag
  (the old fetch-mocked tests predate the #327 source-checkout guard, which
  short-circuits checkForUpdate before fetch in any git checkout).
- Docs: CONFIGURATION.md/.zh-CN.md rows for ACP_UPDATE_TAG.

Fixes #602
@ranxianglei
ranxianglei force-pushed the 2026-08-23_auto-update-by-channel branch from 628cf33 to d5680a0 Compare September 7, 2026 13:13
@ranxianglei
ranxianglei merged commit f1bd258 into master Sep 7, 2026
6 checks passed
This was referenced Sep 7, 2026
@ranxianglei
ranxianglei deleted the 2026-08-23_auto-update-by-channel branch October 15, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auto-update: follow a dist-tag channel (updateTag) instead of always latest

1 participant