Skip to content

Commit ab3266b

Browse files
authored
Merge pull request #7325 from akatsoulas/platform-seg-tags
Send platform segmentation tags to ZD
2 parents 3e22b5c + 620255a commit ab3266b

File tree

3 files changed

+32
-11
lines changed

3 files changed

+32
-11
lines changed

kitsune/customercare/forms.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@
1212

1313
OS_CHOICES = [
1414
(None, _lazy("Select platform")),
15-
("win10", _lazy("Windows")),
16-
("mac", _lazy("Mac OS")),
17-
("linux", _lazy("Linux")),
15+
("win64", _lazy("Windows 64-bit")),
16+
("win_arm64", _lazy("Windows ARM64/AArch64")),
17+
("win32", _lazy("Windows 32-bit")),
18+
("mac", _lazy("macOS")),
19+
("linux64", _lazy("Linux 64-bit")),
20+
("linux_arm64", _lazy("Linux ARM64/AArch64")),
21+
("linux32", _lazy("Linux 32-bit")),
1822
("android", _lazy("Android")),
1923
("ios", _lazy("iOS")),
2024
("other", _lazy("Other")),
@@ -42,6 +46,19 @@
4246
("not_sure", "Not sure / Need help selecting"),
4347
]
4448

49+
OS_TAGS = {
50+
"win64": "seg-platform-win64",
51+
"win_arm64": "seg-platform-win-arm64",
52+
"win32": "seg-platform-win32",
53+
"mac": "seg-platform-mac",
54+
"linux64": "seg-platform-linux64",
55+
"linux_arm64": "seg-platform-linux-arm64",
56+
"linux32": "seg-platform-linux32",
57+
"android": "seg-platform-android",
58+
"ios": "seg-platform-ios",
59+
"other": "seg-platform-other",
60+
}
61+
4562
UPDATE_CHANNEL_TAGS = {
4663
"esr": "seg-rel-esr",
4764
"rapid_release": "seg-rel-rapid-release",
@@ -195,6 +212,10 @@ def send(self, user, product):
195212
else:
196213
zendesk_tags.append(tag_value)
197214

215+
if os := self.cleaned_data.get("os"):
216+
if tag := OS_TAGS.get(os):
217+
zendesk_tags.append(tag)
218+
198219
if update_channel := self.cleaned_data.get("update_channel"):
199220
if tag := UPDATE_CHANNEL_TAGS.get(update_channel):
200221
zendesk_tags.append(tag)

kitsune/customercare/tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def setUp(self):
228228
self.submission.description = "Test description"
229229
self.submission.category = "test"
230230
self.submission.email = "test@example.com"
231-
self.submission.os = "win10"
231+
self.submission.os = "win64"
232232
self.submission.country = "US"
233233
self.submission.update_channel = ""
234234
self.submission.policy_distribution = ""

kitsune/customercare/tests/test_zendesk.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_create_ticket_includes_zendesk_tags_for_authenticated_user(self, mock_z
3333
"subject": "Test subject",
3434
"description": "Test description",
3535
"category": "accounts",
36-
"os": "win10",
36+
"os": "win64",
3737
"country": "US",
3838
"ticket_form_id": 456,
3939
"zendesk_tags": [
@@ -132,7 +132,7 @@ def test_create_ticket_without_zendesk_tags(self, mock_zenpy):
132132
"subject": "Test subject",
133133
"description": "Test description",
134134
"category": "accounts",
135-
"os": "win10",
135+
"os": "win64",
136136
"country": "US",
137137
"ticket_form_id": 456,
138138
}
@@ -169,7 +169,7 @@ def test_create_ticket_with_empty_zendesk_tags(self, mock_zenpy):
169169
"subject": "Test subject",
170170
"description": "Test description",
171171
"category": "accounts",
172-
"os": "win10",
172+
"os": "win64",
173173
"country": "US",
174174
"ticket_form_id": 456,
175175
"zendesk_tags": [], # Empty list
@@ -241,7 +241,7 @@ def test_create_ticket_includes_deployment_fields(self, mock_zenpy):
241241
"subject": "Test subject",
242242
"description": "Test description",
243243
"category": "technical",
244-
"os": "win10",
244+
"os": "win64",
245245
"country": "US",
246246
"ticket_form_id": 456,
247247
"update_channel": "esr",
@@ -282,7 +282,7 @@ def test_create_ticket_omits_empty_deployment_fields(self, mock_zenpy):
282282
"subject": "Test subject",
283283
"description": "Test description",
284284
"category": "technical",
285-
"os": "win10",
285+
"os": "win64",
286286
"country": "US",
287287
"ticket_form_id": 456,
288288
"update_channel": "",
@@ -321,7 +321,7 @@ def test_create_ticket_includes_brand_id(self, mock_zenpy):
321321
"subject": "Test subject",
322322
"description": "Test description",
323323
"category": "technical",
324-
"os": "win10",
324+
"os": "win64",
325325
"country": "US",
326326
"ticket_form_id": 456,
327327
"brand_id": "360000001234",
@@ -355,7 +355,7 @@ def test_create_ticket_omits_brand_id_when_not_set(self, mock_zenpy):
355355
"subject": "Test subject",
356356
"description": "Test description",
357357
"category": "technical",
358-
"os": "win10",
358+
"os": "win64",
359359
"country": "US",
360360
"ticket_form_id": 456,
361361
"brand_id": "",

0 commit comments

Comments
 (0)