From 0035543c17c070077ec4c62174e5c6f8024c8a6b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 19 May 2017 20:45:41 +0300 Subject: Add force flag to build notification email --- mod/mod-build-result.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/mod-build-result.cxx b/mod/mod-build-result.cxx index f2b4ffd..ae6c5b1 100644 --- a/mod/mod-build-result.cxx +++ b/mod/mod-build-result.cxx @@ -231,6 +231,7 @@ handle (request& rq, response&) shared_ptr b; optional prev_status; bool notify (false); + bool unforced (true); { transaction t (build_db_->begin ()); @@ -244,12 +245,13 @@ handle (request& rq, response&) warn_expired ("non-matching timestamp"); else { + unforced = b->force == force_state::unforced; + // Don's send email for the success-to-success status change, unless the // build was forced. // notify = !(rqm.result.status == result_status::success && - b->status && *b->status == rqm.result.status && - b->force == force_state::unforced); + b->status && *b->status == rqm.result.status && unforced); prev_status = move (b->status); @@ -283,7 +285,8 @@ handle (request& rq, response&) // try { - string subj (to_string (*b->status) + ": " + b->package_name + '/' + + string subj ((unforced ? "build " : "rebuild ") + + to_string (*b->status) + ": " + b->package_name + '/' + b->package_version.string () + '/' + b->configuration + '/' + b->toolchain_name + '-' + b->toolchain_version.string ()); -- cgit v1.1