-
-
Notifications
You must be signed in to change notification settings - Fork 159
Add a release cooldown, a skip-this-version answer, and the updates documentation #7786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
proggeramlug
merged 1 commit into
PerryTS:main
from
jdalton:feat/update-cooldown-and-docs
Aug 11, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| ### Changed | ||
|
|
||
| **The update cache carries its shape, and a foreign shape is discarded rather | ||
| than migrated.** `~/.perry/update-check.json` now records a `schema` number; a | ||
| value this build does not recognize — including its absence, which reads as `0` — | ||
| means the file is thrown away and the next check rewrites it. | ||
|
|
||
| This replaces the alternative, which was to keep every field optional forever so | ||
| that older shapes still load. That trade is a bad one for a cache: it buys one | ||
| saved network request in exchange for a set of `Option` fields that only exist | ||
| to describe versions nobody runs, and that nothing ever removes. Bumping | ||
| `CACHE_SCHEMA` is now the whole migration story. | ||
|
|
||
| **One spelling per check source.** `github`, `npm-registry` and | ||
| `github-packages` are gone; the names are `gh-releases`, `npm`, `gh-registry` | ||
| and `custom`. A set of accepted aliases is a surface to document and test | ||
| forever in exchange for saving one look at the docs. | ||
|
|
||
| An unknown `source` still falls back to the default rather than failing, but for | ||
| a different reason than compatibility: an update check is the wrong place to | ||
| turn a config typo into a hard error. | ||
|
|
||
| <details> | ||
| <summary><b>Tests</b></summary> | ||
|
|
||
| The test that asserted a pre-throttle cache still loads is replaced by one | ||
| asserting the opposite — that a foreign schema, and an absent one, are both | ||
| recognized as not-ours. Verified at runtime as well: a planted cache with no | ||
| schema, claiming version `99.0.0` and a `last_check` in 2099, was ignored, a | ||
| real check ran, and the file came back stamped `"schema": 1`. | ||
|
|
||
| `cargo test -p perry`: 930 passed, 0 failed. | ||
| </details> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| ### Added | ||
|
|
||
| **`auto` waits a day before installing a brand-new release.** `min_age_hours` | ||
| defaults to 24 for `auto` and 0 for every other mode, so a notice still mentions | ||
| a release the moment it exists while an unattended install holds off. | ||
|
|
||
| A release published by mistake, pulled shortly after, or published by someone | ||
| who should not have been able to is most dangerous in its first hours. Waiting | ||
| costs nothing and means your machine is not the one that finds out. `notify` and | ||
| `prompt` are unaffected — they tell a human, who can decide. | ||
|
|
||
| **An unknown publish date counts as too fresh, not as old enough.** The | ||
| abbreviated npm document carries no dates, so treating unknown as "old enough" | ||
| would switch the cooldown off for exactly the people using the cheapest source — | ||
| a protection present in the config and absent in effect. `min_age_hours = 0` | ||
| turns it off deliberately. | ||
|
|
||
| **The prompt has three answers.** "No" and "never tell me about this one" are | ||
| different intentions, and with only two answers a user who does not want one | ||
| specific release has to switch the whole mode off — which then hides the release | ||
| that fixes it. Answering the third writes `skip_version`, which suppresses | ||
| exactly that version; the next release is mentioned normally. | ||
|
|
||
| **The notice says what the release is,** not only that one exists. Sources that | ||
| carry a title now pass it through, and it prints under the version line at no | ||
| extra request. | ||
|
|
||
| ### Documentation | ||
|
|
||
| New page `docs/src/cli/updates.md`, covering the default behaviour, everything | ||
| in `[update]`, the four modes and their three refusals, the four check sources, | ||
| the cooldown, skipping a version, exactly what a check transmits, and where the | ||
| two files live. `perry update`'s section in `commands.md` is rewritten around | ||
| `--mode`; `installation.md` gains the per-package-manager upgrade table; the | ||
| environment tables in `flags.md` gain `NO_UPDATE_NOTIFIER` and | ||
| `PERRY_UPDATE_MODE`. | ||
|
|
||
| <details> | ||
| <summary><b>Tests</b></summary> | ||
|
|
||
| Four new, bringing the update surface to 22 in `update_policy`: | ||
|
|
||
| - `auto` holds off inside the cooldown and installs past it, while `notify` and | ||
| `prompt` are never held back; | ||
| - an unknown release age is treated as too fresh, and an explicit `0` still lets | ||
| it through so nobody is stuck; | ||
| - the cooldown defaults to a day for `auto` only, and an explicit value wins for | ||
| every mode; | ||
| - a skipped version suppresses itself and **not** the next one, which is what | ||
| separates it from switching notices off. | ||
|
|
||
| `cargo test -p perry`: 929 passed, 0 failed. | ||
| </details> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.