NAME

Tapper::Notification - Tapper - Daemon and plugins to handle MCP notifications

SYNOPSIS

The notification system is responsible for telling people that a certain condition they subscribed to has occured.

use Tapper::Notification;

my $daemon = Tapper::Notification->new();
$daemon->run();

FUNCTIONS

get_events

Read all pending events from database. Try no more than timeout seconds

@return success - Resultset class containing all available events

get_subscriptions

Get all subscriptions for a given event type.

@param string - type of the event

@return Tapper::Schema::ReportsDB::ResultSet::Notification

get_testrun_data

Get all neccessary testrun data related to given testrun id.

@param int - testrun id

@return hash ref - testrun data

get_report_data

Get all neccessary report data related to given report id.

@param int - report id

@return hash ref - report data

get_testrun_success

Get the overall success of the testrun with given id. If an error occurs, the function returns undef. This is most probably because the given testrun has no reports and thus no testrun stats can be found.

@param int - testrun id

@return success - success rate in percent @return error - undef

testrun_success_change

Return whether the last given testruns of a given condition have a different success state as the current one.

@param string - search string to define matching testruns @param int - number of testruns to look back

@return boolean - success change (yes/no)?

topic_success_change

Return whether the last given testruns of same topic name have a different success state then the current one. This is pretty much a testrun_success_change with the topic_name of the current testrun.

@param int - number of testruns to look back

@return boolean - success change (yes/no)?

matches

Check whether the given notification condition matches on the given event, i.e. whether we need to notify the owner. This version uses eval and should be replaced as soon as perl5.14.2 is available.

@param string - condition @param Result::NotificationEvent - event

@return true/false based on condition

testrun

report

notify_owner

Send notification to owner.

@param Result::Notification - subscription that triggered the notification

run

Run the Notification daemon once.

loop

Run the Notification daemon in an endless loop.

AUTHOR

AMD OSRC Tapper Team <tapper@amd64.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2012 by Advanced Micro Devices, Inc..

This is free software, licensed under:

The (two-clause) FreeBSD License