Skip to content

feat(updater): pref-based URL overrides — true cross-OS snapshot sharing - #50

Merged
onemen merged 3 commits into
mainfrom
buffy/p0-8-pref-overrides
Aug 25, 2026
Merged

onemen merged 3 commits into
mainfrom
buffy/p0-8-pref-overrides

Conversation

@onemen

@onemen onemen commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Core change: scriptsUpdater.sys.mjs (and the updater tab) now resolve HASHES_URL / ZIP_BASE_URL / HELPER_BASE_URL through override prefs extensions.firefox-scripts.override.<KEY> before falling back to the generated CONFIG. Tests can point the updater at any local snapshot without touching hashed files — the config ships inside utils.zip and 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() in tools/test/e2e/helpers.mjs compares the baked LOCAL_DIST_PATH against 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-win job becomes a single ubuntu snapshot job serving all updater legs (ubuntu/mac/windows) + both fork legs — true cross-OS sharing. Each leg previously ran its own upload:local --mode=dev (~20-35s × 5 builds/PR); installer legs keep per-OS builds (native binary).

onemen and others added 2 commits August 25, 2026 21:46
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>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d1297a60-3b4e-40c6-bb76-56c22009429a


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Groq AI review (advisory)

Model: openai/gpt-oss-120b · diff: main...buffy/p0-8-pref-overrides

.github/workflows/e2e.yml

No issues found.

core/chrome/utils/updater/scriptsUpdater.sys.mjs

The update module now supports pref‑based URL overrides for testing, adding helper functions to retrieve those values. The changes are functionally sound but introduce a potential security concern by allowing unrestricted pref overrides of remote URLs.

tools/publish/remote-ui/updater.js

The changes introduce dynamic URL resolution via new helper functions, which is a functional improvement. Ensure the added functions are synchronous and exported correctly to avoid runtime errors.

tools/test/e2e/helpers.mjs

No issues found.

tools/test/e2e/updater-e2e.mjs

No issues found.

tools/test/unit/localConfigOverrides.test.mjs

No issues found.

4 finding(s) across the reviewed files — see the inline comments.

Advisory only — this review never blocks the merge. Groq free-tier limits apply.

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>
@onemen
onemen merged commit 45b2ed8 into main Aug 25, 2026
18 checks passed
@onemen
onemen deleted the buffy/p0-8-pref-overrides branch August 25, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant