Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Adds experiments to simple app #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tarikeshaq
Copy link

This is meant to be pulled for local testing of the experiments prototype in glean.
You'll have to first publish glean to maven local.

Publishing Glean with prototype to mavenLocal

First, clone a-s-dev's Glean fork

git clone git@github.com:a-s-dev/glean.git && cd glean

Then, switch to the test-experiments-do-not-merge branch:

git checkout test-experiments-do-not-merge

Then publish glean to mavenLocal

./gradlew publishToMavenLocal

Running experiments API from Android Components

Make sure you are on this branch (test-experiments-do-not-merge), on the a-s-dev fork of android components.

Then you can run/debug the samples-glean app in AC and it would be calling into the rust-experimenter in GleanApplication.kt. So far it initializes the components, which uses viaduct to request experiment information, and it persists that information for the next time you run it.

Thread {
GlobalScope.launch {
var exp = mozilla.components.service.glean.Experiments
exp.initialize("https://kinto.dev.mozaws.net/v1/",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tarikeshaq for initialize can the API something like: .initialize(experimentsContext, dataDir, [ServerConfig]

where

  • experimentsContext - is gonna be the struct of all the fields we need for the experiments
  • dataDir - data directory for our state and stuff
  • Optional ServerConfig, like we have in FxA. We can hardcode the 2-3 kinto environments into the module at this time.

"messaging-collection",
"main",
applicationContext.dataDir.path)
val res = exp.getBranch("button-color")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a TODO here for us would be something like:

  • Send an enrolled event for the experiment
  • Send a saw button-color button. AKA "User saw some branch of the experiment"

@tarikeshaq tarikeshaq force-pushed the test-experiments-do-not-merge branch from 49c03d9 to 2a55e46 Compare July 23, 2020 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants