From 70b554a826ae8c033702ffd235f8318e742b9755 Mon Sep 17 00:00:00 2001 From: David Whittaker <84562015+whitdog47@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:20:45 -0700 Subject: [PATCH 01/42] Adding rounding method to quantize (#5368) --- tests/incident_cost/test_incident_cost_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/incident_cost/test_incident_cost_service.py b/tests/incident_cost/test_incident_cost_service.py index 46e9682d1029..0e22ced9d4e0 100644 --- a/tests/incident_cost/test_incident_cost_service.py +++ b/tests/incident_cost/test_incident_cost_service.py @@ -109,7 +109,7 @@ def test_calculate_incident_response_cost_with_cost_model( ): """Tests that the incident cost is calculated correctly when a cost model is enabled.""" from datetime import timedelta - from decimal import Decimal + from decimal import Decimal, ROUND_UP from dispatch.incident_cost.service import update_incident_response_cost, get_hourly_rate from dispatch.incident_cost_type import service as incident_cost_type_service from dispatch.participant_activity.service import ( @@ -154,8 +154,8 @@ def test_calculate_incident_response_cost_with_cost_model( ) * hourly_rate + orig_total_incident_cost assert cost - assert cost == Decimal(expected_incident_cost).quantize(cost) - assert cost == Decimal(incident.total_cost).quantize(cost) + assert cost == Decimal(expected_incident_cost).quantize(cost, rounding=ROUND_UP) + assert cost == Decimal(incident.total_cost).quantize(cost, rounding=ROUND_UP) def test_calculate_incident_response_cost_with_cost_model__no_enabled_plugins( From db2d04d05d7960b75a07a8036748bcb281668b6f Mon Sep 17 00:00:00 2001 From: David Whittaker <84562015+whitdog47@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:57:48 -0700 Subject: [PATCH 02/42] Correcting rounding strategy (#5373) --- tests/incident_cost/test_incident_cost_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/incident_cost/test_incident_cost_service.py b/tests/incident_cost/test_incident_cost_service.py index 0e22ced9d4e0..c38f8ee04619 100644 --- a/tests/incident_cost/test_incident_cost_service.py +++ b/tests/incident_cost/test_incident_cost_service.py @@ -109,7 +109,7 @@ def test_calculate_incident_response_cost_with_cost_model( ): """Tests that the incident cost is calculated correctly when a cost model is enabled.""" from datetime import timedelta - from decimal import Decimal, ROUND_UP + from decimal import Decimal, ROUND_HALF_UP from dispatch.incident_cost.service import update_incident_response_cost, get_hourly_rate from dispatch.incident_cost_type import service as incident_cost_type_service from dispatch.participant_activity.service import ( @@ -154,8 +154,8 @@ def test_calculate_incident_response_cost_with_cost_model( ) * hourly_rate + orig_total_incident_cost assert cost - assert cost == Decimal(expected_incident_cost).quantize(cost, rounding=ROUND_UP) - assert cost == Decimal(incident.total_cost).quantize(cost, rounding=ROUND_UP) + assert cost == Decimal(expected_incident_cost).quantize(cost, rounding=ROUND_HALF_UP) + assert cost == Decimal(incident.total_cost).quantize(cost, rounding=ROUND_HALF_UP) def test_calculate_incident_response_cost_with_cost_model__no_enabled_plugins( From 968ad5c7139e927a3babf1a08ec54657d4d6d1e4 Mon Sep 17 00:00:00 2001 From: Jason Litton Date: Tue, 22 Oct 2024 15:49:44 -0600 Subject: [PATCH 03/42] bug(core-ticket): Add dispatch_weblink field to core ticket plugin (#5377) * fix(core-ticket): Add dispatch_weblink field to core ticket plugin When using the core ticket plugin, we're getting the error `TypeError: DispatchTicketPlugin.update() got an unexpected keyword argument 'dispatch_weblink'` This field was added for the Jira ticket plugin but never added to the core plugin. Since the plugin returns no matter the arguments, I've simply added the field. * add newline that ide removed --- src/dispatch/plugins/dispatch_core/plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dispatch/plugins/dispatch_core/plugin.py b/src/dispatch/plugins/dispatch_core/plugin.py index 2dbeb354a615..f8e881f160aa 100644 --- a/src/dispatch/plugins/dispatch_core/plugin.py +++ b/src/dispatch/plugins/dispatch_core/plugin.py @@ -211,6 +211,7 @@ def update( document_weblink: str, storage_weblink: str, conference_weblink: str, + dispatch_weblink: str, cost: float, incident_type_plugin_metadata: dict = None, ): From 63ae82068078544cc100b5a32d3d5915e7d71c37 Mon Sep 17 00:00:00 2001 From: Jason Litton Date: Tue, 22 Oct 2024 15:58:23 -0600 Subject: [PATCH 04/42] Revert python version bump (#5379) The move to python 3.14 breaks the docker build. The srsly package doesn't have a compatible wheel with anything above 3.12 right now, and it's using deprecated methods, so it can't be built by 3.14 yet. Because of this, `docker build .` is broken on master. Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 23ae6081f361..a0f0e10ce95f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.13.0-slim-bullseye as sdist +FROM python:3.11.4-slim-bullseye as sdist LABEL maintainer="oss@netflix.com" LABEL org.opencontainers.image.title="Dispatch PyPI Wheel" @@ -56,7 +56,7 @@ RUN YARN_CACHE_FOLDER="$(mktemp -d)" \ && mv /usr/src/dispatch/dist /dist # This is the image to be run -FROM python:3.13.0-slim-bullseye +FROM python:3.11.4-slim-bullseye LABEL maintainer="oss@dispatch.io" LABEL org.opencontainers.image.title="Dispatch" From 295a60feba435c56bc3158d47e6a7efe4bde563e Mon Sep 17 00:00:00 2001 From: Alicia Matsumoto <56315176+aliciamatsumoto@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:03:34 -0400 Subject: [PATCH 05/42] fix get_signal_filter args (#5376) Co-authored-by: Alicia Matsumoto Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> --- src/dispatch/signal/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dispatch/signal/views.py b/src/dispatch/signal/views.py index 6b38f20c5568..e8dab18aabe7 100644 --- a/src/dispatch/signal/views.py +++ b/src/dispatch/signal/views.py @@ -241,7 +241,7 @@ def update_filter( signal_filter_in: SignalFilterUpdate, ): """Updates an existing signal filter.""" - signal_filter = get_signal_filter(db_session=db_session, signal_id=signal_filter_id) + signal_filter = get_signal_filter(db_session=db_session, signal_filter_id=signal_filter_id) if not signal_filter: raise HTTPException( status_code=status.HTTP_404_NOT_FOUND, From 9f7ecd740466c8653d4d82831f951ad3a94745bd Mon Sep 17 00:00:00 2001 From: Jason Litton Date: Tue, 22 Oct 2024 16:14:19 -0600 Subject: [PATCH 06/42] bug(slack/api): Make slack /event respond to challenge (#5375) * fix(slack): Make slack /events respond to challenge When configuring event listening for a slack app, your endpoint is required to respond correctly to the slack challenge that is sent. If your endpoint does not respond correctly, slack will not let you use it. Currently, the events endpoint does not respond correctly to the challenge because it is using a background thread to process all incoming events and responding with a static response. In order to use the events endpoint correctly (including using an @ in the incident channel to add an observer), that endpoint has to respond. I altered the event post to check the body for a "url_verification" type and, if it exists, process the event synchronously in the same way the `actions` endpoint does. Otherwise, process async like it always has. * add reformatting --------- Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> --- src/dispatch/plugins/dispatch_slack/endpoints.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/dispatch/plugins/dispatch_slack/endpoints.py b/src/dispatch/plugins/dispatch_slack/endpoints.py index 05785a844c57..9ccdf425c215 100644 --- a/src/dispatch/plugins/dispatch_slack/endpoints.py +++ b/src/dispatch/plugins/dispatch_slack/endpoints.py @@ -81,7 +81,18 @@ def get_request_handler(request: Request, body: bytes, organization: str) -> Sla ) async def slack_events(request: Request, organization: str, body: bytes = Depends(get_body)): """Handle all incoming Slack events.""" + handler = get_request_handler(request=request, body=body, organization=organization) + try: + body_json = json.loads(body) + # if we're getting the url verification request, + # handle it synchronously so that slack api verification works + if body_json.get("type") == "url_verification": + return handler.handle(req=request, body=body) + except json.JSONDecodeError: + pass + + # otherwise, handle it asynchronously task = BackgroundTask(handler.handle, req=request, body=body) return JSONResponse( background=task, From 6651c016c819bea0747a1c9d2ab7664059d349e5 Mon Sep 17 00:00:00 2001 From: David Whittaker <84562015+whitdog47@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:06:46 -0700 Subject: [PATCH 07/42] Propagate errors back to remove_member (#5372) --- src/dispatch/plugins/dispatch_google/groups/plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dispatch/plugins/dispatch_google/groups/plugin.py b/src/dispatch/plugins/dispatch_google/groups/plugin.py index a03cb9fc12e2..c52abd402cea 100644 --- a/src/dispatch/plugins/dispatch_google/groups/plugin.py +++ b/src/dispatch/plugins/dispatch_google/groups/plugin.py @@ -86,7 +86,9 @@ def add_member(client: Any, group_key: str, email: str, role: str): def remove_member(client: Any, group_key: str, email: str): """Removes member from google group.""" try: - return make_call(client.members(), "delete", groupKey=group_key, memberKey=email) + return make_call( + client.members(), "delete", groupKey=group_key, memberKey=email, propagate_errors=True + ) except HttpError as e: if e.resp.status in [409]: log.debug( From 0997901c933beff607ea626e4bba31bf725a3d08 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 22 Oct 2024 19:51:22 -0700 Subject: [PATCH 08/42] Fixing selects when not yet loaded (#5380) --- .../src/case/priority/CasePrioritySelect.vue | 12 +++++++++--- .../dispatch/src/case/type/CaseTypeSelect.vue | 12 +++++++++--- .../incident/priority/IncidentPrioritySelect.vue | 13 ++++++++++--- .../src/incident/type/IncidentTypeSelect.vue | 12 +++++++++--- 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue b/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue index fba5cba04eba..ecbc78c6b2dd 100644 --- a/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue +++ b/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue @@ -143,9 +143,15 @@ export default { project: { handler(newProject) { if (newProject?.id !== this.lastProjectId) { - this.lastProjectId = newProject?.id - this.resetSelection() - this.fetchData() + // Check if we're moving to a valid project (not null) + if (this.lastProjectId) { + this.lastProjectId = newProject.id + this.resetSelection() + this.fetchData() + } else { + // If new project is null/undefined, just update lastProjectId + this.lastProjectId = null + } } this.validatePriority() }, diff --git a/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue b/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue index 34f8df53e7cf..ce9693799055 100644 --- a/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue +++ b/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue @@ -172,9 +172,15 @@ export default { project: { handler(newProject) { if (newProject?.id !== this.lastProjectId) { - this.lastProjectId = newProject?.id - this.resetSelection() - this.fetchData() + // Check if we're moving to a valid project (not null) + if (this.lastProjectId) { + this.lastProjectId = newProject.id + this.resetSelection() + this.fetchData() + } else { + // If new project is null/undefined, just update lastProjectId + this.lastProjectId = null + } } this.validateType() }, diff --git a/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue b/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue index 08ab2d6e0270..9feb7e5e4353 100644 --- a/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue +++ b/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue @@ -133,10 +133,17 @@ export default { project: { handler(newProject) { if (newProject?.id !== this.lastProjectId) { - this.lastProjectId = newProject?.id - this.resetSelection() - this.fetchData() + // Check if we're moving to a valid project (not null) + if (this.lastProjectId) { + this.lastProjectId = newProject.id + this.resetSelection() + this.fetchData() + } else { + // If new project is null/undefined, just update lastProjectId + this.lastProjectId = null + } } + this.validatePriority() }, deep: true, diff --git a/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue b/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue index e7e8c62c3d51..5040af7002bb 100644 --- a/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue +++ b/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue @@ -86,9 +86,15 @@ export default { project: { handler(newProject) { if (newProject?.id !== this.lastProjectId) { - this.lastProjectId = newProject?.id - this.clearSelection() - this.fetchData() + // Check if we're moving to a valid project (not null) + if (this.lastProjectId) { + this.lastProjectId = newProject.id + this.resetSelection() + this.fetchData() + } else { + // If new project is null/undefined, just update lastProjectId + this.lastProjectId = null + } } }, }, From 0ddfb6123d9c7cc3c3ba5d1da2ef670dbd12e005 Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Wed, 23 Oct 2024 12:13:57 -0700 Subject: [PATCH 09/42] Speeds up case resolution (#5384) * Speeds up case resolution * bumps pre commit versions --- .pre-commit-config.yaml | 4 +- src/dispatch/case/flows.py | 23 +++++------ .../dispatch_slack/case/interactive.py | 40 ++++++++----------- 3 files changed, 29 insertions(+), 38 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a0013f0943b2..37d7474cb362 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ default_language_version: repos: - repo: https://github.com/astral-sh/ruff-pre-commit # ruff version. - rev: v0.6.4 + rev: v0.7.0 hooks: # Run the linter. # @@ -28,7 +28,7 @@ repos: # Typos - repo: https://github.com/crate-ci/typos - rev: v1.24.5 + rev: v1.26.1 hooks: - id: typos exclude: ^(data/dispatch-sample-data.dump|src/dispatch/static/dispatch/src/|src/dispatch/database/revisions/) diff --git a/src/dispatch/case/flows.py b/src/dispatch/case/flows.py index 21aa8d517b4f..b0a2b0c9e457 100644 --- a/src/dispatch/case/flows.py +++ b/src/dispatch/case/flows.py @@ -11,7 +11,7 @@ from dispatch.database.core import SessionLocal from dispatch.decorators import background_task from dispatch.document import flows as document_flows -from dispatch.enums import DocumentResourceTypes, Visibility, EventType +from dispatch.enums import DocumentResourceTypes, EventType, Visibility from dispatch.event import service as event_service from dispatch.group import flows as group_flows from dispatch.group.enums import GroupAction, GroupType @@ -19,16 +19,16 @@ from dispatch.incident import service as incident_service from dispatch.incident.enums import IncidentStatus from dispatch.incident.messaging import send_participant_announcement_message -from dispatch.incident.models import IncidentCreate, Incident -from dispatch.incident.type.models import IncidentType +from dispatch.incident.models import Incident, IncidentCreate from dispatch.incident.priority.models import IncidentPriority +from dispatch.incident.type.models import IncidentType from dispatch.individual.models import IndividualContactRead from dispatch.models import OrganizationSlug, PrimaryKey from dispatch.participant import flows as participant_flows from dispatch.participant import service as participant_service from dispatch.participant.models import ParticipantUpdate from dispatch.participant_role import flows as role_flow -from dispatch.participant_role.models import ParticipantRoleType, ParticipantRole +from dispatch.participant_role.models import ParticipantRole, ParticipantRoleType from dispatch.plugin import service as plugin_service from dispatch.storage import flows as storage_flows from dispatch.storage.enums import StorageAction @@ -36,10 +36,9 @@ from .messaging import ( send_case_created_notifications, - send_case_update_notifications, send_case_rating_feedback_message, + send_case_update_notifications, ) - from .models import Case, CaseStatus from .service import get @@ -337,8 +336,8 @@ def case_update_flow( # we get the case case = get(db_session=db_session, case_id=case_id) - if reporter_email: - # we run the case assign role flow for the reporter + if reporter_email and case and reporter_email != case.reporter.email: + # we run the case assign role flow for the reporter if it changed case_assign_role_flow( case_id=case.id, participant_email=reporter_email, @@ -346,8 +345,8 @@ def case_update_flow( db_session=db_session, ) - if assignee_email: - # we run the case assign role flow for the assignee + if assignee_email and case and assignee_email != case.assignee.email: + # we run the case assign role flow for the assignee if it changed case_assign_role_flow( case_id=case.id, participant_email=assignee_email, @@ -375,7 +374,7 @@ def case_update_flow( if case.tactical_group: # we update the tactical group - if reporter_email: + if reporter_email and reporter_email != case.reporter.email: group_flows.update_group( subject=case, group=case.tactical_group, @@ -383,7 +382,7 @@ def case_update_flow( group_member=reporter_email, db_session=db_session, ) - if assignee_email: + if assignee_email and assignee_email != case.assignee.email: group_flows.update_group( subject=case, group=case.tactical_group, diff --git a/src/dispatch/plugins/dispatch_slack/case/interactive.py b/src/dispatch/plugins/dispatch_slack/case/interactive.py index 942a5eabf034..08500ff06d88 100644 --- a/src/dispatch/plugins/dispatch_slack/case/interactive.py +++ b/src/dispatch/plugins/dispatch_slack/case/interactive.py @@ -1660,49 +1660,41 @@ def handle_resolve_submission_event( user: DispatchUser, ): ack() - # we get the current or previous case - case = case_service.get(db_session=db_session, case_id=context["subject"].id) - previous_case = CaseRead.from_orm(case) + # we get the current case and store it as previous case + current_case = case_service.get(db_session=db_session, case_id=context["subject"].id) + previous_case = CaseRead.from_orm(current_case) - # we run the case status transition flow - case_flows.case_status_transition_flow_dispatcher( - case=case, - current_status=CaseStatus.closed, - db_session=db_session, - previous_status=case.status, - organization_slug=context["subject"].organization_slug, - ) - - # we update the case with the new resolution and status + # we update the case with the new resolution, resolution reason and status case_in = CaseUpdate( - title=case.title, + title=current_case.title, resolution_reason=form_data[DefaultBlockIds.case_resolution_reason_select]["value"], resolution=form_data[DefaultBlockIds.resolution_input], - visibility=case.visibility, + visibility=current_case.visibility, status=CaseStatus.closed, ) - case = case_service.update( + updated_case = case_service.update( db_session=db_session, - case=case, + case=current_case, case_in=case_in, current_user=user, ) + # we run the case update flow case_flows.case_update_flow( - case_id=case.id, + case_id=updated_case.id, previous_case=previous_case, db_session=db_session, - reporter_email=case.reporter.individual.email if case.reporter else None, - assignee_email=case.assignee.individual.email if case.assignee else None, + reporter_email=updated_case.reporter.individual.email if updated_case.reporter else None, + assignee_email=updated_case.assignee.individual.email if updated_case.assignee else None, organization_slug=context["subject"].organization_slug, ) - # We update the case message with the new resolution and status - blocks = create_case_message(case=case, channel_id=context["subject"].channel_id) + # we update the case notification with the resolution, resolution reason and status + blocks = create_case_message(case=updated_case, channel_id=context["subject"].channel_id) client.chat_update( blocks=blocks, - ts=case.conversation.thread_id, - channel=case.conversation.channel_id, + ts=updated_case.conversation.thread_id, + channel=updated_case.conversation.channel_id, ) From 24b78e500df92c21546f45309e882ca497ea23ba Mon Sep 17 00:00:00 2001 From: David Whittaker <84562015+whitdog47@users.noreply.github.com> Date: Thu, 24 Oct 2024 09:31:53 -0700 Subject: [PATCH 10/42] fix(ui): fixes details tab selects (#5385) --- .github/workflows/python.yml | 2 +- .../static/dispatch/src/case/DetailsTab.vue | 2 +- .../src/case/priority/CasePrioritySelect.vue | 18 +----- .../dispatch/src/case/type/CaseTypeSelect.vue | 21 ++----- .../dispatch/src/incident/DetailsTab.vue | 2 +- .../priority/IncidentPrioritySelect.vue | 20 +------ .../src/incident/type/IncidentTypeSelect.vue | 56 +++++++++++-------- 7 files changed, 44 insertions(+), 77 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index f45cf86f1c08..4bbb95877b30 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -8,7 +8,7 @@ jobs: # Minimum code coverage per file COVERAGE_SINGLE: 50 # Minimum total code coverage - COVERAGE_TOTAL: 56 + COVERAGE_TOTAL: 55 runs-on: ubuntu-latest services: postgres: diff --git a/src/dispatch/static/dispatch/src/case/DetailsTab.vue b/src/dispatch/static/dispatch/src/case/DetailsTab.vue index b216d2d19186..6873d90c9038 100644 --- a/src/dispatch/static/dispatch/src/case/DetailsTab.vue +++ b/src/dispatch/static/dispatch/src/case/DetailsTab.vue @@ -62,7 +62,7 @@ /> - + diff --git a/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue b/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue index ecbc78c6b2dd..47fb41115fe8 100644 --- a/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue +++ b/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue @@ -140,22 +140,8 @@ export default { }, watch: { - project: { - handler(newProject) { - if (newProject?.id !== this.lastProjectId) { - // Check if we're moving to a valid project (not null) - if (this.lastProjectId) { - this.lastProjectId = newProject.id - this.resetSelection() - this.fetchData() - } else { - // If new project is null/undefined, just update lastProjectId - this.lastProjectId = null - } - } - this.validatePriority() - }, - deep: true, + project() { + this.fetchData() }, }, diff --git a/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue b/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue index ce9693799055..dcf695fa1f6d 100644 --- a/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue +++ b/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue @@ -130,7 +130,7 @@ export default { } } - filterOptions = SearchUtils.createParametersFromTableOptions({ ...filterOptions }) + filterOptions = SearchUtils.createParametersFromTableOptions({ ...filterOptions }, "CaseType") CaseTypeApi.getAll(filterOptions) .then((response) => { @@ -169,22 +169,9 @@ export default { }, watch: { - project: { - handler(newProject) { - if (newProject?.id !== this.lastProjectId) { - // Check if we're moving to a valid project (not null) - if (this.lastProjectId) { - this.lastProjectId = newProject.id - this.resetSelection() - this.fetchData() - } else { - // If new project is null/undefined, just update lastProjectId - this.lastProjectId = null - } - } - this.validateType() - }, - deep: true, + project() { + this.validateType() + this.fetchData() }, }, diff --git a/src/dispatch/static/dispatch/src/incident/DetailsTab.vue b/src/dispatch/static/dispatch/src/incident/DetailsTab.vue index 945b18d96c0e..ac05614ad7e7 100644 --- a/src/dispatch/static/dispatch/src/incident/DetailsTab.vue +++ b/src/dispatch/static/dispatch/src/incident/DetailsTab.vue @@ -56,7 +56,7 @@ /> - + diff --git a/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue b/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue index 9feb7e5e4353..a14387ae925a 100644 --- a/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue +++ b/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue @@ -130,23 +130,9 @@ export default { }, watch: { - project: { - handler(newProject) { - if (newProject?.id !== this.lastProjectId) { - // Check if we're moving to a valid project (not null) - if (this.lastProjectId) { - this.lastProjectId = newProject.id - this.resetSelection() - this.fetchData() - } else { - // If new project is null/undefined, just update lastProjectId - this.lastProjectId = null - } - } - - this.validatePriority() - }, - deep: true, + project() { + this.validatePriority() + this.fetchData() }, status() { this.validatePriority() diff --git a/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue b/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue index 5040af7002bb..e51c9fa58a4a 100644 --- a/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue +++ b/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue @@ -7,7 +7,7 @@ :label="label" return-object :loading="loading" - :rules="[validationRule]" + :rules="[is_type_in_project]" > diff --git a/src/dispatch/static/dispatch/src/incident/DetailsTab.vue b/src/dispatch/static/dispatch/src/incident/DetailsTab.vue index ac05614ad7e7..28cccf27ea59 100644 --- a/src/dispatch/static/dispatch/src/incident/DetailsTab.vue +++ b/src/dispatch/static/dispatch/src/incident/DetailsTab.vue @@ -56,7 +56,7 @@ /> - + @@ -189,6 +189,9 @@ export default { "selected.title", "selected.visibility", ]), + project_disabled(item) { + return item.id != null + }, }, } From 6fabeb94f860be834fbabb7e2682106f96b03fc1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:27:33 -0700 Subject: [PATCH 33/42] chore(deps): bump slack-sdk from 3.33.1 to 3.33.3 (#5411) Bumps [slack-sdk](https://github.com/slackapi/python-slack-sdk) from 3.33.1 to 3.33.3. - [Release notes](https://github.com/slackapi/python-slack-sdk/releases) - [Commits](https://github.com/slackapi/python-slack-sdk/compare/v3.33.1...v3.33.3) --- updated-dependencies: - dependency-name: slack-sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-base.txt b/requirements-base.txt index 201d8f1ebae9..a8cb60c9e486 100644 --- a/requirements-base.txt +++ b/requirements-base.txt @@ -398,7 +398,7 @@ six==1.16.0 # validators slack-bolt==1.21.2 # via -r requirements-base.in -slack-sdk==3.33.1 +slack-sdk==3.33.3 # via # -r requirements-base.in # slack-bolt From 99a8ae72cdbb346cf9e32d0e0f82b715255b0987 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:27:41 -0700 Subject: [PATCH 34/42] chore(deps): bump python-multipart from 0.0.12 to 0.0.16 (#5406) Bumps [python-multipart](https://github.com/Kludex/python-multipart) from 0.0.12 to 0.0.16. - [Release notes](https://github.com/Kludex/python-multipart/releases) - [Changelog](https://github.com/Kludex/python-multipart/blob/master/CHANGELOG.md) - [Commits](https://github.com/Kludex/python-multipart/compare/0.0.12...0.0.16) --- updated-dependencies: - dependency-name: python-multipart dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-base.txt b/requirements-base.txt index a8cb60c9e486..2166ed23202a 100644 --- a/requirements-base.txt +++ b/requirements-base.txt @@ -330,7 +330,7 @@ python-dateutil==2.9.0.post0 # pandas python-jose==3.3.0 # via -r requirements-base.in -python-multipart==0.0.12 +python-multipart==0.0.16 # via -r requirements-base.in python-slugify==8.0.4 # via -r requirements-base.in From 9c1af3f7e99cb22bcda729dec68b749f9f465aaa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:27:49 -0700 Subject: [PATCH 35/42] chore(deps): bump @tanstack/vue-query in /src/dispatch/static/dispatch (#5405) Bumps [@tanstack/vue-query](https://github.com/TanStack/query/tree/HEAD/packages/vue-query) from 5.59.13 to 5.59.16. - [Release notes](https://github.com/TanStack/query/releases) - [Commits](https://github.com/TanStack/query/commits/v5.59.16/packages/vue-query) --- updated-dependencies: - dependency-name: "@tanstack/vue-query" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/dispatch/static/dispatch/package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dispatch/static/dispatch/package-lock.json b/src/dispatch/static/dispatch/package-lock.json index 82b87336f720..08441c6e3742 100644 --- a/src/dispatch/static/dispatch/package-lock.json +++ b/src/dispatch/static/dispatch/package-lock.json @@ -1612,21 +1612,21 @@ } }, "node_modules/@tanstack/query-core": { - "version": "5.59.13", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.59.13.tgz", - "integrity": "sha512-Oou0bBu/P8+oYjXsJQ11j+gcpLAMpqW42UlokQYEz4dE7+hOtVO9rVuolJKgEccqzvyFzqX4/zZWY+R/v1wVsQ==", + "version": "5.59.16", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.59.16.tgz", + "integrity": "sha512-crHn+G3ltqb5JG0oUv6q+PMz1m1YkjpASrXTU+sYWW9pLk0t2GybUHNRqYPZWhxgjPaVGC4yp92gSFEJgYEsPw==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/vue-query": { - "version": "5.59.13", - "resolved": "https://registry.npmjs.org/@tanstack/vue-query/-/vue-query-5.59.13.tgz", - "integrity": "sha512-3pJg3NlNLD7sQLHFvPKIQ64l86uGuudqDUxlTGCBX5zlpTWjajzfovFc0DHcb0ClKtFyBCmrqnLcMMkjdJj6GQ==", + "version": "5.59.16", + "resolved": "https://registry.npmjs.org/@tanstack/vue-query/-/vue-query-5.59.16.tgz", + "integrity": "sha512-ncKfvrDV1CfPWr4VKykn33yW74ZPbHZBBUN8X2saIvxH8yZLiT/lwjh50WpRSWLcCTw/zrQJgteA3X3Qsoqo5A==", "dependencies": { "@tanstack/match-sorter-utils": "^8.15.1", - "@tanstack/query-core": "5.59.13", + "@tanstack/query-core": "5.59.16", "@vue/devtools-api": "^6.6.3", "vue-demi": "^0.14.10" }, From 4eeb7ade118a5d3009218ddadfd304ebd7358261 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:27:57 -0700 Subject: [PATCH 36/42] chore(deps-dev): bump vite in /src/dispatch/static/dispatch (#5404) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.9 to 5.4.10. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v5.4.10/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.4.10/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/dispatch/static/dispatch/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dispatch/static/dispatch/package-lock.json b/src/dispatch/static/dispatch/package-lock.json index 08441c6e3742..a9fce85ab5e1 100644 --- a/src/dispatch/static/dispatch/package-lock.json +++ b/src/dispatch/static/dispatch/package-lock.json @@ -6973,9 +6973,9 @@ } }, "node_modules/vite": { - "version": "5.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.9.tgz", - "integrity": "sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==", + "version": "5.4.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz", + "integrity": "sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==", "devOptional": true, "dependencies": { "esbuild": "^0.21.3", From cdee812ab88803aca697b8590727b4c102236981 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:28:04 -0700 Subject: [PATCH 37/42] chore(deps): bump @tiptap/vue-3 in /src/dispatch/static/dispatch (#5403) Bumps [@tiptap/vue-3](https://github.com/ueberdosis/tiptap/tree/HEAD/packages/vue-3) from 2.8.0 to 2.9.1. - [Release notes](https://github.com/ueberdosis/tiptap/releases) - [Changelog](https://github.com/ueberdosis/tiptap/blob/develop/packages/vue-3/CHANGELOG.md) - [Commits](https://github.com/ueberdosis/tiptap/commits/@tiptap/vue-3@2.9.1/packages/vue-3) --- updated-dependencies: - dependency-name: "@tiptap/vue-3" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../static/dispatch/package-lock.json | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/dispatch/static/dispatch/package-lock.json b/src/dispatch/static/dispatch/package-lock.json index a9fce85ab5e1..23ba33b15584 100644 --- a/src/dispatch/static/dispatch/package-lock.json +++ b/src/dispatch/static/dispatch/package-lock.json @@ -1706,9 +1706,9 @@ } }, "node_modules/@tiptap/extension-bubble-menu": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.8.0.tgz", - "integrity": "sha512-swg+myJPN60LduQvLMF4hVBqP5LOIN01INZBzBI8egz8QufqtSyRCgXl7Xcma0RT5xIXnZSG9XOqNFf2rtkjKA==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.9.1.tgz", + "integrity": "sha512-DWUF6NG08/bZDWw0jCeotSTvpkyqZTi4meJPomG9Wzs/Ol7mEwlNCsCViD999g0+IjyXFatBk4DfUq1YDDu++Q==", "dependencies": { "tippy.js": "^6.3.7" }, @@ -1784,9 +1784,9 @@ } }, "node_modules/@tiptap/extension-floating-menu": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.8.0.tgz", - "integrity": "sha512-H4QT61CrkLqisnGGC7zgiYmsl2jXPHl89yQCbdlkQN7aw11H7PltcJS2PJguL0OrRVJS/Mv/VTTUiMslmsEV5g==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.9.1.tgz", + "integrity": "sha512-MxZ7acNNsoNaKpetxfwi3Z11Bgrh0T2EJlCV77v9N1vWK38+st3H1WJanmLbPNtc2ocvhHJrz+DjDz3CWxQ9rQ==", "dependencies": { "tippy.js": "^6.3.7" }, @@ -2021,12 +2021,12 @@ } }, "node_modules/@tiptap/vue-3": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-2.8.0.tgz", - "integrity": "sha512-bJLoNQAkKXcWfRuX1YGu7SQFF+xY40YkpDagBXKXtmAfwIAwjO52grj4dpZoEtM12ZyxsC2RAHYYxBVPPYRSnw==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-2.9.1.tgz", + "integrity": "sha512-51mKa4C3hdKe+o6G7Pk7d4puZ/VjoHWtTo2WxE249oH+bCkh6FObqNu2wfRK+9obVuTGXQ9dAc988cmwY+2eyw==", "dependencies": { - "@tiptap/extension-bubble-menu": "^2.8.0", - "@tiptap/extension-floating-menu": "^2.8.0" + "@tiptap/extension-bubble-menu": "^2.9.1", + "@tiptap/extension-floating-menu": "^2.9.1" }, "funding": { "type": "github", From 722e63d04f899798e5ebebb05b8344d977798bc3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:28:12 -0700 Subject: [PATCH 38/42] chore(deps-dev): bump eslint-plugin-vue in /src/dispatch/static/dispatch (#5402) Bumps [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) from 9.29.1 to 9.30.0. - [Release notes](https://github.com/vuejs/eslint-plugin-vue/releases) - [Commits](https://github.com/vuejs/eslint-plugin-vue/compare/v9.29.1...v9.30.0) --- updated-dependencies: - dependency-name: eslint-plugin-vue dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/dispatch/static/dispatch/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dispatch/static/dispatch/package-lock.json b/src/dispatch/static/dispatch/package-lock.json index 23ba33b15584..b39b56474f5c 100644 --- a/src/dispatch/static/dispatch/package-lock.json +++ b/src/dispatch/static/dispatch/package-lock.json @@ -3959,9 +3959,9 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "9.29.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.29.1.tgz", - "integrity": "sha512-MH/MbVae4HV/tM8gKAVWMPJbYgW04CK7SuzYRrlNERpxbO0P3+Zdsa2oAcFBW6xNu7W6lIkGOsFAMCRTYmrlWQ==", + "version": "9.30.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.30.0.tgz", + "integrity": "sha512-CyqlRgShvljFkOeYK8wN5frh/OGTvkj1S7wlr2Q2pUvwq+X5VYiLd6ZjujpgSgLnys2W8qrBLkXQ41SUYaoPIQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", From e1cd0245e6e49b95ae72046194ed2c2e2fc9d28f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:28:20 -0700 Subject: [PATCH 39/42] chore(deps-dev): bump @playwright/test in /src/dispatch/static/dispatch (#5401) Bumps [@playwright/test](https://github.com/microsoft/playwright) from 1.48.1 to 1.48.2. - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.48.1...v1.48.2) --- updated-dependencies: - dependency-name: "@playwright/test" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../static/dispatch/package-lock.json | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/dispatch/static/dispatch/package-lock.json b/src/dispatch/static/dispatch/package-lock.json index b39b56474f5c..3b369fcb6ec7 100644 --- a/src/dispatch/static/dispatch/package-lock.json +++ b/src/dispatch/static/dispatch/package-lock.json @@ -1233,12 +1233,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.48.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.1.tgz", - "integrity": "sha512-s9RtWoxkOLmRJdw3oFvhFbs9OJS0BzrLUc8Hf6l2UdCNd1rqeEyD4BhCJkvzeEoD1FsK4mirsWwGerhVmYKtZg==", + "version": "1.48.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.2.tgz", + "integrity": "sha512-54w1xCWfXuax7dz4W2M9uw0gDyh+ti/0K/MxcCUxChFh37kkdxPdfZDw5QBbuPUJHr1CiHJ1hXgSs+GgeQc5Zw==", "dev": true, "dependencies": { - "playwright": "1.48.1" + "playwright": "1.48.2" }, "bin": { "playwright": "cli.js" @@ -5766,12 +5766,12 @@ } }, "node_modules/playwright": { - "version": "1.48.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.1.tgz", - "integrity": "sha512-j8CiHW/V6HxmbntOfyB4+T/uk08tBy6ph0MpBXwuoofkSnLmlfdYNNkFTYD6ofzzlSqLA1fwH4vwvVFvJgLN0w==", + "version": "1.48.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.2.tgz", + "integrity": "sha512-NjYvYgp4BPmiwfe31j4gHLa3J7bD2WiBz8Lk2RoSsmX38SVIARZ18VYjxLjAcDsAhA+F4iSEXTSGgjua0rrlgQ==", "dev": true, "dependencies": { - "playwright-core": "1.48.1" + "playwright-core": "1.48.2" }, "bin": { "playwright": "cli.js" @@ -5784,9 +5784,9 @@ } }, "node_modules/playwright-core": { - "version": "1.48.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.1.tgz", - "integrity": "sha512-Yw/t4VAFX/bBr1OzwCuOMZkY1Cnb4z/doAFSwf4huqAGWmf9eMNjmK7NiOljCdLmxeRYcGPPmcDgU0zOlzP0YA==", + "version": "1.48.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.2.tgz", + "integrity": "sha512-sjjw+qrLFlriJo64du+EK0kJgZzoQPsabGF4lBvsid+3CNIZIYLgnMj9V6JY5VhM2Peh20DJWIVpVljLLnlawA==", "dev": true, "bin": { "playwright-core": "cli.js" From ed862168fbbd53d9a87e86aac95ed41328e178b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:28:28 -0700 Subject: [PATCH 40/42] chore(deps): bump python in /docker (#5400) Bumps python from 3.11.4-slim-bullseye to 3.13.0-slim-bullseye. --- updated-dependencies: - dependency-name: python dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a0f0e10ce95f..23ae6081f361 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11.4-slim-bullseye as sdist +FROM python:3.13.0-slim-bullseye as sdist LABEL maintainer="oss@netflix.com" LABEL org.opencontainers.image.title="Dispatch PyPI Wheel" @@ -56,7 +56,7 @@ RUN YARN_CACHE_FOLDER="$(mktemp -d)" \ && mv /usr/src/dispatch/dist /dist # This is the image to be run -FROM python:3.11.4-slim-bullseye +FROM python:3.13.0-slim-bullseye LABEL maintainer="oss@dispatch.io" LABEL org.opencontainers.image.title="Dispatch" From 053723ecd170cd4d0e8d45d412770cc440579fef Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:28:26 -0700 Subject: [PATCH 41/42] feat(case): update conversation on case auto close (#5412) --- src/dispatch/case/flows.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dispatch/case/flows.py b/src/dispatch/case/flows.py index 2d58d35cb393..a29655394e9b 100644 --- a/src/dispatch/case/flows.py +++ b/src/dispatch/case/flows.py @@ -211,6 +211,10 @@ def case_auto_close_flow(case: Case, db_session: Session): db_session=db_session, ) + if case.conversation and case.has_thread: + # we update the case conversation + update_conversation(case=case, db_session=db_session) + def case_new_create_flow( *, From c87f545ef9d53e0ca485e14f8bdb5f2b80625e54 Mon Sep 17 00:00:00 2001 From: Jason Litton Date: Thu, 31 Oct 2024 16:15:12 -0600 Subject: [PATCH 42/42] chore(node): Upgrade to node lts (#5394) Upgrading the docker build and nvm to node 20.18, which is the latest supported, stable LTS version. Node 12 and 16 have been EoL since April, 2022 and August, 2023, respectively. In addition, a transitive dependency of mjml, minimatch, is not compatible with anything less than node 14 at this point, so email generation from templates was broken. With the move to newer node, I had to deal with a new node/docker restriction which won't allow you to `npm install` in the root directory. I wanted to maintain backwards compatiblity with current installs and their MJML_PATH parameter, so I worked around the problem by installing mjml in another directory and then moving node_modules to the root directory. It's not pretty, but it worked. I'm trying to run tests locally and I get one failure, but I'm not sure if it's my setup or something I need to correct. I've manually tested the setup, gone into every page, and not experienced problems. Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> --- .nvmrc | 2 +- docker/Dockerfile | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.nvmrc b/.nvmrc index 58a4133d910f..2a393af592b8 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.13.0 +20.18.0 diff --git a/docker/Dockerfile b/docker/Dockerfile index 23ae6081f361..0ed550a1adf2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ wget \ && rm -rf /var/lib/apt/lists/* -RUN wget --quiet -O - https://deb.nodesource.com/setup_16.x | bash - \ +RUN wget --quiet -O - https://deb.nodesource.com/setup_20.x | bash - \ && apt-get install -y nodejs --no-install-recommends ARG SOURCE_COMMIT @@ -87,7 +87,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN wget --quiet -O - https://deb.nodesource.com/setup_12.x | bash - +RUN wget --quiet -O - https://deb.nodesource.com/setup_20.x | bash - COPY --from=sdist /dist/*.whl /tmp/dist/ RUN buildDeps="" \ @@ -104,7 +104,21 @@ RUN buildDeps="" \ pkg-config postgresql-client-14 nodejs \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ - && npm install mjml --no-cache-dir + # mjml has to be installed differently here because + # after node 14, docker will install npm files at the + # root directoy and fail, so we have to create a new + # directory and use it for the install then copy the + # files to the root directory to maintain backwards + # compatibility for email generation + && mkdir -p /mjml_install \ + # if our workdir is /, then pushd/popd doesn't work + # for the npm install. It still tries to install in /, + # which npm can't do + && cd /mjml_install \ + && npm install --no-cache-dir mjml \ + && mv node_modules / \ + && cd / \ + && rm -rf /mjml_install EXPOSE 8000 VOLUME /var/lib/dispatch/files