diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-23 09:08:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-23 09:08:47 +0300 |
commit | d950ea420a77bc6b27037bd00484f2463e79b4fd (patch) | |
tree | ec93e370d6543321bb725e06f331b602e06873ac /app/experiments | |
parent | 9d9c8fc2ec2fdfa0bae2f77a5c2bde52a5bf45e2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/experiments')
-rw-r--r-- | app/experiments/new_project_readme_experiment.rb | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/app/experiments/new_project_readme_experiment.rb b/app/experiments/new_project_readme_experiment.rb deleted file mode 100644 index c5c41330949..00000000000 --- a/app/experiments/new_project_readme_experiment.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -class NewProjectReadmeExperiment < ApplicationExperiment # rubocop:disable Gitlab/NamespacedClass - include ProjectCommitCount - - INITIAL_WRITE_LIMIT = 3 - EXPERIMENT_START_DATE = DateTime.parse('2021/1/20') - MAX_ACCOUNT_AGE = 7.days - - exclude { context.value[:actor].nil? } - exclude { context.actor.created_at < MAX_ACCOUNT_AGE.ago } - - def control_behavior - false # we don't want the checkbox to be checked - end - - def candidate_behavior - true # check the checkbox by default - end - - def track_initial_writes(project) - return unless should_track? # early return if we don't need to ask for commit counts - return unless project.created_at > EXPERIMENT_START_DATE # early return for older projects - return unless (count = commit_count(project)) < INITIAL_WRITE_LIMIT - - track(:write, property: project.created_at.to_s, value: count) - end - - private - - def commit_count(project) - commit_count_for(project, - default_count: INITIAL_WRITE_LIMIT, - max_count: INITIAL_WRITE_LIMIT, - experiment: name - ) - end -end |