phabricator-jenkins-plugin icon indicating copy to clipboard operation
phabricator-jenkins-plugin copied to clipboard

Allow disabling comment?

Open joshma opened this issue 7 years ago • 10 comments

Now that Harbormaster leaves a notice / emails when the build fails, would it be possible to support disabling comments entirely? We currently get a bunch of noise on each failed build since Harbormaster sends an email, and we have 12 different Jenkins builds in parallel that might all error (if e.g. there's a syntax error).

Here's what Harbormaster says: image

joshma avatar Mar 21 '17 21:03 joshma

Have you unchecked the "comment with console link on failure" configuration option?

https://github.com/uber/phabricator-jenkins-plugin/blob/master/docs/configure-job-post-build.png

ascandella avatar Mar 21 '17 21:03 ascandella

Yeah, I did. I believe that only leaves out the link to the console, but it still sends a comment?

https://github.com/uber/phabricator-jenkins-plugin/blob/5a3c257bdc32c852def0341affcb7bcac1230908/src/main/java/com/uber/jenkins/phabricator/BuildResultProcessor.java#L181

joshma avatar Mar 22 '17 05:03 joshma

I could try to send a PR, but I haven't written Java in years haha. Seems like you'd have to:

  • Add another form checkbox to "disable all comments"
  • In PhabricatorNotifier.perform, skip calls to processRemoteComment / sendComment if this flag is set (https://github.com/uber/phabricator-jenkins-plugin/blob/c97159e0002d00890116ac0155c09f0972a7a466/src/main/java/com/uber/jenkins/phabricator/PhabricatorNotifier.java#L253)

I verified just now that, even without "comment with console link on failure" it still comments something like "Build was aborted https://jenkins.domain/job/project/build/ for more details."

joshma avatar Mar 22 '17 05:03 joshma

Aborted is different than failed. Last I checked (and the whole reason I added that checkbox option in the first place) was for this exact scenario -- if you'd like to disable "failed build" comments, check the box. Do you have an example of a build that is sending a comment for a failed (not aborted) build with this option configured properly?

ascandella avatar Mar 22 '17 16:03 ascandella

Hm, well unstable builds comment as well:

Build is unstable https://jenkins.domain/job/build/78251/ for more details.

Maybe the issue then is that it comments for unstable builds? Checking a few failed builds, I indeed don't see the comment.

joshma avatar Mar 23 '17 07:03 joshma

Yes, agreed that "unstable" is treated differently than "failed" and that the failed build checkbox option partially solves your problem. The question now is whether we want to add an option to configure "aborted" builds or just treat "aborted" the same as "failed" and let harbormaster send the emails. For simplicity's sake I'd probably lean towards the latter solution (if you have disabled failed build comments, we will also disable aborted build comments).

Thoughts?

ascandella avatar Mar 23 '17 20:03 ascandella

Agreed that you'd probably want aborted to be disabled along with failed (although it'd be nice for the label in the UI to be updated to reflect this).

I'd personally be fine with having one checkbox for all comments - if someone wants a comment on UNSTABLE, it seems like they'd want a comment on FAILED as well. I don't see any use cases where you want one but not the other, but that might just be my limited imagination.

joshma avatar Mar 23 '17 20:03 joshma

When you say "the UI to be updated to reflect this", you mean have harbormaster say something other than "failed"? Is that possible with the new harbormaster APIs, e.g. something we could change on our end, or is it still just pass/fail?

ascandella avatar Mar 23 '17 21:03 ascandella

Oops I just mean that, in the Jenkins config UI, the label next to the checkbox should just be updated to indicate whatever behavior is changed.

Right now it's "Comment with console link on Failure", although it might make the most sense to have another option to disable comments entirely.

joshma avatar Mar 23 '17 21:03 joshma

Ah, yea, that would be good to update. We can start small and figure out the larger comment story later. On Thu, Mar 23, 2017 at 2:22 PM Joshua Ma [email protected] wrote:

Oops I just mean that, in the Jenkins config UI, the label next to the checkbox should just be updated to indicate whatever behavior is changed.

Right now it's "Comment with console link on Failure", although it might make the most sense to have another option to disable comments entirely.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/uber/phabricator-jenkins-plugin/issues/209#issuecomment-288864119, or mute the thread https://github.com/notifications/unsubscribe-auth/AAF7P6-XekKQiF4IyxKdmT6lCr1ntghcks5rouKBgaJpZM4Mkadj .

ascandella avatar Mar 23 '17 21:03 ascandella