catalyst / moodle-tool_abconfig

A way to A/B test config, or slowly turn on config for certain audiences or % of traffic
https://moodle.org/plugins/tool_abconfig
6 stars 4 forks source link

Make it possible to execute experiments on CLI scripts #50

Closed golenkovm closed 2 years ago

golenkovm commented 2 years ago

The very first use case is to run cron with bumped debugging but there might be more other use cases when you'd need to run scripts with tweaked config.

brendanheywood commented 2 years ago

Cross post:

CLI scripts either don't have a concept of a user, or they run effectively like sudo as the primary admin user.

If you are manually running a cli script and you want to force the condition of any arbitrary experiment then a better way of passing this in in a very generic way which enabled you to specify which experiment on the cli is using an environment var:

EXPERIMENT_SHORTNAME=conditionset php admin/cli/mycli.php --foo=bar

So this is exactly equivalent to doing ?experimentshortname=conditionset in a web request

Pretty well exactly like how this does it https://tracker.moodle.org/browse/MDL-67081

golenkovm commented 2 years ago

Closing this as Won't fix

brendanheywood commented 2 years ago

@golenkovm what is wrong with the env vars approach?

EXPERIMENT_SHORTNAME=conditionset php admin/cli/mycli.php --foo=bar