This is the Core Add-on for the Rally platform. It is implemented as a cross-browser WebExtension, using Svelte for the UI.
Rally studies are implemented as Add-ons. A study template is provided to help study authors start writing their study. A demo website landing page is also available for testing the Core Add-on.
The "source of truth" for Rally study metadata is on the Firefox remote settings server.
npm installBuild a local version of the add-on using the list of studies from public/locally-available-studies.json
npm run build...then start the add-on in "watch" mode, which will cause the add-on to auto-reload as you make changes to the source code:
npm run watchTo run unit test coverage:
npm run testTo run a full integration test using Selenium, in headless browser mode:
npm run test-integrationThis produces the production-ready build. However, until it is signed by Mozilla it may not be installed by end users.
This build will fetch the study list from the Firefox Remote Settings server. See also Testing Remote Settings changes.
npm run buildThe output will be a rally_core.xpi file in web-ext-artifacts/. .xpi is the standard file extension for Firefox add-ons,
Chrome uses .crx.
Since rally_core.xpi is not signed by Mozilla, it may only be installed in a Firefox Nightly build, or an unbranded Firefox Release/Beta build.
The following must be set in about:config:
extensions.experiments.enabled = true
xpinstall.signatures.required = false
To run an end-to-end local test with your own study add-on, first build your study (if you don't have one, you can build the Rally Study Template) and export the signed build as <name-of-study>.xpi. Edit /public/locally-available-studies.json so that downloadLink is /public/<name-of-study>.xpi (you can change the other fields in /public/locally-available-studies.json as well for demo purposes as needed).
Then run:
npm run buildnpm run build-local-addonweb-ext run
To walk through the Core Add-On experience with your study.
To test the QA-signed extension in Firefox, you must be running the Nightly channel or an unbranded Firefox Release/Beta build, then navigate to about:config and create a new boolean pref named xpinstall.signatures.dev-root and set it to true.
Note: this will cause production-signed extensions (such as those from addons.mozilla.org) to not load. To allow these, set
xpinstall.signatures.requiredpref tofalse.
The Rally core-addon uses the Firefox remote settings server to publish metadata about current studies. Changes may be tested locally, or on the dev and staging servers, before pushing live.
Note:
npm run build-local-addonwill produce a build that usespublic/locally-available-studies.jsoninstead of fetching from Remote Settings. If you are doing local development you most likely want this option.
For developer convenience, a public remote-settings dev server is available. Making changes to staging or production require multiple sign-offs from Mozilla.
You may also set up your own local remote settings server.
Note: Firefox Release cannot be reconfigured to use a different server, Firefox Nightly or an unbranded Firefox Release/Beta build must be used for testing.
- In
about:configon Firefox Nightly, changeservices.settings.serverto the URL for your server. If you're using the public remote-settings dev server described above, then the value will behttps://kinto.dev.mozaws.net/v1. - In the Firefox Browser console, first import the
RemoteSettingsmodule:
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);- Then, disable signature checking and fetch the latest
rally-studies-v2collection:
RemoteSettings("rally-studies-v2").verifySignature = false;
await RemoteSettings("rally-studies-v2").get();- The UI for the core add-on options page should respond immediately. After making changes to the RS server, you can either wait or explicitly poll for updates:
await RemoteSettings.pollChanges()The Core Add-On uses Storybook to assist in isolated component work. If you're building a new component, look at the examples in /stories. To run the storybook, run npm run storybook.