Skip to content

fix(cli): resolve wright self-update through the R2 release distribution - #457

Merged
Teakowa merged 3 commits into
mainfrom
wright-455-r2-self-update
Sep 30, 2026
Merged

Teakowa merged 3 commits into
mainfrom
wright-455-r2-self-update

Conversation

@e54-bot

@e54-bot e54-bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • wright update / wright update --check now resolve the latest stable version from the plain-text latest/version pointer on the R2 distribution (WRIGHT_INSTALL_BASE_URL, default https://releases.wrightkit.dev/wright), and wright update self --version <VERSION> downloads the immutable releases/<version>/ archive + .sha256 — the same routes install.sh/install.ps1 consume.
  • Removed the GitHub-only self-update path: the releases/latest API endpoint, tag_name JSON parsing, and the WRIGHT_API_URL override. GitHub Release download URLs remain a documented manual recovery path; there is no automatic GitHub fallback.
  • Unified the OPY provider resolver onto the same single-base R2 contract: one WRIGHT_OPY_PROVIDER_BASE_URL (default https://releases.wrightkit.dev/opy-rs) with latest/version + releases/<version>/ under it, replacing the separate WRIGHT_OPY_PROVIDER_LATEST_URL + /releases-suffixed base knobs. Published routes are unchanged.
    • Override semantics change: WRIGHT_OPY_PROVIDER_BASE_URL previously pointed at the /releases-suffixed artifact root; it now points at the namespace root (…/opy-rs). Test/advanced hook only — anyone overriding it must drop the /releases suffix.
  • Checksum verification, platform mapping, matched wright/wright-lsp replacement, downgrade refusal, package-manager provenance, smoke checks, and completion refresh are unchanged.
  • Updated docs/cli/update.md, docs/release.md, and dist/README.md to describe the shared R2 contract.

Test plan

  • cargo fmt --all -- --check, cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --all-targets --all-features — all suites pass
  • tests/update.rs (21 tests): asserts the exact request sequence — latest/version then releases/<version>/<archive> + .sha256 — so a GitHub API path would 404; covers pinned-version routes, malformed latest pointer (GitHub-shaped JSON rejected), missing-archive download failure, checksum mismatch, package-manager skip/refuse, and no-modification paths.
  • opy_provider.rs tests exercise the single-base contract against the mock /opy-rs/latest/version + /opy-rs/releases/ routes.
  • Independent review pass: VERIFIED against install.sh/install.ps1/docs/release.md contract; residual notes are documented above (override semantics) or pre-existing.

Fixes #455

Self-update resolved the latest release through the GitHub Releases API and downloaded artifacts from github.com release-download URLs, so routine `wright update` depended on GitHub API availability and rate limits even though the supported R2 distribution publishes the same contract.

Latest resolution now reads the plain-text latest/version pointer and pinned installs download the immutable releases/<version>/ archive and checksum under WRIGHT_INSTALL_BASE_URL (default https://releases.wrightkit.dev/wright), matching install.sh/install.ps1. The GitHub latest-release endpoint, tag_name JSON parsing, and WRIGHT_API_URL are removed; GitHub Release URLs remain a documented manual recovery path only.

Fixes #455
…ase URL

The provider resolver kept two independent override URLs (WRIGHT_OPY_PROVIDER_LATEST_URL plus a WRIGHT_OPY_PROVIDER_BASE_URL that embedded the /releases prefix). Both collapse into the same single-base R2 contract the installers and self-update now share: one base URL, a latest/version pointer and immutable releases/<version>/ artifacts under it.

The published routes and default distribution (releases.wrightkit.dev/opy-rs) are unchanged; only the override surface and resolver internals are simplified.

Refs #455
@Teakowa
Teakowa enabled auto-merge (squash) September 30, 2026 13:35
@Teakowa
Teakowa merged commit 25ed555 into main Sep 30, 2026
22 checks passed
@Teakowa
Teakowa deleted the wright-455-r2-self-update branch September 30, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Use R2 for Wright self-update and remove GitHub release parsing

2 participants