firefighter-incident 0.0.14__py3-none-any.whl → 0.0.16__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.
Files changed (64) hide show
  1. firefighter/_version.py +2 -2
  2. firefighter/api/serializers.py +9 -0
  3. firefighter/confluence/signals/incident_updated.py +2 -2
  4. firefighter/incidents/enums.py +22 -2
  5. firefighter/incidents/forms/closure_reason.py +45 -0
  6. firefighter/incidents/forms/unified_incident.py +406 -0
  7. firefighter/incidents/forms/update_status.py +87 -1
  8. firefighter/incidents/migrations/0027_add_closure_fields.py +40 -0
  9. firefighter/incidents/migrations/0028_add_closure_reason_constraint.py +33 -0
  10. firefighter/incidents/migrations/0029_add_custom_fields_to_incident.py +22 -0
  11. firefighter/incidents/models/incident.py +32 -5
  12. firefighter/incidents/static/css/main.min.css +1 -1
  13. firefighter/incidents/templates/layouts/partials/status_pill.html +1 -1
  14. firefighter/incidents/views/reports.py +3 -3
  15. firefighter/raid/apps.py +9 -26
  16. firefighter/raid/client.py +2 -2
  17. firefighter/raid/forms.py +75 -238
  18. firefighter/raid/signals/incident_created.py +38 -13
  19. firefighter/raid/signals/incident_updated.py +3 -2
  20. firefighter/slack/messages/slack_messages.py +19 -4
  21. firefighter/slack/rules.py +1 -1
  22. firefighter/slack/signals/create_incident_conversation.py +6 -0
  23. firefighter/slack/signals/incident_updated.py +7 -1
  24. firefighter/slack/views/modals/__init__.py +4 -0
  25. firefighter/slack/views/modals/base_modal/form_utils.py +63 -0
  26. firefighter/slack/views/modals/close.py +15 -2
  27. firefighter/slack/views/modals/closure_reason.py +193 -0
  28. firefighter/slack/views/modals/open.py +60 -13
  29. firefighter/slack/views/modals/opening/details/unified.py +203 -0
  30. firefighter/slack/views/modals/opening/select_impact.py +1 -1
  31. firefighter/slack/views/modals/opening/set_details.py +3 -2
  32. firefighter/slack/views/modals/postmortem.py +10 -2
  33. firefighter/slack/views/modals/update_status.py +28 -2
  34. firefighter/slack/views/modals/utils.py +51 -0
  35. {firefighter_incident-0.0.14.dist-info → firefighter_incident-0.0.16.dist-info}/METADATA +1 -1
  36. {firefighter_incident-0.0.14.dist-info → firefighter_incident-0.0.16.dist-info}/RECORD +62 -38
  37. firefighter_tests/test_incidents/test_enums.py +100 -0
  38. firefighter_tests/test_incidents/test_forms/conftest.py +179 -0
  39. firefighter_tests/test_incidents/test_forms/test_closure_reason.py +91 -0
  40. firefighter_tests/test_incidents/test_forms/test_unified_incident_form.py +570 -0
  41. firefighter_tests/test_incidents/test_forms/test_unified_incident_form_integration.py +581 -0
  42. firefighter_tests/test_incidents/test_forms/test_unified_incident_form_p4_p5.py +410 -0
  43. firefighter_tests/test_incidents/test_forms/test_update_status_workflow.py +343 -0
  44. firefighter_tests/test_incidents/test_forms/test_workflow_transitions.py +167 -0
  45. firefighter_tests/test_incidents/test_models/test_incident_model.py +68 -0
  46. firefighter_tests/test_raid/conftest.py +154 -0
  47. firefighter_tests/test_raid/test_p1_p3_jira_fields.py +372 -0
  48. firefighter_tests/test_raid/test_raid_forms.py +10 -253
  49. firefighter_tests/test_raid/test_raid_signals.py +187 -0
  50. firefighter_tests/test_slack/messages/__init__.py +0 -0
  51. firefighter_tests/test_slack/messages/test_slack_messages.py +367 -0
  52. firefighter_tests/test_slack/views/modals/conftest.py +140 -0
  53. firefighter_tests/test_slack/views/modals/test_close.py +65 -3
  54. firefighter_tests/test_slack/views/modals/test_closure_reason_modal.py +138 -0
  55. firefighter_tests/test_slack/views/modals/test_form_utils_multiple_choice.py +249 -0
  56. firefighter_tests/test_slack/views/modals/test_open.py +146 -2
  57. firefighter_tests/test_slack/views/modals/test_opening_unified.py +421 -0
  58. firefighter_tests/test_slack/views/modals/test_update_status.py +327 -3
  59. firefighter_tests/test_slack/views/modals/test_utils.py +135 -0
  60. firefighter/raid/views/open_normal.py +0 -139
  61. firefighter/slack/views/modals/opening/details/critical.py +0 -88
  62. {firefighter_incident-0.0.14.dist-info → firefighter_incident-0.0.16.dist-info}/WHEEL +0 -0
  63. {firefighter_incident-0.0.14.dist-info → firefighter_incident-0.0.16.dist-info}/entry_points.txt +0 -0
  64. {firefighter_incident-0.0.14.dist-info → firefighter_incident-0.0.16.dist-info}/licenses/LICENSE +0 -0
