Closed Dahlgren closed 7 years ago
Tell me why exactly you've made every field of the webhook editable? I'm confused. It also doesn't support the current features like disabling linking, enabling artifact lists etc...
Pipeline steps are different from the usual Notifier plugins that are accessible post build. The discordSend
can be invoked anytime during the build and multiple times.
Only webhookURL must be set, the rest is optional and can be omitted.
By allowing the Pipeline script to define the texts sent to Discord it's possible to send different messages for different stages in the pipeline. We use this to send notifications for each failing parallel build in our matrix pipeline. Once all parallel builds are completed we can also send a final notification for the entire pipeline in the post steps such as in the example in the dscription.
Some reasons for not using the other perform method,
getChangeSet()
might not be available, it's only present for some subclasses.By having this more open allows for more flexibility in pipeline usage. Most notification plugins such as slack works the same, see the example in it's repo https://github.com/jenkinsci/slack-plugin
I'm open for making changes in the PR, it doesn't have to be this way :)
Apart from those little things, if you could add a section in the README that explains how to use it that'd be great. I'll merge afterwards.
I'll add some README documentation about how to use in Pipeline builds
Please check if you want any further changes 😃
Thanks for the addition.