Commit Graph

279 Commits

Author SHA1 Message Date
AJ ONeal
7f217a6265 test: add comprehensive cache compatibility tests (82 cases)
Tests cover:
- Cache completeness (29 binary + gittag packages)
- Format selection (11 platform/format combos)
- Edge-case platforms (8: FreeBSD, ARM, musl, Windows aarch64)
- Script generation smoke tests (15 packages)
- API vocabulary via transform-releases (6 checks)
- Version format after normalization (10 packages)
- Channel detection (3 packages)
2026-03-11 19:05:19 -06:00
AJ ONeal
0b80afcfde test: add cache value validation for solaris/illumos/universal2
Prevents regressions where someone translates solaris→sunos or uses
arch=universal2. The Node classifier already knows solaris, illumos, and
sunos as distinct OS values. It does NOT know universal2 — use x86_64.

Cache validation checks:
- terraform/syncthing: solaris filenames must have os=solaris (not sunos)
- syncthing: illumos filenames must have os=illumos (not sunos)
- node: sunos filenames must have os=sunos (baseline)
- cmake/hugo: universal filenames must have arch=x86_64 (not universal2)
2026-03-11 16:50:12 -06:00
AJ ONeal
bf08f1b1e1 test: add universal2 tests for cmake/hugo macOS resolution
cmake resolves to v3.19.1 (stable is v4.2.3) and hugo to v0.101.0
(stable is v0.157.0) because universal2 entries are dropped by the
classifier. Marked as known failures until GOER fixes legacy export.
2026-03-11 16:44:55 -06:00
AJ ONeal
386ac1c6e0 test: add broad package resolution sweep (192/198 match production)
Tests all 99 cached packages x 2 platforms (macOS arm64, Linux amd64).
192/198 pass. 6 failures all match production behavior (git, gpg, iterm2,
mariadb — packages without downloadable binaries for these platforms).
2026-03-11 16:24:33 -06:00
AJ ONeal
0b9ea25fbe fix: resolve triplet/version/libc issues in builds-cacher
Three fixes to the installer resolution path:

1. Triplet enumeration order: put specific OS before ANYOS and specific
   arch before ANYARCH. This prevents .git source URLs (ANYOS/ANYARCH)
   from shadowing platform-specific binaries (jq, caddy).

2. WATERFALL libc→gnu+musl: glibc hosts ('libc' in UA) now try
   ['none', 'gnu', 'musl', 'libc'] instead of ['none', 'libc']. This
   lets packages with gnu-linked builds (bat, rg, node) and static musl
   builds (rg v15+) match for glibc hosts.

3. Version-first iteration: findMatchingPackages now iterates versions
   newest-first then tries each triplet, matching the Go resolver's
   approach. Prevents picking an ancient version from a low-priority
   triplet when a newer version exists in another triplet (e.g. rg
   v0.1.6 gnu vs v15.1.0 musl).

Tests updated: all 15 installer-resolve cases pass (was 9+6 known),
30/32 live-diff cases pass (2 known: node Linux amd64 where our code
is better than live, hugo macOS arm64 classifier limitation).
2026-03-11 16:24:33 -06:00
AJ ONeal
09311da214 test: add live-vs-local installer script diff test
Direct behavioral equivalence: fetches live installer from webinstall.dev
with same UA, compares WEBI_* variables against local serveInstaller().
Tests alias resolution (golang→go, ripgrep→rg). Marks jq as known
(.git regression in Go cache).
2026-03-11 16:24:33 -06:00
AJ ONeal
f1c5d483fd test: add comprehensive live-vs-local comparison test
Three test layers against live webinstall.dev APIs:
1. Unfiltered release API — OS/ext vocabulary, version format
2. Filtered release API — correct package for specific OS/arch
3. Installer script rendering — WEBI_* vars, download URLs

