feat(updater): pref-based URL overrides — true cross-OS snapshot sharing - #50
Conversation
Add extensions.firefox-scripts.override.<KEY> string prefs (HASHES_URL, ZIP_BASE_URL, HELPER_BASE_URL) that win over the generated CONFIG in scriptsUpdater.sys.mjs and the updater tab. Lets tests point the updater at any local snapshot without rewriting the config file — which ships inside utils.zip and is part of the hashed file set, so mutating it flips the package hash and breaks the staleness check. localConfigOverrides() in the E2E helpers sets the prefs automatically when a snapshot was built on another machine (cross-OS sharing), with unit tests. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
With pref-based URL overrides in scriptsUpdater.sys.mjs, the snapshot no longer needs to be hash-consistent with the runner's own path: on a different OS the test repoints the updater at its local copy via extensions.firefox-scripts.override.<KEY> prefs (localConfigOverrides), so a single ubuntu-built snapshot serves the ubuntu/mac/windows updater legs and both fork legs. Each leg previously ran its own upload:local --mode=dev (~20-35s × 5 builds per PR); the installer legs keep per-OS builds (they need the native binary). 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Groq AI review (advisory)Model:
|
localConfigOverrides() reads the generated updater-config.sys.mjs from the extracted utils, but the call ran before extractZip — so on cross-OS legs the override prefs were never set and the scheduler kept the baked ubuntu file:// URLs (unreachable on win/mac/fork runners), failing the stale scenarios. Ubuntu passed only because its path matches (no-op). 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Core change:
scriptsUpdater.sys.mjs(and the updater tab) now resolveHASHES_URL/ZIP_BASE_URL/HELPER_BASE_URLthrough override prefsextensions.firefox-scripts.override.<KEY>before falling back to the generatedCONFIG. Tests can point the updater at any local snapshot without touching hashed files — the config ships insideutils.zipand is part of the hashed file set, so rewriting it (the earlier #48 approach) flips the package hash and makes "up-to-date" look stale.Automatic test support:
localConfigOverrides()intools/test/e2e/helpers.mjscompares the bakedLOCAL_DIST_PATHagainst the runner's snapshot dir and, when they differ (snapshot built on another OS), seeds the three override prefs pointing at the local copy. No-op when paths match (same-OS). 4 new unit tests.E2E payoff: the Windows-only
snapshot-winjob becomes a single ubuntusnapshotjob serving all updater legs (ubuntu/mac/windows) + both fork legs — true cross-OS sharing. Each leg previously ran its ownupload:local --mode=dev(~20-35s × 5 builds/PR); installer legs keep per-OS builds (native binary).