Question

I want to set up ccnet to:

  1. Send mail to committers after each build (regardless of the status)
  2. Send mail to all other developers when the build breaks or is fixed

With every new version of CCNet the email publisher gets refactored (and supposedly improved), but I still have the same problem: only the committers get notified - if the build breaks, other developers don't get the email message. So either I don't get the system, or there is a long-unfixed bug in the email publisher.

I'm using the v1.4.4.83. My example configuration (I removed the irrelevant stuff):

<email 
    includeDetails="true">
    <users>
        <user name="user1" address="user1@mail.com" group="developers" /> 
        <user name="user2" address="user2@mail.com" group="developers" /> 
    </users>
    <groups>
            <group name="developers">
                <notifications>
                    <notificationType>Failed</notificationType>
                    <notificationType>Fixed</notificationType>
                </notifications>
            </group>
    </groups>
    <modifierNotificationTypes>
        <NotificationType>Always</NotificationType>
    </modifierNotificationTypes>
</email>            
Was it helpful?

Solution

I believe that this does what you want (admittedly, a year after your question).

NB: We use SVN, with a <svn> block. In CC.NET 1.4.xx, <email> blocks support regular expressions to work out email addresses from SVN usernames. It should work with other source control blocks, but I haven't used anything but SVN.

We have something like the following in our <publishers> block (I've modified it to match your spec):

<email ... includeDetails="true">
  <!-- Developers get an email whenever the build status changes -->
  <users>
    <user name="Dev1" group="developer" address="dev1@ourcompany.com" />
    <user name="Dev2" group="developer" address="dev2@ourcompany.com" />
  </users>
  <groups>
    <group name="developer" notification="change" />
  </groups>

  <!-- Committers get an email for every build they commit code for -->
  <converters>
    <regexConverter find="$" replace="@ourcompany.com" />
  </converters>
  <modifierNotificationTypes>
    <NotificationType>always</NotificationType>
  </modifierNotificationTypes>
</email>

So, dev1@ourcompany.com and dev2@ourcompany.com will get an email whenever the build status changes, and [svnuser]@ourcompany.com will get an email when the build they've committed code for finishes building.

NB: if the build fails, svn users who have committed code since it last succeeded will continue to get further emails each time a build finishes until the build is fixed.

OTHER TIPS

I think this does what you want... we're running version 1.4.3 so YMMV. Devs get emails only when there is a change in fixed/failed status, while the PM gets an email every time there's a build.

<groups>
   <group name="Always">
        <name>Always</name>
        <notification>Always</notification>
    </group>
    <group name="developers">
        <name>developers</name>
        <notification>Change</notification>
    </group>
</groups>
<users>
    <user name="dev1">
        <address>...</address>
        <group>developers</group>
        <name>...</name>
    </user>
    <user name="pm1">
        <address>...</address>
        <group>Always</group>
        <name>...</name>
    </user>
    <user name="dev2">
        <address>...</address>
        <group>developers</group>
        <name>...</name>
    </user>
    <user name="dev3">
        <address>...</address>
        <group>developers</group>
        <name>...</name>
    </user>
</users>
<email from="CruiseControlBuild@xxxxxxxx.com" mailhost="xxxxxxxx.com" includeDetails="True">
            <users>
                <user name="Dev Staff" group="group1" address="xxxxxxxxxxx"/>
                <user name="QA Staff" group="group1" address="xxxxxxxxxxx"/>
            </users>
            <groups>
                <group name="group1" notification="always"/>
            </groups>
            <modifierNotificationTypes>
                <NotificationType>Always</NotificationType>
            </modifierNotificationTypes>
        </email>

This works, but be careful. Sending every developer an email for every build in a continuous system is begging to have your emails ignored. The only email I send to everyone is the nightly installer build.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top