@@ -1,88 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import logging
4
- from typing import TYPE_CHECKING, Any
5
-
6
- from django import forms
7
- from django.conf import settings
8
- from slack_sdk.models.blocks.blocks import SectionBlock
9
-
10
- from firefighter.incidents.forms.create_incident import CreateIncidentForm
11
- from firefighter.slack.slack_app import SlackApp
12
- from firefighter.slack.views.modals.opening.set_details import SetIncidentDetails
13
-
14
- if TYPE_CHECKING:
15
- from firefighter.slack.views.modals.base_modal.form_utils import (
16
- SlackFormAttributesDict,
17
- )
18
- app = SlackApp()
19
- logger = logging.getLogger(__name__)
20
-
21
-
22
- class CreateIncidentFormSlack(CreateIncidentForm):
23
- slack_fields: SlackFormAttributesDict = {
24
- "title": {
25
- "input": {
26
- "multiline": False,
27
- "placeholder": "Short, punchy description of what's happening.",
28
- },
29
- "block": {"hint": None},
30
- },
31
- "description": {
32
- "input": {
33
- "multiline": True,
34
- "placeholder": "Help people responding to the incident. This will be posted to #tech-incidents and on our internal status page.\nThis description can be edited later.",
35
- },
36
- "block": {"hint": None},
37
- },
38
- "environment": {
39
- "input": {
40
- "placeholder": "Select an environment",
41
- },
42
- "widget": {
43
- "label_from_instance": lambda obj: f"{obj.value} - {obj.description}",
44
- },
45
- },
46
- "priority": {
47
- "input": {
48
- "placeholder": "Select a priority",
49
- },
50
- "widget": {
51
- "post_block": (
52
- SectionBlock(
53
- text=f"_<{settings.SLACK_SEVERITY_HELP_GUIDE_URL}|How to choose the priority?>_"
54
- )
55
- if settings.SLACK_SEVERITY_HELP_GUIDE_URL
56
- else None
57
- ),
58
- "label_from_instance": lambda obj: f"{obj.emoji} {obj.name} - {obj.description}",
59
- },
60
- },
61
- "incident_category": {
62
- "input": {
63
- "placeholder": "Select affected issue category",
64
- },
65
- },
66
- }
67
-
68
- # Change `priority` field from parent to be a hidden field
69
- def __init__(
70
- self,
71
- *args: Any,
72
- **kwargs: Any,
73
- ) -> None:
74
- super().__init__(*args, **kwargs)
75
- self.fields["priority"].widget = forms.HiddenInput()
76
-
77
-
78
- class OpeningCriticalModal(SetIncidentDetails[CreateIncidentFormSlack]):
79
- open_action: str = "open_incident_critical"
80
- push_action: str = "push_incident_critical"
81
- open_shortcut = "open_incident_critical"
82
- callback_id: str = "open_incident_critical"
83
-
84
- title = "Incident Details"
85
- form_class = CreateIncidentFormSlack
86
-
87
-
88
- modal_opening_critical = OpeningCriticalModal()