From 82c5725aefe2efbb7f33a32b5bb2c6420aa54566 Mon Sep 17 00:00:00 2001 From: Jason Robbins Date: Wed, 23 Aug 2023 14:35:01 -0700 Subject: [PATCH] Add privacy and security to origin trials and SLO=6. (#3276) --- api/converters_test.py | 2 +- api/features_api_test.py | 2 +- internals/approval_defs.py | 12 ++++++++---- internals/core_enums.py | 9 ++++++--- internals/slo_test.py | 4 ++-- pages/guide_test.py | 2 +- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/api/converters_test.py b/api/converters_test.py index 35848bd4..a22a8bf9 100644 --- a/api/converters_test.py +++ b/api/converters_test.py @@ -551,7 +551,7 @@ class GateConvertersTest(testing_config.CustomTestCase): 'additional_review': True, 'slo_initial_response': appr_def.slo_initial_response, 'slo_initial_response_took': None, # Review is still in-progress. - 'slo_initial_response_remaining': -2, # Two weekdays overdue. + 'slo_initial_response_remaining': -1, # One weekday overdue. } self.assertEqual(expected, actual) diff --git a/api/features_api_test.py b/api/features_api_test.py index 00cdd8bc..b2869fee 100644 --- a/api/features_api_test.py +++ b/api/features_api_test.py @@ -710,7 +710,7 @@ class FeaturesAPITest(testing_config.CustomTestCase): Stage.feature_id == new_feature.key.integer_id()).fetch() gates = Gate.query(Gate.feature_id == new_feature.key.integer_id()).fetch() self.assertEqual(len(stages), 6) - self.assertEqual(len(gates), 9) + self.assertEqual(len(gates), 11) def test_post__no_permissions(self): """403 Forbidden if the user does not have feature create access.""" diff --git a/internals/approval_defs.py b/internals/approval_defs.py index ac950daa..05dc80b7 100644 --- a/internals/approval_defs.py +++ b/internals/approval_defs.py @@ -99,25 +99,29 @@ PrivacyOriginTrialApproval = ApprovalFieldDef( 'Privacy OT Review', 'Privacy OT Review', core_enums.GATE_PRIVACY_ORIGIN_TRIAL, ONE_LGTM, - approvers=PRIVACY_APPROVERS, team_name='Privacy') + approvers=PRIVACY_APPROVERS, team_name='Privacy', + slo_initial_response=6) PrivacyShipApproval = ApprovalFieldDef( 'Privacy Ship Review', 'Privacy Ship Review', core_enums.GATE_PRIVACY_SHIP, ONE_LGTM, - approvers=PRIVACY_APPROVERS, team_name='Privacy') + approvers=PRIVACY_APPROVERS, team_name='Privacy', + slo_initial_response=6) SecurityOriginTrialApproval = ApprovalFieldDef( 'Security OT Review', 'Security OT Review', core_enums.GATE_SECURITY_ORIGIN_TRIAL, ONE_LGTM, - approvers=SECURITY_APPROVERS, team_name='Security') + approvers=SECURITY_APPROVERS, team_name='Security', + slo_initial_response=6) SecurityShipApproval = ApprovalFieldDef( 'Security Ship Review', 'Security Ship Review', core_enums.GATE_SECURITY_SHIP, ONE_LGTM, - approvers=SECURITY_APPROVERS, team_name='Security') + approvers=SECURITY_APPROVERS, team_name='Security', + slo_initial_response=6) EnterpriseShipApproval = ApprovalFieldDef( 'Enterprise Ship Review', diff --git a/internals/core_enums.py b/internals/core_enums.py index ace842d6..e261750f 100644 --- a/internals/core_enums.py +++ b/internals/core_enums.py @@ -279,7 +279,8 @@ STAGES_AND_GATES_BY_FEATURE_TYPE: dict[int, list[tuple[int, list[int]]]] = { (STAGE_BLINK_DEV_TRIAL, []), (STAGE_BLINK_EVAL_READINESS, []), (STAGE_BLINK_ORIGIN_TRIAL, - [GATE_DEBUGGABILITY_ORIGIN_TRIAL, + [GATE_PRIVACY_ORIGIN_TRIAL, GATE_SECURITY_ORIGIN_TRIAL, + GATE_DEBUGGABILITY_ORIGIN_TRIAL, GATE_API_ORIGIN_TRIAL]), (STAGE_BLINK_EXTEND_ORIGIN_TRIAL, [GATE_API_EXTEND_ORIGIN_TRIAL]), (STAGE_BLINK_SHIPPING, @@ -292,7 +293,8 @@ STAGES_AND_GATES_BY_FEATURE_TYPE: dict[int, list[tuple[int, list[int]]]] = { (STAGE_FAST_PROTOTYPE, [GATE_API_PROTOTYPE]), (STAGE_FAST_DEV_TRIAL, []), (STAGE_FAST_ORIGIN_TRIAL, - [GATE_DEBUGGABILITY_ORIGIN_TRIAL, + [GATE_PRIVACY_ORIGIN_TRIAL, GATE_SECURITY_ORIGIN_TRIAL, + GATE_DEBUGGABILITY_ORIGIN_TRIAL, GATE_API_ORIGIN_TRIAL]), (STAGE_FAST_EXTEND_ORIGIN_TRIAL, [GATE_API_EXTEND_ORIGIN_TRIAL]), (STAGE_FAST_SHIPPING, @@ -309,7 +311,8 @@ STAGES_AND_GATES_BY_FEATURE_TYPE: dict[int, list[tuple[int, list[int]]]] = { (STAGE_DEP_PLAN, []), (STAGE_DEP_DEV_TRIAL, []), (STAGE_DEP_DEPRECATION_TRIAL, - [GATE_DEBUGGABILITY_ORIGIN_TRIAL, + [GATE_PRIVACY_ORIGIN_TRIAL, GATE_SECURITY_ORIGIN_TRIAL, + GATE_DEBUGGABILITY_ORIGIN_TRIAL, GATE_API_ORIGIN_TRIAL]), (STAGE_DEP_EXTEND_DEPRECATION_TRIAL, [GATE_API_EXTEND_ORIGIN_TRIAL]), (STAGE_DEP_SHIPPING, diff --git a/internals/slo_test.py b/internals/slo_test.py index 290a87c8..c1d575e6 100644 --- a/internals/slo_test.py +++ b/internals/slo_test.py @@ -261,7 +261,7 @@ class SLOReportingTests(testing_config.CustomTestCase): self.assertFalse(slo.is_gate_overdue( self.gate_1, APPR_FIELDS, DEFAULT_SLO_LIMIT)) - mock_now.return_value = datetime.datetime(2023, 6, 15, 12, 30, 0) # Thu + mock_now.return_value = datetime.datetime(2023, 6, 16, 12, 30, 0) # Thu self.assertTrue(slo.is_gate_overdue( self.gate_1, APPR_FIELDS, DEFAULT_SLO_LIMIT)) @@ -279,7 +279,7 @@ class SLOReportingTests(testing_config.CustomTestCase): @mock.patch('internals.slo.now_utc') def test_get_overdue_gates(self, mock_now): """We can tell if a gate is overdue based on a default SLO limit.""" - mock_now.return_value = datetime.datetime(2023, 6, 15, 12, 30, 0) # Thu + mock_now.return_value = datetime.datetime(2023, 6, 16, 12, 30, 0) # Fri actual = slo.get_overdue_gates(APPR_FIELDS, DEFAULT_SLO_LIMIT) # gate_1 is overdue. diff --git a/pages/guide_test.py b/pages/guide_test.py index 9e1dbbad..92a2f0fb 100644 --- a/pages/guide_test.py +++ b/pages/guide_test.py @@ -98,7 +98,7 @@ class FeatureCreateTest(testing_config.CustomTestCase): stages = Stage.query().fetch() gates = Gate.query().fetch() self.assertEqual(len(stages), 6) - self.assertEqual(len(gates), 9) + self.assertEqual(len(gates), 11) class FeatureEditHandlerTest(testing_config.CustomTestCase):