From 8366ea271f50b2c4791d7cb903b78baa1d5b6ac3 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Tue, 3 Oct 2017 17:08:19 +0100 Subject: [PATCH 1/7] Restrict autocompile onboarding to users in rollout (factor of 100) --- .../coffee/Features/Project/ProjectController.coffee | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index 17adeae4c1..89b47b5782 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -252,8 +252,15 @@ module.exports = ProjectController = cb = underscore.once(cb) if !user_id? return cb() - timestamp = user_id.toString().substring(0,8) - userSignupDate = new Date( parseInt( timestamp, 16 ) * 1000 ) + + # Extract data from user's ObjectId + timestamp = parseInt(user_id.toString().substring(0, 8), 16) + counter = parseInt(user_id.toString().substring(18, 24), 16) + + if counter % 5000 != 0 + # Don't show if user is not part of roll out + return cb(null, false) + userSignupDate = new Date(timestamp * 1000) if userSignupDate > new Date("2017-10-03") # Don't show for users who registered after it was released return cb(null, false) From 550e7d75ca703a66214cdb6c9605ddae5daf7fd9 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Tue, 3 Oct 2017 17:19:51 +0100 Subject: [PATCH 2/7] Check if user is part of autocompile rollout when showing setting or running autocompile --- services/web/app/views/project/editor/pdf.pug | 2 +- .../web/public/coffee/ide/pdf/controllers/PdfController.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.pug b/services/web/app/views/project/editor/pdf.pug index 69fc28cc54..2e0bc3701f 100644 --- a/services/web/app/views/project/editor/pdf.pug +++ b/services/web/app/views/project/editor/pdf.pug @@ -27,7 +27,7 @@ div.full-size.pdf(ng-controller="PdfController") span.caret ul.dropdown-menu.dropdown-menu-left // Only show on beta program? - if user.betaProgram + if user.betaProgram || showAutoCompileOnboarding li.dropdown-header | #{translate("auto_compile")} span.beta-feature-badge diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 1e0403bb76..1a482e8ede 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -109,7 +109,7 @@ define [ toggleAutoCompile(newValue) event_tracking.sendMB "autocompile-setting-changed", { value: newValue } - if window.user?.betaProgram and $scope.autocompile_enabled + if (window.user?.betaProgram or window.showAutoCompileOnboarding) and $scope.autocompile_enabled toggleAutoCompile(true) # abort compile if syntax checks fail From 5047213c3c6e261db08f1fec5e38d0b6f5802b6e Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Wed, 11 Oct 2017 14:47:39 +0100 Subject: [PATCH 3/7] Change rollout detection to account for changes in proportion preserving rolled out users --- .../web/app/coffee/Features/Project/ProjectController.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index 89b47b5782..5915fef8fd 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -257,7 +257,8 @@ module.exports = ProjectController = timestamp = parseInt(user_id.toString().substring(0, 8), 16) counter = parseInt(user_id.toString().substring(18, 24), 16) - if counter % 5000 != 0 + rolloutProportion = 10 + if counter % 1000 < rolloutProportion # Don't show if user is not part of roll out return cb(null, false) userSignupDate = new Date(timestamp * 1000) From 36e1fafb60da85cc3ce636e6e5bbeadc9fbd434e Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Thu, 12 Oct 2017 17:10:41 +0100 Subject: [PATCH 4/7] Set proportion to 0 --- .../web/app/coffee/Features/Project/ProjectController.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index 5915fef8fd..e7c9ac9bc9 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -257,7 +257,7 @@ module.exports = ProjectController = timestamp = parseInt(user_id.toString().substring(0, 8), 16) counter = parseInt(user_id.toString().substring(18, 24), 16) - rolloutProportion = 10 + rolloutProportion = 0 if counter % 1000 < rolloutProportion # Don't show if user is not part of roll out return cb(null, false) From 6c3ceb48df33ceeb75935e20745e4986431e2fc1 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 16 Oct 2017 10:25:52 +0100 Subject: [PATCH 5/7] Allow onboarding to be shown outside of beta program --- services/web/public/coffee/ide.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index 4aaaecc53b..0a83a2dbab 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -78,7 +78,7 @@ define [ miniReviewPanelVisible: false, } $scope.onboarding = { - autoCompile: if window.user.betaProgram and window.showAutoCompileOnboarding then 'unseen' else 'dismissed' + autoCompile: if window.showAutoCompileOnboarding then 'unseen' else 'dismissed' } $scope.user = window.user From e02c3bbb09798b702f990e43490bea1ab3dd68b4 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 16 Oct 2017 10:27:33 +0100 Subject: [PATCH 6/7] Remove beta program badge --- services/web/app/views/project/editor/editor.pug | 4 +--- services/web/app/views/project/editor/pdf.pug | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/services/web/app/views/project/editor/editor.pug b/services/web/app/views/project/editor/editor.pug index 89ec5c7828..86cc63a5e5 100644 --- a/services/web/app/views/project/editor/editor.pug +++ b/services/web/app/views/project/editor/editor.pug @@ -101,9 +101,7 @@ div.full-size( ng-class="placement" ) .popover-inner - h3.popover-title - | #{translate("auto_compile")} - span.beta-feature-badge + h3.popover-title #{translate("auto_compile")} .popover-content p #{translate("try_out_auto_compile_setting")} img(src="/img/onboarding/autocompile/setting-dropdown.png" width="100%") diff --git a/services/web/app/views/project/editor/pdf.pug b/services/web/app/views/project/editor/pdf.pug index 2e0bc3701f..43416b8991 100644 --- a/services/web/app/views/project/editor/pdf.pug +++ b/services/web/app/views/project/editor/pdf.pug @@ -26,11 +26,9 @@ div.full-size.pdf(ng-controller="PdfController") ) span.caret ul.dropdown-menu.dropdown-menu-left - // Only show on beta program? + // Only show if on beta program or part of rollout if user.betaProgram || showAutoCompileOnboarding - li.dropdown-header - | #{translate("auto_compile")} - span.beta-feature-badge + li.dropdown-header #{translate("auto_compile")} li a(href, ng-click="autocompile_enabled = true") i.fa.fa-fw(ng-class="{'fa-check': autocompile_enabled}") From 625f52c24877613c8a2679e20c2642eaeb7b22b1 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 16 Oct 2017 10:28:42 +0100 Subject: [PATCH 7/7] Update cutoff date --- .../web/app/coffee/Features/Project/ProjectController.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index e7c9ac9bc9..205ac0d718 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -262,7 +262,7 @@ module.exports = ProjectController = # Don't show if user is not part of roll out return cb(null, false) userSignupDate = new Date(timestamp * 1000) - if userSignupDate > new Date("2017-10-03") + if userSignupDate > new Date("2017-10-16") # Don't show for users who registered after it was released return cb(null, false) timeout = setTimeout cb, 500