firefighter-incident 0.0.25__py3-none-any.whl → 0.0.26__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
firefighter/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.0.25'
32
- __version_tuple__ = version_tuple = (0, 0, 25)
31
+ __version__ = version = '0.0.26'
32
+ __version_tuple__ = version_tuple = (0, 0, 26)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -229,7 +229,7 @@ class JiraPostMortemService:
229
229
  - Zoho desk ticket (customfield_10896)
230
230
  - Zendesk ticket (customfield_10895)
231
231
  - Seller Contract ID (customfield_10908)
232
- - Platform (customfield_10201)
232
+ - Platforms (customfield_10201) - first platform from list
233
233
  - Business Impact (customfield_10936)
234
234
 
235
235
  Args:
@@ -264,9 +264,10 @@ class JiraPostMortemService:
264
264
  fields["customfield_10908"] = str(seller_contract_id)
265
265
 
266
266
  # Platform - customfield_10201 (option field)
267
- platform = custom_fields.get("platform")
268
- if platform:
269
- # Remove "platform-" prefix if present
267
+ platforms = custom_fields.get("platforms", [])
268
+ if platforms:
269
+ # Extract first platform and remove "platform-" prefix if present
270
+ platform = platforms[0] if isinstance(platforms, list) else platforms
270
271
  platform_value = platform.replace("platform-", "") if isinstance(platform, str) else platform
271
272
  fields["customfield_10201"] = {"value": platform_value}
272
273
 
@@ -115,20 +115,25 @@ class ClosureReasonModal(IncidentSelectableModalMixin, SlackModal):
115
115
  self, ack: Ack, body: dict[str, Any], incident: Incident, user: User
116
116
  ) -> bool | None:
117
117
  """Handle the closure reason modal submission."""
118
- # Early validation: Check if incident can be closed BEFORE calling ack()
119
- # This validation happens BEFORE ack() so we can display errors in the modal
120
- can_close, reasons = incident.can_be_closed
121
- if not can_close:
122
- # Build error message from reasons
123
- error_messages = [reason[1] for reason in reasons]
124
- error_text = "\n".join([f"• {msg}" for msg in error_messages])
125
- ack(
126
- response_action="errors",
127
- errors={
128
- "closure_message": f"Cannot close this incident:\n{error_text}"
129
- }
130
- )
131
- return False
118
+ # For early closure (OPEN/INVESTIGATING), we bypass normal workflow checks
119
+ # For normal closure (MITIGATED/POST_MORTEM), we must validate key events
120
+ current_status = incident.status
121
+ is_early_closure = current_status.value in {IncidentStatus.OPEN, IncidentStatus.INVESTIGATING}
122
+
123
+ if not is_early_closure:
124
+ # Normal closure path - validate that incident can be closed
125
+ can_close, reasons = incident.can_be_closed
126
+ if not can_close:
127
+ # Build error message from reasons
128
+ error_messages = [reason[1] for reason in reasons]
129
+ error_text = "\n".join([f"• {msg}" for msg in error_messages])
130
+ ack(
131
+ response_action="errors",
132
+ errors={
133
+ "closure_message": f"Cannot close this incident:\n{error_text}"
134
+ }
135
+ )
136
+ return False
132
137
 
133
138
  # Clear ALL modals in the stack (not just this one)
134
139
  # This ensures the underlying "Update Status" modal is also closed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: firefighter-incident
3
- Version: 0.0.25
3
+ Version: 0.0.26
4
4
  Summary: Incident Management tool made for Slack using Django
5
5
  Project-URL: Repository, https://github.com/ManoManoTech/firefighter-incident
6
6
  Project-URL: Documentation, https://manomanotech.github.io/firefighter-incident/latest/
@@ -6,7 +6,7 @@ gunicorn.conf.py,sha256=vHsTGjaKOr8FDMp6fTKYTX4AtokmPgYvvt5Mr0Q6APc,273
6
6
  main.py,sha256=CsbprHoOYhjCLpTJmq9Z_aRYFoFgWxoz2pDLuwm8Eqg,1558
7
7
  manage.py,sha256=5ivHGD13C6nJ8QvltKsJ9T9akA5he8da70HLWaEP3k8,689
8
8
  firefighter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- firefighter/_version.py,sha256=DspPu1FRRiGe5F0Nbz1wXOpsS5e-m6ETOzBjU5BFWRE,706
