Bug 1136748

Summary: [ RFE ] allow email preferences configuration
Product: [Retired] Beaker Reporter: Alexander Todorov <atodorov>
Component: generalAssignee: Blake McIvor <bmcivor>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 0.17CC: bmcivor, dcallagh, dowang, ebaak, jburke, rjoost
Target Milestone: 24.0Keywords: FutureFeature, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-21 18:49:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexander Todorov 2014-09-03 08:37:23 UTC
Description of problem:

There is no way for the user to configure email preferences in Beaker. At the moment I think there are at least 2 different notifications:

1) When a reserved system is ready for use
2) When a test job completes


I'm currently filtering these out of my inbox (and maybe others depending on what my email filters catch) so it's clear I don't like to receive them. 


Note: email notifications are probably handy to people who use Beaker occasionally but we don't need them for active day-to-day usage.

Comment 1 Amit Saha 2014-09-03 12:52:23 UTC
(In reply to Alexander Todorov from comment #0)
> Description of problem:
> 
> There is no way for the user to configure email preferences in Beaker. At
> the moment I think there are at least 2 different notifications:
> 
> 1) When a reserved system is ready for use
> 2) When a test job completes
> 
> 
> I'm currently filtering these out of my inbox (and maybe others depending on
> what my email filters catch) so it's clear I don't like to receive them. 
> 
> 
> Note: email notifications are probably handy to people who use Beaker
> occasionally but we don't need them for active day-to-day usage.

I can't understand the rationale for this request. Why wouldn't you want to know whether your job has completed - passed/failed/aborted? Similarly, if you reserve a system, why wouldn't you want to know when your system has been reserved?

Comment 2 Alexander Todorov 2014-09-04 07:21:38 UTC
Because I work with hundreds of jobs per day and I'm constantly monitoring them via the webUI. This is what QE does everyday. Switching back and forth to check my email isn't handy in this scenario.

Comment 3 Jeff Burke 2015-06-03 19:14:09 UTC
Hi Alexander,
 The first one "1) When a reserved system is ready for use" comes from the task it's self. runtest.sh for reservesys has function called NOTIFY.

<snip>
NOTIFY()
{
    /sbin/service sendmail start
    local msg=$(mktemp)

cat > $msg <<-EOF
To: $SUBMITTER
Subject: [Beaker Machine Reserved] $HOSTNAME
X-Beaker-test: $TEST

EOF
    cat /etc/motd >>$msg
    cat $msg | sendmail -t
    \rm -f $msg
}
</snip>

Perhaps providing a patch to skip it when you pass is and argument. Add in something like the snippet below to the NOTIFY function.

if [ -n "$NOMAIL" ]; then
    return 0
fi

Then when you run your tests add this:
	<task name="/distribution/reservesys" role="STANDALONE">
		<params>
			<param name="NOMAIL" value="TRUE"/>
		</params>
	</task>

Something like that.

Regards,
Jeff

Comment 4 Alexander Todorov 2015-06-05 09:35:07 UTC
Hi Jeff,
a parameter is acceptable, but it needs to be documented I guess, b/c it will not work if you schedule a system reservation straight from the webUI.

Comment 5 Dan Callaghan 2016-03-30 23:02:26 UTC
We can add a tab to the new Preferences page to allow opting out of each of the notification types that Beaker sends. I guess just a checkbox for each notification type.

There are definitely lots of possible scenarios where people don't need or want to receive the notifications. For example automated job submission scripts which monitor the jobs in some other way.

Implementing this became a lot easier since we ported the Preferences page from TG to Backbone in Beaker 23.

Comment 6 Dan Callaghan 2016-03-30 23:07:36 UTC
The notification types currently in Beaker are:

* job completion
* system loan request
* system problem report
* system automatically marked broken
* group membership addition/removal
* <reservesys/> ready
* usage reminder

We probably don't want to let people opt out of system loan requests and system problem reports, because if they did that then the requests would just disappear -- there is nowhere else for them to go.

It would be unwise for someone to opt out of the "automatically marked broken" notifications but I guess we could allow it anyway, because it's up to them to keep track of the systems they own.

I'm not sure if Beaker should let people opt out of the usage reminders. Those are admin-controlled and they are intentionally designed to be both helpful to the user, but also a nudge reminding them not to hog hardware.

The rest certainly makes sense for people to want to opt out of.

There is also the mail sent by /distribution/reservesys which is not controlled by Beaker directly, as Jeff notes in comment 3. Adding a task parameter to make it skip sending mail seems like the best solution there.

Comment 7 Blake McIvor 2016-09-28 02:22:33 UTC
https://gerrit.beaker-project.org/#/c/5272/

Comment 10 Dan Callaghan 2017-02-21 18:49:22 UTC
Beaker 24.0 has been released.