Ticket #175 (closed task: fixed)

Opened 4 years ago

Last modified 3 years ago

support for custom MailNotifier messages

Reported by: bhearsum Owned by:
Priority: minor Milestone: undecided
Version: 0.7.6 Keywords: review
Cc: warner, dustin

Description

I'm thinking this can be implemented as an optional function to pass to MailNotifier?, that would be like buildMessage -- but only deal with formatting (no deferred objects).

Attachments

customMailNotifier-v2.diff Download (5.5 KB) - added by bhearsum 4 years ago.
mail notifier custom messages without Deferred support.

Change History

comment:1 Changed 4 years ago by bhearsum

  • Owner set to bhearsum
  • component changed from other to statusplugins

comment:2 Changed 4 years ago by bhearsum

  • Status changed from new to assigned

comment:3 Changed 4 years ago by bhearsum

My preferred method is to enhance the MailNotifier? to take a message generator function. It's signature would look something like this (with perhaps another argument): def generateMessage(IBuildStatus)

comment:4 Changed 4 years ago by bhearsum

  • Cc warner added

Hey Brian, I'm planning to do this soon -- does my previous comment seem like a decent impl?

comment:5 Changed 4 years ago by warner

yeah, a function that take an IBuildStatus and produces a string would be fine. Doublecheck that the methods you want to call on IBuildStatus all return synchronously.. if any of them return a Deferred, then your new function will need to return a Deferred too.

Also, having the message-maker function return a Deferred is easy to handle, so you might as well define it to do so. If you like, write it synchronously and I'll update it to handle a Deferred once you're done with it.

Changed 4 years ago by bhearsum

mail notifier custom messages without Deferred support.

comment:6 Changed 4 years ago by bhearsum

It turns out that more than just IBuildStatus was useful/important in the generator, but it's still the same basic idea.

I changed "Logs are attached" to "P.S. Logs are attached" (applied after the generator function is called) to avoid the need to pass in addLogs. If someone feels it belongs in the generator though, I won't put up a stink about it.

comment:7 Changed 3 years ago by extremoburo

  • Priority changed from major to minor
  • Type changed from enhancement to task
  • component changed from statusplugins to other

wouldn't be enough to create a function addText() (something like addLog()) that prepend some custom text to the body of the message in buildstep.py? I think this feature would be very useful.

comment:8 Changed 3 years ago by bhearsum

  • Cc dustin added
  • Keywords review added
  • Status changed from assigned to new
  • Owner bhearsum deleted

Looks like this would be solved by  http://github.com/jgraff/buildbot/commit/28b77b98aec06d7816721e368ea58a5954d2f35d. Dustin, is this going to get merged to the master branch?

comment:9 Changed 3 years ago by dustin

Yeah, loks like it. That commit has been merged.

comment:10 Changed 3 years ago by bhearsum

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.