Skip to content

Instantly share code, notes, and snippets.

@escapewindow
Last active June 26, 2019 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save escapewindow/34b112e0ff331132d1a175df98c544dc to your computer and use it in GitHub Desktop.
Save escapewindow/34b112e0ff331132d1a175df98c544dc to your computer and use it in GitHub Desktop.
staging update testing

Testing updates in a try staging release

update channel

To change the update channel of an already-built install, adjust $APPDIR/Contents/Resources/defaults/pref/channel-prefs.js to use pref("app.update.channel", $CHANNEL_NAME);

However, the cert used is baked into the updater based on channel name. Ideally we switch this channel name before the try staging release, or we may have to patch the updater cert (see below).

update cert

Essentially, if the try staging run has an update channel of, say, beta, the updater will expect the release mar cert but the MARs will be signed with the dep cert.

Ben added cert replacement support here. To use,

APP_DIR="~/Desktop/Firefox.app"
TOOLS_DIR=/src/releng/tools
# mac-specific `for` line below
# from https://hg.mozilla.org/build/tools/file/b04a81e9c98cdd15f09ad90a8b5d44eed555ba73/release/updates/verify.sh#l177
# for other platforms, check their `updater_bins` in that file
for bin in "$APP_DIR/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater" "$APP_DIR/Contents/Library/LaunchServices/org.mozilla.updater" ; do

    cp "$bin" "$bin.orig"
    # the .der list is from https://hg.mozilla.org/build/tools/rev/b04a81e9c98cdd15f09ad90a8b5d44eed555ba73#l10.25
    python $TOOLS_DIR/release/replace-updater-certs.py $TOOLS_DIR/release/mar_certs  "$bin.orig" "$bin" nightly_aurora_level3_primary.der dep1.der nightly_aurora_level3_secondary.der dep2.der release_primary.der dep1.der release_secondary.der dep2.der

done

update server

  • in about:config, enable app.update.log and disable app.update.auto
  • open the Developer Tools, use the ... button to go to Settings. Scroll to the bottom and check Enable browser chrome and add-on debugging toolboxes
  • open the Scratchpad (menu Web Developer > Scratchpad)
  • menu bar -> environment -> browser
  • may need to type allow pasting for scratchpad to allow pasting
  • paste in Services.prefs.getDefaultBranch(null).setCharPref("app.update.url", "https://stage.balrog.nonprod.cloudops.mozgcp.net/update/6/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%SYSTEM_CAPABILITIES%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml"); alert('update url modified');
  • remove allow pasting or you'll get a syntax error
  • use the Run button to execute the code. Close Scratchpad.
  • open the browser console for update logging. Updater error numbers are described here.
  • open about:firefox to check for updates

Also see https://developer.mozilla.org/en-US/docs/Mozilla/Setting_up_an_update_server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment