Commit 79fd3e8
committed
feat(updates): a bundle says which core it needs, and is refused when it is below
The core, the Admin UI and the Player are three artefacts on three release
cadences, each behind its own button, pressed in whatever order somebody
chooses. Nothing related them. A console built against endpoints this core
does not have installed onto it without a word, and the result is not an
error anyone sees — a page that renders and then quietly 404s.
Two mechanisms, with different jobs.
The channel decides the ordinary case. Web bundles had none: both the fetch
scripts and the in-place update used `releases/latest/download/...`, and that
endpoint never resolves to a prerelease — so a beta bundle could not reach a
beta install at all, and every UI change had to ship as a stable release that
then also landed on installs still running 3.1.0. Bundles now follow the
channel of the core serving them, with stables still eligible behind the
prereleases, because these repos may publish none. Within the channel the
newest release whose `minCore` this core satisfies wins, so an install on an
older core receives the last bundle built for it rather than a dead button.
Release manifests are published beside the tarball so that choice costs one
small JSON per candidate instead of a download.
`minCore` is the backstop. Each bundle states the oldest core that can serve
it, and the update preflight reads it out of the staging directory before the
swap — nothing has moved yet, so a refusal costs nothing and rolls nothing
back. 409 rather than 500: the install was declined, the previous bundle is
untouched, and the fix is to update the core first.
Both fields are open on unknowns. A bundle that states no minimum is every
bundle released before today, and a core reporting `dev` is a working copy;
neither may be gated.
Alongside:
- `shared/semver.ts` replaces a comparator that split on `[.-]` and so read
`4.0.0` as older than its own `4.0.0-beta.21`. Harmless while it only
ordered speaker builds; wrong the moment it decides an install, and this
project has spent its whole 4.0 cycle on prereleases.
- `/info` reports both bundles with whether they fit, added beside `player`
rather than replacing it: an Admin UI older than this server has to keep
reading what it always read. It also reports what this core asks of its
bundles, which cannot be enforced — a console too old to serve is already
the one rendering the page — only said.
- The prerelease lookup swallowed nothing, so a repo answering 404 would have
rejected under the shared `Promise.all` and nulled every version in the
batch. It now propagates only a refusal, which is what tells the cache to
keep what it knew.
- One listing per repo answers both "newest release" and "newest prerelease",
so covering three repos instead of one costs no more of the hourly budget
than before.1 parent 131082c commit 79fd3e8
11 files changed
Lines changed: 975 additions & 73 deletions
File tree
- scripts
- src
- adapters/http/adminApi/misc
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
| 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 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
0 commit comments