9
+ firefighter/_version.py,sha256=Fnf259POysYSI-aH6DhnxuHUxCVOFWsQLs4I5Ur_KMA,706
10
10
  firefighter/api/__init__.py,sha256=JQW0Bv6xwGqy7ioxx3h6UGMzkkJ4DntDpbvV1Ncgi8k,136
11
11
  firefighter/api/admin.py,sha256=x9Ysy-GiYjb0rynmFdS9g56e6n24fkN0ouGy5QD9Yrc,4629
12
12
  firefighter/api/apps.py,sha256=P5uU1_gMrDfzurdMbfqw1Bnb2uNKKcMq17WBPg2sLhc,204
@@ -273,7 +273,7 @@ firefighter/jira_app/admin.py,sha256=ZHAAbhy0hm_DcklK59KMmid_ZiPn8n5V6g7cZCSNrpc
273
273
  firefighter/jira_app/apps.py,sha256=T6vHrQuMZHJoTth-xjy3CbNfPv6DyXgcR3PSMju2JS4,504
274
274
  firefighter/jira_app/client.py,sha256=qpMqNTjJUq5OqAxmwvVOE20uJe7kp737HSdsiqUu1G4,21982
275
275
  firefighter/jira_app/models.py,sha256=2zKy5VaKkhiHYA8Dukz8g0NTG82Qy5UHAHY9eMv67NE,3097
276
- firefighter/jira_app/service_postmortem.py,sha256=b76f1uv-zUo4jUWXTul4nv8UnaqQXHzuoTYEDrEpcMA,10620
276
+ firefighter/jira_app/service_postmortem.py,sha256=7VQwtVGCVZaVGfRxQXL19IM4hHrgHmItUbrsyy2gZlM,10764
277
277
  firefighter/jira_app/types.py,sha256=Ukak1U1EhcH2jQPN-UoEL6AMZ-kzPsQ8c7FUr7GmahE,956
278
278
  firefighter/jira_app/utils.py,sha256=3xuzr8viZCBm6j2J9oFzA4bUvVW8TN1DOdlpbruJ_TE,3443
279
279
  firefighter/jira_app/management/__init__.py,sha256=wy4qMZb7_K-INwwGGEhMtEeI0XTLqgUw4P8_-VEnrEw,40
@@ -411,7 +411,7 @@ firefighter/slack/views/events/message_deleted.py,sha256=tyA1-sAlG9ImcKIhqSn6Egu
411
411
  firefighter/slack/views/events/reaction_added.py,sha256=AipwBnrU5B35D97YIZCXdSW8W7-9QTIIQqUcrLTLQ5c,4241
412
412
  firefighter/slack/views/modals/__init__.py,sha256=U9PapAIlpuYqBonOUmBGWT8_HjQa35ilMQJXGaFLgd0,1945
413
413
  firefighter/slack/views/modals/close.py,sha256=4j5iA-lmIFuCz7B9pgDmjxrqmfWFysqWEn1YIsE75zc,12161
414
- firefighter/slack/views/modals/closure_reason.py,sha256=3ot1cb4Wzvwe-TAuR16ZopnWGInUmoeDUaKzOQ838kw,7600
414
+ firefighter/slack/views/modals/closure_reason.py,sha256=N-gp0E6W8Z1d4aH1-8BxizNTlZ4syNIF4l5B9WZHFFA,7898
415
415
  firefighter/slack/views/modals/downgrade_workflow.py,sha256=cRWsm3DmKRRI1-Jpjprb5xeY2U7HvRo6eZlUbGuzr1A,3192
416
416
  firefighter/slack/views/modals/edit.py,sha256=1N0OBSxsDuN6lJoH-djbEljy7f0LcDEpJF-U5YoEFXA,5895
417
417
  firefighter/slack/views/modals/key_event_message.py,sha256=C6yhQLQ6jBuhIr-YAoAyt-qZKu0V6nJMGZ_t3DLtUbo,5943
@@ -482,7 +482,7 @@ firefighter_tests/test_jira_app/test_incident_key_events_sync.py,sha256=ytXHzlwc
482
482
  firefighter_tests/test_jira_app/test_jira_client_watchers.py,sha256=IBrFjwhOP0rfm58BBq339CySxjdJkPYjGmISC4oQhZc,4803
