debian-mirror-gitlab/doc/development/experiment_guide/index.md

72 lines
4.4 KiB
Markdown
Raw Normal View History

2021-01-29 00:20:46 +05:30
---
stage: Growth
group: Activation
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2021-01-29 00:20:46 +05:30
---
2019-12-21 20:55:43 +05:30
# Experiment Guide
2021-02-22 17:27:13 +05:30
Experiments can be conducted by any GitLab team, most often the teams from the [Growth Sub-department](https://about.gitlab.com/handbook/engineering/development/growth/). Experiments are not tied to releases because they primarily target GitLab.com.
2019-12-21 20:55:43 +05:30
2021-04-17 20:07:23 +05:30
Experiments are run as an A/B/n test, and are behind a feature flag to turn the test on or off. Based on the data the experiment generates, the team decides if the experiment had a positive impact and should be made the new default, or rolled back.
2019-12-21 20:55:43 +05:30
2020-07-28 23:09:34 +05:30
## Experiment tracking issue
2019-12-21 20:55:43 +05:30
2021-09-04 01:27:46 +05:30
Each experiment should have an [Experiment tracking](https://gitlab.com/groups/gitlab-org/-/issues?scope=all&state=opened&label_name[]=growth%20experiment&search=%22Experiment+tracking%22) issue to track the experiment from roll-out through to cleanup/removal. The tracking issue is similar to a feature flag rollout issue, and is also used to track the status of an experiment. Immediately after an experiment is deployed, the due date of the issue should be set (this depends on the experiment but can be up to a few weeks in the future).
2019-12-21 20:55:43 +05:30
After the deadline, the issue needs to be resolved and either:
2021-02-22 17:27:13 +05:30
- It was successful and the experiment becomes the new default.
- It was not successful and all code related to the experiment is removed.
2019-12-21 20:55:43 +05:30
In either case, an outcome of the experiment should be posted to the issue with the reasoning for the decision.
## Code reviews
2021-01-03 14:25:43 +05:30
Experiments' code quality can fail our standards for several reasons. These
reasons can include not being added to the codebase for a long time, or because
of fast iteration to retrieve data. However, having the experiment run (or not
2021-02-22 17:27:13 +05:30
run) shouldn't impact GitLab availability. To avoid or identify issues,
2021-01-03 14:25:43 +05:30
experiments are initially deployed to a small number of users. Regardless,
experiments still need tests.
If, as a reviewer or maintainer, you find code that would usually fail review
but is acceptable for now, mention your concerns with a note that there's no
need to change the code. The author can then add a comment to this piece of code
and link to the issue that resolves the experiment. If the experiment is
successful and becomes part of the product, any follow up issues should be
addressed.
2019-12-21 20:55:43 +05:30
2021-04-17 20:07:23 +05:30
## Implementing an experiment
2021-03-11 19:13:27 +05:30
2021-04-17 20:07:23 +05:30
There are currently two options when implementing an experiment.
2021-03-11 19:13:27 +05:30
2021-04-17 20:07:23 +05:30
One is built into GitLab directly and has been around for a while (this is called
`Exerimentation Module`), and the other is provided by
[`gitlab-experiment`](https://gitlab.com/gitlab-org/gitlab-experiment) and is referred
to as `Gitlab::Experiment` -- GLEX for short.
2021-03-11 19:13:27 +05:30
2021-04-17 20:07:23 +05:30
Both approaches use [experiment](../feature_flags/index.md#experiment-type)
2021-09-04 01:27:46 +05:30
feature flags. We recommend using GLEX rather than `Experimentation Module` for new experiments.
2019-12-21 20:55:43 +05:30
2021-04-17 20:07:23 +05:30
- [Implementing an A/B/n experiment using GLEX](gitlab_experiment.md)
2021-09-04 01:27:46 +05:30
- [Implementing an A/B experiment using `Experimentation Module`](experimentation.md)
2021-01-03 14:25:43 +05:30
2021-04-17 20:07:23 +05:30
Historical Context: `Experimentation Module` was built iteratively with the needs that
appeared while implementing Growth sub-department experiments, while GLEX was built
2021-06-08 01:23:25 +05:30
with the findings of the team and an easier to use API.
2021-09-04 01:27:46 +05:30
### Add new icons and illustrations for experiments
Some experiments may require you to add custom icons or illustrations to our codebase.
This process is lengthy and at this stage, the outcome of the experiment uncertain.
Therefore, you should postpone this effort until the [experiment cleanup process](https://about.gitlab.com/handbook/engineering/development/growth/#experiment-cleanup-issue).
We recommend the following workflow:
2021-10-27 15:23:28 +05:30
1. Review the Pajamas guidelines for [icons](https://design.gitlab.com/product-foundations/iconography) and [illustrations](https://design.gitlab.com/product-foundations/illustration).
2021-09-04 01:27:46 +05:30
1. Add an icon or illustration as an `.svg` file in the `/app/assets/images` (or EE) path in the GitLab repository.
1. Use `image_tag` or `image_path` to render it via the asset pipeline.
1. **If the experiment is a success**, designers add the new icon or illustration to the Pajamas UI kit as part of the cleanup process.
Engineers can then add it to the [SVG library](https://gitlab-org.gitlab.io/gitlab-svgs/) and modify the implementation based on the
[Frontend Development Guidelines](../fe_guide/icons.md#usage-in-hamlrails-2).