47 pass, 2 known format-preference diffs (node .pkg/.7z vs .tar.gz/.zip),
5 known Go-cache improvements (excluding .deb/.pem non-installable formats).
2026-03-11 16:24:33 -06:00
AJ ONeal
1fff212d0b docs: document libc taxonomy (none/musl/gnu/libc semantics)
none = static (no runtime dep, works everywhere)
musl = requires musl runtime (e.g. node-musl)
gnu  = requires glibc (crashes on Alpine)
libc = host UA value meaning "I have glibc"
2026-03-11 16:24:33 -06:00
AJ ONeal
dcb092fa63 ref(test): remove releases.js from expected package files
releases.js files have been deleted — packages now use Go cache files
instead of per-package upstream fetchers.
2026-03-11 16:24:33 -06:00
AJ ONeal
31600d659d fix(test): use correct default formats and document .git regression
The webinstall.dev server passes formats=['tar','exe','zip','xz','dmg']
by default — not empty. Fixed Windows UA to use 'Windows' (not
'Windows_NT'). Identified .git source URLs in Go cache as a regression
vs production (not just a priority issue). Updated PROD_NOTES.md with
webinstall.dev serve-releases.js libc bug finding.
2026-03-11 16:24:33 -06:00
AJ ONeal
94bc9b0c07 test: add installer resolution test for serve-installer.js path
Exercises the helper() function that `curl webi.sh/bat` actually hits.
9 passing, 6 known issues documented:
- WATERFALL libc->gnu gap (build-classifier submodule)
- ANYOS/ANYARCH .git source URLs matched before platform binaries
2026-03-11 16:24:33 -06:00
AJ ONeal
77a965bcba test: add API compatibility test against live webinstall.dev
Compares local cache-only output against golden data fetched from
the live API. Tests OS/arch/ext vocabulary, version format, and
filtered query results for bat, go, node, rg, jq, caddy.
2026-03-11 16:24:33 -06:00
AJ ONeal
13ea83f963 ref: remove all releases.js files and _common/ fetchers
These files are no longer loaded at runtime. All release data now comes
from _cache/YYYY-MM/{pkg}.json files generated by the Go webicached daemon.

