16
edits
Line 1: | Line 1: | ||
= Testing Staged Blocklist = | = Testing Staged Blocklist = | ||
To test a | ==== Prerequisites ==== | ||
To test the full functionality of blocklist v3 against the staging server, you need to set up a Firefox profile with the following preferences: | |||
# | # <code>extensions.blocklist.useMLBF.stashes</code> = true | ||
# | # <code>extensions.blocklist.useMLBF</code> = true | ||
# <code>services.settings.server</code> = https://settings.stage.mozaws.net/v1 | |||
# <code>xpinstall.signatures.dev-root</code> = true | |||
# <code>extensions.webapi.testing</code> = true (new pref to be created to be able to interact with the install button on stage)<br /> | |||
''Note 1: During testing, the behavior should be identical regardless of whether stashes=true or stashes=false. This preference enables an optimization to save bandwidth.''<br /> | |||
''Note 2: The preferences referenced in entries 1 and 2 should be enabled by default in the latest version of Firefox and will not require manually setting them''.<br /> | |||
==== Creating a block entry ==== | |||
Blocks in v3 are managed via the admin tool on AMO, and are automatically on a schedule used to create a new bloomfilter.<br /> | |||
To set up a block entry, follow these steps:<br /> | |||
# Identify an add-on on AMO stage https://addons.allizom.org/ that should be blocked and download the .XPI<br /> ''Note: The add-on needs to be a webextension and approved (signed). Or upload an add-on and download the .XPI once approved and signed.'' | |||
# Install the add-on in Firefox.<br /> ''Note: You will need to enable the preference to install add-ons from AMO stage (xpinstall.signatures.dev-root = true, see Prerequisite #4). Make sure that the add-on appears installed in addons manager (about:addons)'' | |||
# Retrieve the add-on’s guid<br /> ''Note: If the guid is not specified in the manifest.json of the .XPI you can retrieve it from about:debugging#/runtime/this-firefox.'' | |||
# Login at https://addons-internal.stage.mozaws.net/en-US/admin/models/.<br /> ''Note: You will need to connect via Mozilla’s VPN. You will also need to be added to an admin user group on AMO if not already a member. You’ll aslo need the ‘Blocklist:Create’ permission.'' | |||
# Make sure the waffle switch <code>blocklist_mlbf_submit</code> is enabled in https://addons-internal.stage.mozaws.net/en-US/admin/models/waffle/switch/ | |||
# Create a new add-on block record for the add-on guid from Step 1 via https://addons-internal.stage.mozaws.net/en-US/admin/models/blocklist/block/add/<br /> ''Note: If you chose to block multiple guids at a time, the version range can be manually entered (i.e. there is no predefined select field with versions available to choose from). Make sure that at least one version of the guids you work with is covered by your chosen that range, otherwise the you ,might not find the add-on in the new generated blocklist.'' | |||
# If you are blocking an add-on that has a large number of active daily users (over 100k, which is unlikely for AMO stage), or an add-on that has 0 users (which is guaranteed if you created a new add-on in Step 1) then a sign-off is required from a different AMO/FxA user (who will also need to login via the VPN and be in an admin user group on AMO). | |||
# Take note of the contents of https://kinto.stage.mozaws.net/v1/buckets/blocklists/collections/addons-bloomfilters/records<br /> ''Important Note: The new blocklist starts being generated on AMO every 6 hours (06:35 UTC), so it should be available between 06:45 – 07:00 UTC (and every 6 hours thereafter)'' | |||
# Check the contents of https://kinto.stage.mozaws.net/v1/buckets/blocklists/collections/addons-bloomfilters/records have changed since Step 8<br /> ''Note: How to verify the new stash: the stash will contain two sections - <code>blocked: []</code> and <code>unblocked: []</code>; There will be one entry for each combination or <code>"guid:version string”</code> covered by the block range set up in AMO admin. If a block is deleted, all the add-on versions should be located in the <code>stash - unblocked</code> section. Also, keep in mind that if you edit an existing block by expanding the blocked version range (i.e. you include additional add-on versions in the blocked range), you should see the new covered versions in the <code>stash - blocked</code>. Similarly, if you exclude some previous blocked versions from the block range, the excluded versions should be visible in <code>stash - unblocked</code>.''<br /> | |||
==== Connecting to the stage server and triggering a new blocklist ==== | |||
You need to force an update of the blocklist in Firefox and verify that the add-on added in the previous step are indeed blocked. And similarly, marking an add-on as unblocked in the AMO admin tools, forcing an update and verifying that the add-on is unblocked again.<br /> | |||
To point Firefox to the stage server, follow these steps:<br /> | |||
# set <code>services.settings.server</code> = https://settings.stage.mozaws.net/v1 (Prerequisites #3) | |||
# on Beta and Release, start Firefox via the command line as follows:<br /> ▪ [Windows]: Open cmd and run:<br /> 1. <code>set XPCSHELL_TEST_PROFILE_DIR=1</code><br /> 2. <code>firefox.exe --no-remote -p</code><br />▪ [Linux and macOS]: Open the terminal and run:<br /> 1. <code>export XPCSHELL_TEST_PROFILE_DIR=1</code><br />2. <code>firefox --no-remote -p</code><br />''Note: In both cases `-p` opens the profile manager. You can also use --profile to specify an explicit location of the profile directory. (“firefox”/”firefox.exe” must be replaced with the actual path to the Firefox binary if needed).<br /> Optional: to verify that the switch to the staging server has been successful, open the DevTools console and run''<br /> <code>ChromeUtils.import("resource://services-settings/Utils.jsm").Utils.SERVER_URL</code> => this should return https://settings.stage.mozaws.net/v1 | |||
# Go to about:addons, open the DevTools console and force an update of the blocklist by running:<br /> <code>ChromeUtils.import('resource://gre/modules/Blocklist.jsm').Blocklist.ExtensionBlocklist._client.sync()</code><br />The installed add-on should now reflect the blocked status. If the status is not automatically updated, refresh the page. | |||
= Forcing a Blocklist Ping = | = Forcing a Blocklist Ping = |
edits