Commit bbc8c0d
committed
feat(cli): make the update check source a choice of four
The check walked one fixed ladder and read a GitHub-releases-shaped document
from whichever URL answered. That is wrong as soon as people install
differently: an npm user's latest is the registry's latest dist-tag, and
announcing a GitHub release their package manager cannot install yet is worse
than saying nothing. [update] source now selects gh-releases, npm, gh-registry
or custom; unset keeps today's ladder, and an npm-managed install defaults to
asking npm.
Checking is kept separate from downloading. A source returns a version, a
link, a publish time and a headline, and never says where the binary comes
from -- artifacts and their signed manifest always resolve from the release
infrastructure. The manifest is what makes a self-update trustworthy and a
source is a URL a user can point anywhere, so letting it redirect the download
would turn a config setting into arbitrary code execution. A test fails if a
source ever reaches the artifact ladder.
get_update_servers and its private config reader are DELETED rather than left
beside the new code, so the compiler enforces that both call sites moved. Four
sources that pass their own tests while the old ladder still runs underneath
is the failure this avoids.
The npm shapes request the abbreviated packument, which is cheaper and dodges
GitHub's unauthenticated rate limit. The public registry is asked with no
credentials and a test asserts it; GitHub Packages requires a token and fails
naming the fix rather than retrying anonymously and reading a 404 as up to
date. A configured source does not fall back to the ladder on error.1 parent b7e6988 commit bbc8c0d
5 files changed
Lines changed: 666 additions & 40 deletions
File tree
- changelog.d
- crates/perry/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
0 commit comments