From 22d1693f38b63b1a5c987d68853a6407f075bc47 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Fri, 10 Nov 2017 14:15:43 +0000 Subject: [PATCH 1/2] Add option to bypass percentage-based rollouts --- .../web/app/coffee/Features/Project/ProjectController.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index bbfb47d6a1..0e8cd507af 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -28,6 +28,8 @@ CollaboratorsHandler = require '../Collaborators/CollaboratorsHandler' module.exports = ProjectController = _isInPercentageRollout: (objectId, percentage) -> + if Settings.bypassPercentageRollouts = true + return true counter = parseInt(objectId.toString().substring(18, 24), 16) return (counter % 100) < percentage From 053993090636540f6edc32f4f99fab14722aa750 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Fri, 10 Nov 2017 14:16:00 +0000 Subject: [PATCH 2/2] Use the common `_isInPercentageRollout` function for autocompile --- .../web/app/coffee/Features/Project/ProjectController.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index 0e8cd507af..de323c54f5 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -272,10 +272,9 @@ module.exports = ProjectController = # Extract data from user's ObjectId timestamp = parseInt(user_id.toString().substring(0, 8), 16) - counter = parseInt(user_id.toString().substring(18, 24), 16) rolloutPercentage = 60 # Percentage of users to roll out to - if counter % 100 > rolloutPercentage + if !ProjectController._isInPercentageRollout(user_id, rolloutPercentage) # Don't show if user is not part of roll out return cb(null, { enabled: false, showOnboarding: false }) userSignupDate = new Date(timestamp * 1000)