Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better logging when a task completion fails #1260

Merged
merged 5 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/main.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,18 @@ jobs:
run: docker network create top_and_zaak_backend_bridge
- name: Start images
run: docker compose -f docker-compose.local.yml up -d
- run: sleep 30
- name: Run Tests
run: docker compose -f docker-compose.local.yml exec -T zaak-gateway python manage.py test

- if: ${{ failure() }}
name: "ON FAILURE: Which containers were running while failing?"
run: docker ps -a

- if: ${{ failure() }}
name: "ON FAILURE: Backend logs"
run: docker logs zaken-backend-zaak-gateway-1

- if: ${{ failure() }}
name: "ON FAILURE: Database logs"
run: docker logs zaken-backend-database-1
6 changes: 6 additions & 0 deletions app/apps/workflow/signals.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import copy
import datetime
import logging

import pytz
from apps.events.models import TaskModelEventEmitter
Expand All @@ -16,6 +17,8 @@
from .user_tasks import DEFAULT_USER_TASK_DUE_DATE, get_task_by_name
from .utils import get_latest_version_from_config

logger = logging.getLogger(__name__)


@receiver(pre_save, dispatch_uid="event_emitter_pre_save")
def event_emitter_pre_save(instance, **kwargs):
Expand All @@ -36,6 +39,9 @@ def event_emitter_pre_save(instance, **kwargs):
case_user_task_id=instance.case_user_task_id
)
if type_instance:
logger.error(
f"TaskModelEventEmitter of type '{instance.__class__.__name__}', with id '{instance.case_user_task_id}', already exists"
)
raise EventEmitterExistsError(
f"TaskModelEventEmitter of type '{instance.__class__.__name__}', with id '{instance.case_user_task_id}', already exists"
)
Expand Down
Loading