-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement storage and api for gate survey questions (#4709)
* initial * added new file, updated openapi, POST to PATCH * progress * complete * complete * correct security to privacy * remove maxDiff * correct security to privacy
- Loading branch information
Showing
24 changed files
with
744 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
from api import converters | ||
from internals.core_enums import * | ||
from internals.core_models import FeatureEntry, MilestoneSet, Stage | ||
from internals.review_models import Vote, Gate | ||
from internals.review_models import Vote, Gate, SurveyAnswers | ||
from internals import approval_defs | ||
|
||
|
||
|
@@ -546,18 +546,22 @@ def test_minimal(self): | |
'slo_resolve_took': None, | ||
'slo_resolve_remaining': None, | ||
'needs_work_started_on': None, | ||
'self_certify_eligible': False, | ||
'survey_answers': None, | ||
} | ||
self.assertEqual(expected, actual) | ||
|
||
@mock.patch('internals.slo.now_utc') | ||
def test_maxmimal(self, mock_now): | ||
"""If a Gate has all fields set, we can convert it to JSON.""" | ||
gate = Gate( | ||
feature_id=1, stage_id=2, gate_type=34, state=4, | ||
feature_id=1, stage_id=2, gate_type=GATE_PRIVACY_ORIGIN_TRIAL, state=4, | ||
requested_on=datetime(2022, 12, 14, 1, 2, 3), # Wednesday | ||
assignee_emails=['[email protected]', '[email protected]'], | ||
next_action=datetime(2022, 12, 25), | ||
additional_review=True) | ||
gate.survey_answers = SurveyAnswers( | ||
is_language_polyfill=True, launch_or_contact='[email protected]') | ||
gate.put() | ||
# The review was due on Wednesday 2022-12-21. | ||
mock_now.return_value = datetime(2022, 12, 23, 1, 2, 3) # Thursday after. | ||
|
@@ -568,7 +572,7 @@ def test_maxmimal(self, mock_now): | |
'id': gate.key.integer_id(), | ||
'feature_id': 1, | ||
'stage_id': 2, | ||
'gate_type': 34, | ||
'gate_type': GATE_PRIVACY_ORIGIN_TRIAL, | ||
'team_name': appr_def.team_name, | ||
'gate_name': appr_def.name, | ||
'escalation_email': '[email protected]', | ||
|
@@ -585,6 +589,13 @@ def test_maxmimal(self, mock_now): | |
'slo_resolve_took': None, | ||
'slo_resolve_remaining': None, | ||
'needs_work_started_on': None, | ||
'self_certify_eligible': True, | ||
'survey_answers': { | ||
'is_api_polyfill': False, | ||
'is_language_polyfill': True, | ||
'is_same_origin_css': False, | ||
'launch_or_contact': '[email protected]', | ||
}, | ||
} | ||
self.assertEqual(expected, actual) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -338,6 +338,7 @@ def test_do_get__success(self, mock_get_approvers): | |
"assignee_emails": [], | ||
"next_action": None, | ||
"additional_review": False, | ||
'self_certify_eligible': False, | ||
'slo_initial_response': 5, | ||
'slo_initial_response_took': None, | ||
'slo_initial_response_remaining': None, | ||
|
@@ -346,6 +347,7 @@ def test_do_get__success(self, mock_get_approvers): | |
'slo_resolve_remaining': None, | ||
'needs_work_started_on': None, | ||
'possible_assignee_emails': ['[email protected]'], | ||
'survey_answers': None, | ||
}, | ||
], | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.