Skip to content

fix(cli): restore self-update from the CDN and GitHub release archives - #285

Merged
elkaix merged 1 commit into
mainfrom
fix/reenable-self-update
Sep 4, 2026
Merged

fix(cli): restore self-update from the CDN and GitHub release archives#285
elkaix merged 1 commit into
mainfrom
fix/reenable-self-update

Conversation

@elkaix

@elkaix elkaix commented Sep 4, 2026

Copy link
Copy Markdown
Member

Related Issue

No issue. Reported directly: pythinker update fails with "Self-update is disabled in this build" on every install.

Problem

Both CDN fetchers and the native staging entry point threw a fixed disabled-message error, so pythinker update and pythinker upgrade could never check for or install a release. The infrastructure was fine the whole time: code.pythinker.com/pythinker-code/latest and latest.json serve the current version, and every GitHub release carries manifest.json plus the six per-platform zips.

What changed

  • Version checks read the CDN /latest (plain text) and /latest.json (rollout manifest) again, with the plain-text fallback restored.
  • The native manifest and binary URLs resolve to the GitHub release of the requested version (manifest.json and pythinker-code-<target>.zip), matching what release.yml publishes and what install.sh consumes.
  • Native staging now verifies the archive sha256 against the manifest, then extracts its single entry with a small built-in zip reader (stored and deflate only, ZIP64 and multi-entry archives rejected) and records the extracted binary's own digest and size. The startup swap re-verifies against that digest, unchanged.
  • Orphan cleanup recognizes the new .zip.part download intermediate.

Tests: the three update suites were restored from their pre-disable versions and adapted to the zip contract (yazl-built fixtures), plus a new suite for the zip reader. A one-off live check confirmed fetchLatestFromCdn and fetchNativeReleaseManifest resolve the current 1.11.1 release end to end.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: the issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Both CDN fetchers and the native staging path threw a fixed 'Self-update is
disabled in this build' error, so 'pythinker update' and 'pythinker upgrade'
never worked. The CDN still serves /latest and /latest.json and every
release carries manifest.json plus per-platform zips on GitHub, so nothing
had to change server-side.

- Version checks read code.pythinker.com/pythinker-code/latest[.json] again.
- The native manifest and binaries resolve to the GitHub release of that
  version (manifest.json + pythinker-code-<target>.zip).
- Native staging verifies the archive sha256 from the manifest, then
  extracts its single entry with a small built-in zip reader (stored and
  deflate only, ZIP64 rejected) and records the extracted binary's own
  digest for the startup swap re-verify.
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 95 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 8b94bec1-f63f-4eec-b4b0-432116aed02b

📥 Commits

Reviewing files that changed from the base of the PR and between 30f8e2d and 0f24eee.

📒 Files selected for processing (10)
  • .changeset/reenable-self-update.md
  • apps/pythinker-code/src/cli/update/cdn.ts
  • apps/pythinker-code/src/cli/update/native-manifest.ts
  • apps/pythinker-code/src/cli/update/native-stage.ts
  • apps/pythinker-code/src/cli/update/zip-archive.ts
  • apps/pythinker-code/src/constant/app.ts
  • apps/pythinker-code/test/cli/update/cdn.test.ts
  • apps/pythinker-code/test/cli/update/native-manifest.test.ts
  • apps/pythinker-code/test/cli/update/native-stage.test.ts
  • apps/pythinker-code/test/cli/update/zip-archive.test.ts

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Sep 4, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pymodel/pythinker-code@0f24eee
npx https://pkg.pr.new/@pymodel/pythinker-code@0f24eee

commit: 0f24eee

@elkaix
elkaix enabled auto-merge (squash) September 4, 2026 06:22
@elkaix
elkaix merged commit 3b6d4d0 into main Sep 4, 2026
25 checks passed
@elkaix
elkaix deleted the fix/reenable-self-update branch September 4, 2026 06:25
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.

1 participant