Skip to content

fix(update): accept dated preview versions with a publication attempt - #8977

Merged
lidge-jun merged 3 commits into
lidge-jun:devfrom
SeongwoongCho:fix/update-preview-version-format
Nov 21, 2026
Merged

lidge-jun merged 3 commits into
lidge-jun:devfrom
SeongwoongCho:fix/update-preview-version-format

Conversation

@SeongwoongCho

@SeongwoongCho SeongwoongCho commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On the preview update channel the dashboard's update dialog says it could not read the latest version from npm ("npm에서 최신 버전을 읽지 못했습니다" / dash.updateUnavailable), although npm view @bitkyc08/opencodex@preview version answers normally. The stable channel is not affected.

Preview releases are published as X.Y.Z-preview.<date>.<attempt> since 2.100.5 (2.100.5-preview.20261118.1, 2.100.6-preview.20261119.1); release.yml and TELEMETRY_VERSION_RE already accept that shape. Two places in src/update still allowed only one numeric segment after -preview.:

  • latestVersionAsync (src/update/async-check.ts) validates the registry answer before using it. It rejected the new shape, so /api/update/check?tag=preview returned latestVersion: null with reason latest_unavailable.
  • parsePreview (src/update/notify.ts) feeds isNewer. It returned null for the new shape, so an install that is itself on such a preview was never offered a newer preview, and on the stable channel was never offered the next stable release.

The fix accepts the optional attempt segment in both. Previews compare by base version, then date, then attempt; a version without an attempt sorts as attempt 0, so the older -preview.<date> and -preview.<n> forms behave as before. The lookup stays strictly numeric and anchored: a third segment, a trailing dot, a second line or another prerelease label is still refused, and the latest channel still refuses any preview version.

Verification

Reproduced on a running 2.100.6 install (npm global, Linux): GET /api/update/check?tag=latest returns 2.100.6, GET /api/update/check?tag=preview returns latestVersion: null, reason: "latest_unavailable".

  • New tests fail on dev without the fix (5 failures: one lookup case, four isNewer cases) and pass with it.
  • bun test tests/update/update-refresh.test.ts tests/update/update-notify.test.ts: 71 pass, 0 fail.
  • bun test tests/update: 1,257 pass, 2 fail. Both failures ("a private copy of npm-install.mjs resolves every import on every host", "isTrustedSystemdRunFile (real filesystem) > accepts a root-owned executable in a root-only-writable directory") also fail on unmodified dev on this machine, a root container.
  • bun run typecheck: 0 errors in 2,681 files. structure:check, privacy:scan and the file-size ratchet pass.

No GUI file changes; the dialog shows the existing strings once the server returns a version.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

🤖 Generated with Claude Code

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • New Features
    • Preview versions can include an optional numeric publication-attempt suffix, such as -preview.2.3.
    • Preview versions are ordered by base version, preview date, and attempt number. An omitted attempt number is treated as zero.
  • Bug Fixes
    • Update notifications are dismissed only for the same channel and version.
    • Version badges report an unknown version when cached information is more than 40 hours old.
  • Documentation
    • Preview-channel documentation now describes the optional attempt suffix.

Preview releases are published as X.Y.Z-preview.<date>.<attempt> since
2.100.5 (for example 2.100.6-preview.20261119.1). The registry lookup only
accepted a single numeric segment after -preview., so the preview channel
treated a valid answer as unreadable and the dashboard reported that it
could not read the latest version from npm. The version comparison had
the same limit, so an install on such a preview was never offered a newer
preview or the next stable release.

Accept the optional attempt segment in the lookup and compare previews by
date, then attempt; a version without an attempt sorts as attempt 0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

No actionable comments were generated in the recent review.

Walkthrough

Preview version parsing now accepts an optional numeric publication attempt. Preview-channel comparisons use the attempt when ordering dated previews and treat a missing attempt as zero.

Changes: Preview Publication Attempts

Layer / File(s) Summary
Registry preview parsing
src/update/async-check.ts, tests/update/update-refresh.test.ts
The registry matcher accepts an optional numeric component after the preview number. Tests cover accepted preview and stable versions, rejected formats, and latest-channel rejection of previews.
Preview attempt comparison
src/update/notify.ts, tests/update/update-notify.test.ts, structure/ops/service-and-sidecars.md
parsePreview returns the attempt as a comparison component and defaults it to zero when absent. Tests cover ordering by base version, date, and attempt. The documentation describes the optional attempt suffix and records dismissal-retention and badge-threshold details.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: Minimal · previous review 88f2a

This change lets preview update checks accept dated preview versions that carry a publication attempt, and it orders them correctly against other previews and stable releases. The scope is small, and the tests cover accepted and rejected version shapes. No material merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(update): accept dated preview versions with a publication attempt" matches the main change. The PR makes preview-version parsing in src/update accept an optional numeric attempt segment…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(update): accept dated preview versions with a publication attempt" matches the main change. The PR makes preview-version parsing in src/update accept an optional numeric attempt segment (for example 2.100.6-preview.20261119.1), and it adds ordering by base version, date, then attempt. The title names the primary fix and stays specific to the update preview-channel behavior. The raw summary covers async-check.ts, notify.ts, the tests, and the docs, and the title fits these changes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8bb582c and 88f2ab9.

Files selected for processing: 1

  • structure/ops/service-and-sidecars.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ⬜ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

Automatic draft conversion failed. Please convert this pull request to a draft manually until every box above is ticked.

Hygiene

✅ Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as ready for review November 20, 2026 01:53
src/update/ is owned by structure/ops/service-and-sidecars.md; note the
accepted preview shapes and their base, number, attempt ordering.
@github-actions
github-actions Bot marked this pull request as draft November 21, 2026 06:19
@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration into dev (per MAINTAINERS.md; maintainer integration, not an independent approval)

  • Exact head: 574d5a3c9a4858ce29192588270fbd57624953ef
  • Checks on this head: 16 passed, 12 skipped, none pending or failing (Ubuntu PR CI; Windows/macOS are covered by the next dev batch gate).
  • Review threads: none unresolved.
  • Review: gpt-6.1-terra, two rounds, final verdict PASS. Not release automation: no change to scripts/release.ts or .github/workflows/release.yml, nor to how releases are published.
  • Fix added in-house: structure/ops/service-and-sidecars.md (owner of src/update/) now records the accepted preview shapes and the base, number, attempt ordering (88f2ab9b4).
  • Regression: tests/update/update-notify.test.ts + update-refresh.test.ts 71 pass on this head; 5 fail with both source files restored from dev.
  • This head merges current dev; on it: typecheck clean, structure:check passes, focused tests 71 pass / 0 fail.

@lidge-jun

Copy link
Copy Markdown
Owner

Marking ready as maintainer: the readiness gate moved this back to draft because of my in-house commits (88f2ab9b4 doc fix, 574d5a3c9 dev merge), not because of anything in the author's change. The integration evidence for this exact head is in the comment above.

@lidge-jun
lidge-jun marked this pull request as ready for review November 21, 2026 06:57
@lidge-jun
lidge-jun merged commit 2d30d3e into lidge-jun:dev Nov 21, 2026
31 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T07:03:53.796391Z 574d5a3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 574d5a3c9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/update/notify.ts Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants