#133 Add BaseHandler.set_context to set the current context of a handler and use it to mark builds as failed in case of traceback.
Merged by jkaluza. Opened by jkaluza.
jkaluza/freshmaker handler-context  into  master

Download 133.patch

This fixes issue when we have some traceback in a handler and the Event the handler was handling is not marked as Failed.

rebased onto dec996535bb29dd13360b020ad830de5eecb4024

Added fail_event_on_handler_exception and fail_artifact_build_on_handler_exception decorators.

Nice, looks good to me.

I would prefer to use functools.wraps so that the name and the docstring of the original function would not get lost.

:thumbsup:

+1 Good point :)

Also :thumbsup:

Some flake8 errors introduced by this patch:

./freshmaker/consumer.py:31:1: F401 'freshmaker.db' imported but unused
./freshmaker/consumer.py:33:1: F401 'freshmaker.models.Event' imported but unused
./freshmaker/consumer.py:34:1: F401 'freshmaker.types.ArtifactBuildState' imported but unused
./freshmaker/consumer.py:151:33: F841 local variable 'e' is assigned to but never used

rebased onto f2182b84235aa504f4dd5f23695eadef49271899

Updated to fix flake8 and use functools.wraps. Going to merge.

Pull-Request has been merged by jkaluza

Metadata