Griffin is Brave's version of Google's Finch - A backend for Chromium's variation service. This repository contains resources to compile, publish and inspect the so called seed file, which contains definitions for all variations.
See the Wiki to learn more about what variations are and how to use them for (1) staged rollouts, (2) parameter updates and (3) experiments.
A continuous integration server (CI) serializes and signs the updated seed file before publishing it to a CDN endpoint at https://variations.brave.com/seed. To browse the contents of the seed file a dashboard is hosted at https://griffin.brave.com. The repo is organized as follows:
/crypto
contains a util to create key pairs and sign the seed file./seed
contains the JSON seed definition and serialisation code./src
contains the web dashboard to browse the seed contents and tracker code the track changes. See https://github.com/brave/brave-variations/blob/main/src/README.md for details.main
branch (which will be picked up by CI for staging).--variations-server-url=https://variations.bravesoftware.com/seed
.production
branch (which will be picked up by CI again).On initial deployment and subsequent key rotations a new key pair has to be generated. The public key is exchanged by patching the hard-coded public key bytes in variations_seed_store.cc#L37:
$ go run ./crypto/crypto_util.go keygen
.The following steps are performed by CI to publish the updated seed file:
$ python seed/serialize.py seed/seed.json
to compile the protobuf.$ go run /crypto/crypto_util.go sign
.X-Seed-Signature
response header.serialnumber
.Constraints:
PLATFORMS
and CHANNELS
constants in serialize.py
.--variations-server-url=https://variations.bravesoftware.com/seed
.brave://flags
--disable-features="..." --enable-features="..."
, e.g. enable feature FooBar
with parameters param1=2
and param3=4
via --enable-features=FooBar:param1/2/param3/4
seed
base::feature
defaultsX-Country
response header and is inferred from the source IP by the CDN but can be faked with e.g. --variations-override-country=US
--fake-variations-channel=beta
to override the channel of your build.--vmodule="*/variations/*"=1
or inspect brave://version/?show-variations-cmd
under the "Variations" section.--vmodule="*/variations/*"=1
or higherTo build the dashboard:
$ npm install
$ npm run build