483
483
  firefighter_tests/test_jira_app/test_models.py,sha256=QfMLrJVXSWqu29XEbJO6xXpOkugcdWti5_bmCEX2m3Y,4626
484
484
  firefighter_tests/test_jira_app/test_postmortem_issue_link.py,sha256=CF0UDmHOY08Oj3MYtDKNtkVDq_nbQ0nesvFWF8Rv944,7750
485
- firefighter_tests/test_jira_app/test_postmortem_service.py,sha256=DAlQxlPlB_Fd038hLeSu0PCO-Izo0z1dBgLXv4twvTE,15114
485
+ firefighter_tests/test_jira_app/test_postmortem_service.py,sha256=gUimkgf3NNIxHFDeZ5GNNzLHdaPKQCZDrTPdHmbyqDc,15120
486
486
  firefighter_tests/test_jira_app/test_timeline_template.py,sha256=_PtFnIib2HfjyylNRQXcjvdhrsoAJICOKauIDsYFQRk,4902
487
487
  firefighter_tests/test_raid/conftest.py,sha256=i_TOquYIMLDyVQ97uqxTqPJszVz4qq7L_Q7YJxTuS1o,4090
488
488
  firefighter_tests/test_raid/test_raid_alert_p4_p5.py,sha256=rz9orbt1E1vJ5POQyVZ6-SEPvqB55-xhwIWHicdfgDg,9356
@@ -518,8 +518,8 @@ firefighter_tests/test_slack/views/modals/test_send_sos.py,sha256=_rE6jD-gOzcGyh
518
518
  firefighter_tests/test_slack/views/modals/test_status.py,sha256=oQzPfwdg2tkbo9nfkO1GfS3WydxqSC6vy1AZjZDKT30,2226
519
519
  firefighter_tests/test_slack/views/modals/test_update_status.py,sha256=3ARHZPs22FTx7IjgOldzEpVxxWeHqEbe4kQphUuSp34,55928
520
520
  firefighter_tests/test_slack/views/modals/test_utils.py,sha256=DJd2n9q6fFu8UuCRdiq9U_Cn19MdnC5c-ydLLrk6rkc,5218
521
- firefighter_incident-0.0.25.dist-info/METADATA,sha256=yrMhHcwuGmucr_GZo7pT5OuQ4K4kSQjZtmk3f2c5P1w,5570
522
- firefighter_incident-0.0.25.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
523
- firefighter_incident-0.0.25.dist-info/entry_points.txt,sha256=c13meJbv7YNmYz7MipMOQwzQ5IeFOPXUBYAJ44XMQsM,61
524
- firefighter_incident-0.0.25.dist-info/licenses/LICENSE,sha256=krRiGp-a9-1nH1bWpBEdxyTKLhjLmn6DMVVoIb0zF90,1087
525
- firefighter_incident-0.0.25.dist-info/RECORD,,
521
+ firefighter_incident-0.0.26.dist-info/METADATA,sha256=6maVl16hOTcZXnEYTy1PhaP4ligQTcK5QVZesD6C5a0,5570
522
+ firefighter_incident-0.0.26.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
523
+ firefighter_incident-0.0.26.dist-info/entry_points.txt,sha256=c13meJbv7YNmYz7MipMOQwzQ5IeFOPXUBYAJ44XMQsM,61
524
+ firefighter_incident-0.0.26.dist-info/licenses/LICENSE,sha256=krRiGp-a9-1nH1bWpBEdxyTKLhjLmn6DMVVoIb0zF90,1087
525
+ firefighter_incident-0.0.26.dist-info/RECORD,,
@@ -261,7 +261,7 @@ class TestJiraPostMortemService:
261
261
  "zendesk_ticket_id": "12345",
262
262
  "zoho_desk_ticket_id": "67890",
263
263
  "seller_contract_id": "98765",
264
- "platform": "platform-FR",
264
+ "platforms": ["platform-FR"],
265
265
  "environments": ["PRD", "STG"],
266
266
  },
267
267
  )
@@ -404,7 +404,7 @@ class TestJiraPostMortemService:
404
404
  _status=IncidentStatus.POST_MORTEM,
405
405
  created_by=user,
406
406
  custom_fields={
407
- "platform": "platform-DE",
407
+ "platforms": ["platform-DE"],
408
408
  },
409
409
  )
410
410