Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-19295

Option to send email when the # of jslint/pylint warnings increase

    • Icon: Improvement Improvement
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • warnings-plugin
    • None
    • Virtualized Ubuntu Server 12.04 host

      When the number of lint warnings increase for a build, our team would like to send out a notification to the team. In our model, there should never be new issues as these tools are supposed to be run prior to committing changes to the repository. We want the user's name in lights if they don't follow protocol.

      For pylint, I do this by parsing the pylint.xml output file, but since we use a jslint plugin for the actual jslint run, I have no way to do this. Besides, I'd rather have one way of doing this no matter what lint or warnings are being processed. For consistency, I thought it would just be great if the warnings plugin could provide an option to email out for increases in the number of lint issues. That's what we'd prefer, but someone else might make the case that email only goes out if the last build was unstable (i.e. we reached a certain number of lint issues at a specific severity).

          [JENKINS-19295] Option to send email when the # of jslint/pylint warnings increase

          Ulli Hafner added a comment -

          This is already possible using a trigger in the email-ext plugin.

          I would like to keep the warnings plugin as simple as Jenkins core: i.e. I provide only the model if warning limits are exceeded. The actual implementation of the notifications should be done by different plugins (email-ext, im, etc.).

          BTW: pylint is also supported by ther warnings plugin.

          Ulli Hafner added a comment - This is already possible using a trigger in the email-ext plugin. I would like to keep the warnings plugin as simple as Jenkins core: i.e. I provide only the model if warning limits are exceeded. The actual implementation of the notifications should be done by different plugins (email-ext, im, etc.). BTW: pylint is also supported by ther warnings plugin.

          Shannon Kerr added a comment -

          Thanks Ulli. I saw that I could send an email for a roll-up of pylint/jslint, but we only wanted to get it when there was a net gain of issues, and I don't think that trigger is possible. They don't want to get so many emails and want to keep it to just increases in lint messages.

          Yes, I know warnings support pylint. We LOVE that. I'm probably also going to use it for FlexeLint at some point. I see you have support for PC-Lint, but I didn't see support for FlexeLint. Maybe you count them as the same? I'll see if I can figure out what format you want the output in in order to be supported by the warnings plugin.

          Thank you!

          Shannon Kerr added a comment - Thanks Ulli. I saw that I could send an email for a roll-up of pylint/jslint, but we only wanted to get it when there was a net gain of issues, and I don't think that trigger is possible. They don't want to get so many emails and want to keep it to just increases in lint messages. Yes, I know warnings support pylint. We LOVE that. I'm probably also going to use it for FlexeLint at some point. I see you have support for PC-Lint, but I didn't see support for FlexeLint. Maybe you count them as the same? I'll see if I can figure out what format you want the output in in order to be supported by the warnings plugin. Thank you!

          Ulli Hafner added a comment -

          I think such a trigger is possible using the API. I'm counting the number of new warnings (with respect to a reference build) and if that number is not 0 then you can send that mail. I think someone on the mailing list tried this approach already. (I did not try it on myself yet but with the email-ext plugin you can navigate the object graph of my plugin. Maybe you can ask on themailing list if someone already has a template for that...)

          If it is not yet possible I would like to help to improve the API so that this use case will be possible.

          Writing parsers is quite easy, so it should be possible for FlexeLint, too.

          Ulli Hafner added a comment - I think such a trigger is possible using the API. I'm counting the number of new warnings (with respect to a reference build) and if that number is not 0 then you can send that mail. I think someone on the mailing list tried this approach already. (I did not try it on myself yet but with the email-ext plugin you can navigate the object graph of my plugin. Maybe you can ask on themailing list if someone already has a template for that...) If it is not yet possible I would like to help to improve the API so that this use case will be possible. Writing parsers is quite easy, so it should be possible for FlexeLint, too.

          Shannon Kerr added a comment -

          Thanks Ulli. I was out for a bit with sick kids. I'll see what I can do using the API and let you know if I have any questions.

          Side question, can you confirm that if I have a dashboard View that has jobs for PyLint and JSLint that the trend graph will not work because there are two kinds of lint issues? I could only get it to work if I only had JSLint or PyLint, but not both. If there is a reason, maybe you can share with me, otherwise I can raise a ticket to get this fixed. It seems most (if not all) graphs do not work when I have multiple types of issues. It'd be great to have trend graph for a specific warning/lint type similar to the way the charts do it (let you pick your parser).

          Shannon Kerr added a comment - Thanks Ulli. I was out for a bit with sick kids. I'll see what I can do using the API and let you know if I have any questions. Side question, can you confirm that if I have a dashboard View that has jobs for PyLint and JSLint that the trend graph will not work because there are two kinds of lint issues? I could only get it to work if I only had JSLint or PyLint, but not both. If there is a reason, maybe you can share with me, otherwise I can raise a ticket to get this fixed. It seems most (if not all) graphs do not work when I have multiple types of issues. It'd be great to have trend graph for a specific warning/lint type similar to the way the charts do it (let you pick your parser).

          Ulli Hafner added a comment -

          The graphs should show the warnings for each parser. If this is not working, then there is a bug. Can you please file a new issue? And please add some more details (or screenshots) which graph is broken and what actually is expected.

          Ulli Hafner added a comment - The graphs should show the warnings for each parser. If this is not working, then there is a bug. Can you please file a new issue? And please add some more details (or screenshots) which graph is broken and what actually is expected.

          Shannon Kerr added a comment -

          Ulli, I raised this ticket for the issue: JENKINS-19425 Thank you!

          Shannon Kerr added a comment - Ulli, I raised this ticket for the issue: JENKINS-19425 Thank you!

          Ulli Hafner added a comment -

          Please reopen if there is something missing to get the email trigger in email-ext done. (And if you get a working solution it would be nice if you could share that information, e.g., in the wiki)

          Ulli Hafner added a comment - Please reopen if there is something missing to get the email trigger in email-ext done. (And if you get a working solution it would be nice if you could share that information, e.g., in the wiki)

          Shannon Kerr added a comment -

          Will do. Thank you Ulli.

          Shannon Kerr added a comment - Will do. Thank you Ulli.

            drulli Ulli Hafner
            kerrhome Shannon Kerr
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: