Central repository email requires post_commit_push_pull enabled

Bug #307988 reported by Trevor Jim
4
Affects Status Importance Assigned to Milestone
bzr email commit hook
Triaged
Wishlist
Unassigned

Bug Description

I use a central repository model. On bzr commit I want email sent to a mailing list. However, I want the central repository to send the email, and not the person who is doing the commit. The reason is: I don't want developers to have to configure their machine/bzr install to send mail.

It looks to me like this is not how bzr-email works; consider this a feature request.

Thanks,
Trevor

Tags: doc
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 307988] [NEW] Central repository email?

On Sun, 2008-12-14 at 23:01 +0000, Trevor Jim wrote:
> Public bug reported:
>
> I use a central repository model. On bzr commit I want email sent to a
> mailing list. However, I want the central repository to send the email,
> and not the person who is doing the commit. The reason is: I don't want
> developers to have to configure their machine/bzr install to send mail.
>
> It looks to me like this is not how bzr-email works; consider this a
> feature request.

bzr-email supports this just fine; install it on the server, set up your
branch.conf appropriately, and be sure to use bzr+ssh for your clients
so the hooks get invoked on the server.

 status invalid
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Changed in bzr-email:
status: New → Invalid
Revision history for this message
Trevor Jim (trevor-research) wrote :

> bzr-email supports this just fine; install it on the server, set up your
> branch.conf appropriately, and be sure to use bzr+ssh for your clients
> so the hooks get invoked on the server.

Thanks. I have been using sftp --- I guess this only works for
bzr+ssh? If so, I suggest adding it to the README or bzr help email,
I don't see it there.

-Trevor

Revision history for this message
Trevor Jim (trevor-research) wrote :

I'm getting the same behavior with bzr+ssh so I guess it is
another problem, probably with my configuration... I've
tried --verbose and it is not giving any more details, are there
better ways to debug?

The error after commit is:

bzr: ERROR: mail is not installed !?

The branch.conf on the central server is

post_commit_to = <email address hidden>
post_commit_mailer = /bin/mail
post_commit_difflimit = 10

I've tested /bin/mail from the command line. It supports
-s but NOT -a; this is the standard mailer for CentOS.

Revision history for this message
.:. brainsik (brainsik) wrote : Re: Central repository email?

Sounds like you know what the problem is Trevor, but I wanted to put my two cents in on this bug in case someone runs into the problem I did today (which is how I found this bug):

I also use a central server model and I was able to get emails to go out from the central server today after commits via bzr+ssh. However, I had to put:

post_commit_push_pull = True

in the Bazaar conf to make it work.

We use Ubuntu Intrepid and I pulled the latest bzr-email plugin from launchpad today.

Revision history for this message
Trevor Jim (trevor-research) wrote : Re: [Bug 307988] Re: Central repository email?

brainsik wrote:
> I also use a central server model and I was able to get emails to go out
> from the central server today after commits via bzr+ssh. However, I had
> to put:
>
> post_commit_push_pull = True
>
> in the Bazaar conf to make it work.

Hi, thanks for the pointer. Unfortunately, I'm still having problems.

The server is running CentOS, the client Ubuntu Intrepid.
I am using the latest bzr-email from launchpad.

Mailer on server is /bin/mail, mailer on client is /usr/bin/mail.
These are different programs and the server mailer does not
accept the -a argument.

I modified bzr-email on the server so that it does not use -a.

If I checkout the repository from the server, ON the server,
and then do commits, I get the commit messages; so my -a hack
works when everything is run on the server (with bzr+ssh or file).

If I checkout the repository from the server on the CLIENT,
I get different behavior. If bzr-email is not installed
on the client, there is no mail and no error message when
I do a commit on the client.
If bzr-email is installed on the client, I get an error
message when I do a commit on the client. Seems like this is
because /bin/mail does not exist on the client. (I have
/bin/mail configured in the branch.conf on the server.)

The behavior is the same whether post_commit_push_pull is
set to True or not set at all in the branch.conf file on the
server.

I suppose I could hack things up to get around the different
mailers, but that would not get me to my goal:

What I was trying to do was have the server itself send the
email. I don't want the client to send the email, because I
don't want the client to have to configure things. The client
should not have to install the bzr-email plugin, for example.

Given the behavior I'm seeing I don't understand Robert's comment,

> bzr-email supports this just fine; install it on the server, set up your
> branch.conf appropriately, and be sure to use bzr+ssh for your clients
> so the hooks get invoked on the server.

Thanks for any help,
-Trevor

Revision history for this message
Morbus Iff (morbusiff) wrote : Re: Central repository email?

I spent an hour or so with the same problem. Wanted to report back on what I've found.

My situation is pretty similar: I'm running CentOS 5.2, and I'd like emailed commits to be required, so I'm looking to add them into the branch.conf on the master branch server. Since CentOS 5.2's /bin/mail does not support -a, and particularly because I need UTF-8 capability, my branch.conf started out with the following:

post_commit_to = <email address hidden>
post_commit_sender = <email address hidden>
post_commit_mailer = smtplib

I'd be using the local mail server, so I didn't specify any of smtp_ configuration values. On a client machine, I checked out the repository over bzr+ssh. I then created a file, bzr add'd, then bzr commit'd. No mail was sent out. There was nothing reported in the .bzr.log specific to the email plugin (just that it was searching through the plugin directories). "bzr version" reported 2.0.2, "bzr help email" and "bzr plugins" both asserted that the email plugin was added (which I did server wide, so "bzr checkout https://launchpad.net/bzr-email; cd bzr-email; python setup.py install").

Chatting in #bzr about this had me experiment with setting smtp_server to "localhost" and also "localhost:25". Commits from the client machine still didn't get emailed out. Finally, I found this bug report, and added:

post_commit_push_pull = True

Did another commit from the client machine (literally, a "bzr commit" - not a push, not a pull), and my emails are now being sent out. I'm tentatively setting the status of this back to "confirmed". Why? The documentation currently asserts that I SHOULD NOT need to use post_commit_push_pull to do what I want - I wouldn't consider this an "appropriate" configuration (per comment #1). But, at least in this case, it appears that it is.

Changed in bzr-email:
status: Invalid → Confirmed
Jelmer Vernooij (jelmer)
Changed in bzr-email:
status: Confirmed → Triaged
importance: Undecided → Wishlist
tags: added: doc
summary: - Central repository email?
+ Central repository email requires post_commit_push_pull enabled
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.