|
|
Description[NTP::SectionOrder] Make dismissed category penalty a variation param.
Make dismissed category penalty a variation param instead of simply
hardcoding the value. Handle penalty equal to 0 correctly (ignore
OnCategoryDismissed call).
We may want to change the value or to disable it completely (by setting
to 0) later.
BUG=677919
Review-Url: https://codereview.chromium.org/2612773003
Cr-Commit-Position: refs/heads/master@{#443996}
Committed: https://chromium.googlesource.com/chromium/src/+/ecbf607e7aced540428687d67a9991d97d115e6e
Patch Set 1 #
Total comments: 8
Patch Set 2 : added tests. #Patch Set 3 : clean rebase. #Patch Set 4 : jkrcal@ comment. #
Messages
Total messages: 27 (20 generated)
vitaliii@chromium.org changed reviewers: + jkrcal@chromium.org
Hi jkrcal@, Could you have a look please? https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... File components/ntp_snippets/category_rankers/click_based_category_ranker.cc (right): https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... components/ntp_snippets/category_rankers/click_based_category_ranker.cc:69: return variations::GetVariationParamByFeatureAsInt( Are you aware of any way to change the value in tests? I would like to test penalty = 0. https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... components/ntp_snippets/category_rankers/click_based_category_ranker.cc:196: if (penalty == 0) { Is this ok in your view? Or should I consider penalty = -1 as "disabled" and "penalty = 0" as "reduce dismissed category clicks to the next category clicks"?
The CQ bit was checked by vitaliii@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... File components/ntp_snippets/category_rankers/click_based_category_ranker.cc (right): https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... components/ntp_snippets/category_rankers/click_based_category_ranker.cc:69: return variations::GetVariationParamByFeatureAsInt( On 2017/01/05 09:28:18, vitaliii wrote: > Are you aware of any way to change the value in tests? I would like to test > penalty = 0. Sure, see variations::testing::VariationParamsManager, used, e.g., in https://cs.chromium.org/chromium/src/components/ntp_snippets/remote/schedulin... This may allow you to remove the function GetDismissedCategoryPenalty(). https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... components/ntp_snippets/category_rankers/click_based_category_ranker.cc:196: if (penalty == 0) { On 2017/01/05 09:28:18, vitaliii wrote: > Is this ok in your view? Or should I consider penalty = -1 as "disabled" and > "penalty = 0" as "reduce dismissed category clicks to the next category clicks"? This is okay, let's keep it simple.
The CQ bit was checked by vitaliii@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Hi jkrcal@, I added tests, PTAL. https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... File components/ntp_snippets/category_rankers/click_based_category_ranker.cc (right): https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... components/ntp_snippets/category_rankers/click_based_category_ranker.cc:69: return variations::GetVariationParamByFeatureAsInt( On 2017/01/05 10:34:36, jkrcal wrote: > On 2017/01/05 09:28:18, vitaliii wrote: > > Are you aware of any way to change the value in tests? I would like to test > > penalty = 0. > > Sure, see variations::testing::VariationParamsManager, used, e.g., in > https://cs.chromium.org/chromium/src/components/ntp_snippets/remote/schedulin... > > This may allow you to remove the function GetDismissedCategoryPenalty(). Done. GetDismissedCategoryPenalty() allows to expose the default value. https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... components/ntp_snippets/category_rankers/click_based_category_ranker.cc:196: if (penalty == 0) { On 2017/01/05 10:34:36, jkrcal wrote: > On 2017/01/05 09:28:18, vitaliii wrote: > > Is this ok in your view? Or should I consider penalty = -1 as "disabled" and > > "penalty = 0" as "reduce dismissed category clicks to the next category > clicks"? > > This is okay, let's keep it simple. Acknowledged.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm (choose yourself whether to address the last comment) https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... File components/ntp_snippets/category_rankers/click_based_category_ranker.cc (right): https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... components/ntp_snippets/category_rankers/click_based_category_ranker.cc:69: return variations::GetVariationParamByFeatureAsInt( On 2017/01/05 12:42:28, vitaliii wrote: > On 2017/01/05 10:34:36, jkrcal wrote: > > On 2017/01/05 09:28:18, vitaliii wrote: > > > Are you aware of any way to change the value in tests? I would like to test > > > penalty = 0. > > > > Sure, see variations::testing::VariationParamsManager, used, e.g., in > > > https://cs.chromium.org/chromium/src/components/ntp_snippets/remote/schedulin... > > > > This may allow you to remove the function GetDismissedCategoryPenalty(). > > Done. > > GetDismissedCategoryPenalty() allows to expose the default value. I think you get better tests if you always override the penalty to 2 (except for the test where you override it to 0). Penalty 2 shows more interesting behaviour then (the default) 1. Then you do not need to ask what is the default value. To keep the code simple, you may use the approach of ntp_snippets_fetcher_unittest.cc with two test classes (one for value 2, the other for value 0).
Patchset #3 (id:40001) has been deleted
Patchset #3 (id:60001) has been deleted
Patchset #3 (id:80001) has been deleted
The CQ bit was checked by vitaliii@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Hi jkrcal@, I addressed your comment, no need to look. https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... File components/ntp_snippets/category_rankers/click_based_category_ranker.cc (right): https://codereview.chromium.org/2612773003/diff/1/components/ntp_snippets/cat... components/ntp_snippets/category_rankers/click_based_category_ranker.cc:69: return variations::GetVariationParamByFeatureAsInt( On 2017/01/05 13:48:07, jkrcal wrote: > On 2017/01/05 12:42:28, vitaliii wrote: > > On 2017/01/05 10:34:36, jkrcal wrote: > > > On 2017/01/05 09:28:18, vitaliii wrote: > > > > Are you aware of any way to change the value in tests? I would like to > test > > > > penalty = 0. > > > > > > Sure, see variations::testing::VariationParamsManager, used, e.g., in > > > > > > https://cs.chromium.org/chromium/src/components/ntp_snippets/remote/schedulin... > > > > > > This may allow you to remove the function GetDismissedCategoryPenalty(). > > > > Done. > > > > GetDismissedCategoryPenalty() allows to expose the default value. > > I think you get better tests if you always override the penalty to 2 (except for > the test where you override it to 0). Penalty 2 shows more interesting behaviour > then (the default) 1. Then you do not need to ask what is the default value. > > To keep the code simple, you may use the approach of > ntp_snippets_fetcher_unittest.cc with two test classes (one for value 2, the > other for value 0). Partially done. I override to 2 only where this is explicitly needed.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by vitaliii@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from jkrcal@chromium.org Link to the patchset: https://codereview.chromium.org/2612773003/#ps120001 (title: "jkrcal@ comment.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 120001, "attempt_start_ts": 1484636114231150, "parent_rev": "8a732acc19133a1049c57a31b1b0fb4abcc86dcd", "commit_rev": "ecbf607e7aced540428687d67a9991d97d115e6e"}
Message was sent while issue was closed.
Description was changed from ========== [NTP::SectionOrder] Make dismissed category penalty a variation param. Make dismissed category penalty a variation param instead of simply hardcoding the value. Handle penalty equal to 0 correctly (ignore OnCategoryDismissed call). We may want to change the value or to disable it completely (by setting to 0) later. BUG=677919 ========== to ========== [NTP::SectionOrder] Make dismissed category penalty a variation param. Make dismissed category penalty a variation param instead of simply hardcoding the value. Handle penalty equal to 0 correctly (ignore OnCategoryDismissed call). We may want to change the value or to disable it completely (by setting to 0) later. BUG=677919 Review-Url: https://codereview.chromium.org/2612773003 Cr-Commit-Position: refs/heads/master@{#443996} Committed: https://chromium.googlesource.com/chromium/src/+/ecbf607e7aced540428687d67a99... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:120001) as https://chromium.googlesource.com/chromium/src/+/ecbf607e7aced540428687d67a99... |