dancryer / PHPCI

PHPCI is a free and open source continuous integration tool specifically designed for PHP.
BSD 2-Clause "Simplified" License
2.42k stars 439 forks source link

Format of email is not useful #214

Closed roylindauer closed 10 years ago

roylindauer commented 10 years ago

The format of the email I get when a build fails is totally not useful. How can I change the output format for emails? Getting the raw data from the plugins would be ideal. As it is now I simply cannot parse out what is actually failing and what needs to be fixed.

screen shot 2013-11-21 at 11 03 04 am

Relevant portion of phpci.yml:

build_settings:
    verbose: false
complete:
    email: 
            addresses: 
                    - "my@company.com"
roylindauer commented 10 years ago

When running the build manually I see the raw output, which is exactly what I need:

FILE: /Users/me/Sites/phpci/build/project1-build4/api.php
--------------------------------------------------------------------------------
FOUND 11 ERROR(S) AND 1 WARNING(S) AFFECTING 9 LINE(S)
--------------------------------------------------------------------------------
 21 | ERROR   | @category tag comment indented incorrectly; expected 2 spaces
    |         | but found 4
 22 | ERROR   | @package tag comment indented incorrectly; expected 3 spaces
    |         | but found 5
 23 | ERROR   | @copyright tag must contain a year and the name of the
    |         | copyright holder
 23 | ERROR   | @copyright tag comment indented incorrectly; expected 1 spaces
    |         | but found 3
 24 | ERROR   | @license tag comment indented incorrectly; expected 3 spaces
    |         | but found 5
 25 | WARNING | PHP version not specified
 25 | ERROR   | Missing @author tag in file comment
 25 | ERROR   | Missing @link tag in file comment
 47 | ERROR   | TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
    |         | found "true"
 53 | ERROR   | TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
    |         | found "true"
 54 | ERROR   | TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
    |         | found "false"
 74 | ERROR   | TRUE, FALSE and NULL must be uppercase; expected "NULL" but
    |         | found "null"
--------------------------------------------------------------------------------
meadsteve commented 10 years ago

That is a bit ugly you're right. At the moment the body of the email is generated in the plugin's exectute method by:

    $logText = $this->build->getLog();
    sprintf("Log Output: <br><pre>%s</pre>", $logText)

which isn't very nice to read. Shouldn't be too hard to swap this out for the code that prints the nicer formatted version. After that we'd probably want to start doing work on making what gets sent a bit more configurable.

meadsteve commented 10 years ago

some of the junk in the email though looks like it was fixed by #206

roylindauer commented 10 years ago

It does indeed. Thanks.

This is much easier to parse. Going to close this issue now.