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" 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, ): 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, 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, 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(