Skip to content

Adds experiment generator

Jeremy Jackson requested to merge jj-improved-generators into master

Closes https://gitlab.com/gitlab-org/gitlab-experiment/-/issues/6 Related to https://gitlab.com/gitlab-org/growth/experimentation/-/issues/17#note_437860750

After thinking a bit about how to enhance experiments and provide better tooling around their definition, we've ended up on a solution that reflects a lot of patterns that are available to us in Rails directly.

The idea, and pretty much the path I've started down is outlined here. It's basically providing a rails generator that we can use to generate experiments that might have some useful boilerplate logic provided in them.

This is part of a larger initiative around https://gitlab.com/gitlab-org/gitlab-experiment/-/issues/6, where we needed a registration concept. Instead of doing registration I'm going to add the concept of a place for custom experiment classes to live. If you want a simple experiment you can still do everything that's provided in the readme, but for more advanced uses, and for cases that span across an entire application (as we may sometimes have), we'll provide a more comprehensive solution for how to build those out.

I have intentionally omitted the documentation updates until we resolve a bit more about how to implement this and connect it with the existing feature flag bin command. I think we may also want to help migrate the bin/feature-flag command to a rails generator, because thor / Rails::Generators provides a lot of the boilerplate code within bin/feature-flag.

  • This also changes the path/naming of the existing install generator a bit.
Edited by Jeremy Jackson

Merge request reports

Loading