Declare winner in digest count test (#20810)

This commit is contained in:
Ben Halpern 2024-03-28 14:41:55 -04:00 committed by GitHub
parent 40a834e110
commit 09705dab68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 8 deletions

View file

@ -3,6 +3,7 @@ class EmailDigestArticleCollector
include Instrumentation
ARTICLES_TO_SEND = "EmailDigestArticleCollector#articles_to_send".freeze
RESULTS_COUNT = 7 # Winner of digest_count_03_18 field test
def initialize(user)
@user = user
@ -29,7 +30,7 @@ class EmailDigestArticleCollector
.where("experience_level_rating > ? AND experience_level_rating < ?",
experience_level_rating_min, experience_level_rating_max)
.order(order)
.limit(results_count)
.limit(RESULTS_COUNT)
else
Article.select(:title, :description, :path)
.published
@ -39,7 +40,7 @@ class EmailDigestArticleCollector
.not_authored_by(@user.id)
.where("score > ?", 15)
.order(order)
.limit(results_count)
.limit(RESULTS_COUNT)
end
articles.length < 3 ? [] : articles
@ -74,10 +75,4 @@ class EmailDigestArticleCollector
@user.cached_followed_tag_names.any? ||
@user.cached_antifollowed_tag_names.any?
end
def results_count
return 6 unless FeatureFlag.enabled?(:digest_results_count_testing)
(field_test(:digest_count_03_18, participant: @user)&.split("_")&.last || 6).to_i
end
end

View file

@ -29,6 +29,8 @@
experiments:
digest_count_03_18:
started_at: 2024-03-18
ended_at: 2024-03-28
winner: count_7
variants:
- count_6
- count_4