Hello,
I was trying out multiple actions in one request and noticed that the
notifications contain only the last action.
I looked at the code and found this in /usr/lib/obs/server/BSNotify.pm
line 82 :
# FIXME: how to handle multiple actions in one request here ?
# right now the last one just wins ....
So here's a proposed fix : add an actions key in the reqinfo hash, that
contains an ordered list of hashes that contain the details of the actions.
The Data::Dumper of reqinfo produced by the attached patch looks like this :
$VAR1 = {
'when' => '2010-09-30T00:12:13',
'actions' => [
{
'sourcerevision' => '1',
'sourceproject' => 'Foo:Devel:Personal',
'deletepackage' => undef,
'targetproject' => 'Foo:Trunk',
'sourcepackage' => 'libfoo',
'type' => 'submit',
'targetpackage' => 'libfoo',
'deleteproject' => undef
},
{
'sourcerevision' => '1',
'sourceproject' => 'Foo:Devel:Personal',
'deletepackage' => undef,
'targetproject' => 'Foo:Trunk',
'sourcepackage' => 'bar',
'type' => 'submit',
'targetpackage' => 'bar',
'deleteproject' => undef
}
],
'author' => 'bob',
'description' => 'Test',
'state' => 'new',
'comment' => undef,
'who' => 'bob',
'sender' => 'bob',
'id' => 32,
'type' => ''
};
Is this change acceptable ? If so, I guess the notification plugins will
have to be changed to accommodate this.
Thanks,
Islam Amer