Deleted:
- 94 {pkg}/releases.js files (per-package upstream fetchers)
- 8 _common/*.js files (github.js, gitea.js, git-tag.js, fetcher.js, etc.)

Updated:
- _webi/classify-one.js: reads from cache instead of require(releases.js)
- Fixed hardcoded triplet key to use dynamic lookup
2026-03-11 16:24:28 -06:00
AJ ONeal
c572bbe4ca ref(transform-releases): read from cache files instead of upstream APIs
The legacy release API endpoint now reads from _cache/YYYY-MM/{pkg}.json
instead of require()ing {pkg}/releases.js and fetching upstream.

Cache data is re-normalized through normalize.js (with pre-classified
fields cleared first) to preserve the legacy API format where darwin
is reported as 'macos', versions lack 'v' prefix, etc.

Removed: Releases.get(), stale/expired age timers, background renewal,
promise chaining, sleep/timeout workarounds.
2026-03-11 16:23:45 -06:00
AJ ONeal
0f78339725 ref(builds): replace releases.js type check with cache file check
Project type detection no longer require()s {pkg}/releases.js to
determine if a package is valid. Instead it checks for a cache file
at _cache/YYYY-MM/{pkg}.json. This means:

- Packages with Go-generated cache but no releases.js (vim plugins,
  pg-essentials, etc.) are now correctly detected as 'valid'
- The 'not_found' type (broken npm deps) is removed — no longer relevant
- releases.js files are no longer loaded at runtime for type detection
2026-03-11 16:23:45 -06:00
AJ ONeal
81c3d67a4f ref(builds): remove upstream fetching, make Node server cache-only
The Go webicached daemon now handles all upstream API fetching and cache
generation. The Node server reads only from _cache/YYYY-MM/{pkg}.json
files and never fetches from upstream APIs itself.

Removed:
- getLatestBuilds() and getLatestBuildsInner() — upstream fetch functions
- freshenRandomPackage() — background refresh timer
- Stale cache re-fetch in getPackages() process.nextTick block
- _staleAge config (no longer relevant)

When a package has no cache file, getPackages() returns empty metadata
instead of falling through to fetch.
2026-03-11 16:23:45 -06:00
AJ ONeal
8f9b9da4a3 chore: npm run fmt 2026-03-08 19:38:49 -06:00
Michael Dubner
75e39c54a2 fix: add '386' and 'i386' to tab regexp (fixes GH-941) 2025-01-29 22:59:56 +00:00
AJ ONeal
83a6d02d50 fix(api): project 'alias'es (symlinks) should be resolved before checking for 'selfhosted' 2024-12-16 01:02:37 +00:00
AJ ONeal
14cebeeb61 ref(webi): complete transition from 'request' for 'fetch' 2024-12-16 00:01:13 +00:00
AJ ONeal
c94b4cf5c7 fix(windows): use Get-CimInstance instead of deprecated Get-WmiObject 2024-11-10 07:51:52 +00:00
Caleb
d7a4aaf6b7 fix(windows): use Get-WmiObject instead of deprecated wmic
Signed-off-by: Caleb <53413881+CK6853@users.noreply.github.com>
2024-11-10 07:51:23 +00:00
AJ ONeal
005ca9f7da fix(ollama): classify 'rocm' as its own cpu + update classifier 2024-09-16 23:18:07 +00:00
AJ ONeal
efe3df6453 fix(webi): define PKG_STABLE for template when no suitable version is found 2024-09-15 23:39:51 +00:00
AJ ONeal
90eb1587ba doc+fix: enumerateLatestVersions only takes 1 argument 2024-09-13 22:27:08 +00:00
AJ ONeal
e6dcbfb83a feat(installer): show stable, and latest if different from stable 2024-09-13 22:27:07 +00:00
AJ ONeal
8f39617bcd fix: allow 'posix_2017' and 'posix_2024' for non-windows OSes 2024-09-13 08:33:48 +00:00
AJ ONeal
5bb2832ad9 feat(webi): detect 'prev', 'dev', & 'developer' as beta 2024-09-13 08:33:47 +00:00
AJ ONeal
3364dcb075 fix(rpi-zero): add armv6 alias 2024-09-13 08:33:33 +00:00
AJ ONeal
15098ba1d2 ref: use Releases.latest() and Releases.sample() 2024-09-13 08:33:32 +00:00
AJ ONeal
556697ad67 ref: make ./builds-cacher.js one-off testable; add ./classify-one.js 2024-09-11 23:29:22 +00:00
AJ ONeal
595a0b8ef9 fix(linux-gnu): update build-classifier@v1.0.0: respect explicit 'gnu' 2024-09-11 17:18:17 -06:00
AJ ONeal
566b5c047f fix(classifier): log rather than throw on failed classification 2024-08-20 15:51:02 -06:00
AJ ONeal
c71126fcd8 fix: init ~/.config/envman/ during init phase (before pre-install) 2024-07-24 12:23:34 -06:00
AJ ONeal
5c12cb1fa7 fix(busybox): use -k instead of --keep 2024-06-05 17:40:01 +00:00
AJ ONeal
67f361d35c fix(bsd): detect and use OpenBSD 'shasum' 2024-01-15 22:00:01 -07:00
AJ ONeal
05f33b1ff3 fix(bsd): use explicit untar 2024-01-15 22:00:00 -07:00
AJ ONeal
16d108e3d5 fix(fish): treat .app.zip as .zip for extraction 2024-01-15 16:23:14 -07:00
AJ ONeal
904ce1f2d6 fix(cache): set 'updated' to old date, correct typo 2024-01-07 21:04:01 -07:00
AJ ONeal
ca03de16c6 fix(builds-cacher): fallback to setting build.name from build.download 2024-01-02 16:01:43 -07:00
AJ ONeal
8e62e12334 feat(webi): show latest project release version on error 2024-01-02 15:29:19 -07:00
AJ ONeal
f13d582749 ref(webi): show supported OSes, etc with space rather than comma 2024-01-02 15:29:19 -07:00
AJ ONeal
c6bb79648a fix(installer): accept 'ANYOS' if no explicit OS matches 2024-01-02 15:29:19 -07:00
AJ ONeal
22ba86dbed feat(installer): replace getReleases with new builds classifier 2024-01-02 15:29:18 -07:00
AJ ONeal
eec6452769 ref(classify): parallelize release downloads to fetch *much* faster 2024-01-02 15:27:09 -07:00
AJ ONeal
541fdc565e feat: add builds classifier, and lint all builds 2024-01-02 15:27:09 -07:00
AJ ONeal
51b16ba53d feat: add build-classifier submodule 2024-01-02 15:27:09 -07:00
AJ ONeal
546aee8fbb ref: releases.js => installers.js 2023-12-12 02:57:03 -07:00
AJ ONeal
7c61a19e20 ref(internal): packages.js => projects.js 2023-12-12 02:57:02 -07:00
AJ ONeal
281c004445 ref(webi): show supported OSes, Arches, Libcs & Packages more clearly on error 2023-12-12 02:56:01 -07:00