KocproZ / jenkins-discord

A post-build plugin that sends the build status to a Discord channel.
MIT License
39 stars 36 forks source link

Confusing 'unstable' parameter #37

Closed HLXEasy closed 5 years ago

HLXEasy commented 6 years ago

Hi,

haven't tested explicitly right now but following the docu, this is very confusing:

unstable
    True makes the left-hand side of the embed green (Only when successful: true).

If a build is unstable (unstable == true), it must not be green but yellow!

HLXEasy commented 6 years ago

OK, tested it to be sure and it seems to be just a c&p error on the documentation. Settings unstable to true makes the notification bar yellow. :-)

KocproZ commented 6 years ago

I wanted to make this something like status: "UNSTABLE", but that would break compatibility and force people to edit their Jenkinsfiles, so I kept successful and added unstable boolean. So for this to work i added following rules: success: false equals to build status FAILURE, unstable is ommited success: true, unstable: true equals to build status UNSTABLE, success: true, unstable: false equals to build status SUCCESS

Now I see it might be confusing to use and I am open to suggestions. (Would something like optional value status: "UNSTABLE/SUCCESS/FAILURE/ABORTED?" be better?)

lf-jeremy commented 6 years ago

An enum of named status values like UNSTABLE|SUCCESS|FAILURE|ABORTED is much more explicit (and more flexible) than a boolean success with a modifier flag. Besides the addition of ABORTED, It also adds the possibility for a PAUSED value.

KocproZ commented 6 years ago

OK, If someone wants to test this here is a version of the plugin with result enum that takes 4 values: SUCCESS|UNSTABLE|FAILURE|ABORTED (successful and unstable still work, but result overwrites them). I can add different values, but I don't know it they are needed.

HLXEasy commented 5 years ago

Works like a charm! Time for a new release. 💯