jenkinsci / google-chat-notification-plugin

Google Chat Notification Jenkins Plugin to send build status
https://plugins.jenkins.io/google-chat-notification/
MIT License
39 stars 20 forks source link

Please add support for threading #6

Closed gokeefe closed 6 years ago

gokeefe commented 6 years ago

Google Chat API supports a thread_key so that each notification doesn't appear as a new thread.

https://developers.google.com/hangouts/chat/how-tos/bots-develop#thread_key

Might be as simple as passing the BUILD_TAG variable as the thread_key?

chiragnaik commented 6 years ago

Okay, I will think over all use cases and take it up in next release.

chiragnaik commented 6 years ago

Format of BUILD_TAG is String of "jenkins-${JOB_NAME}-${BUILD_NUMBER}". All forward slashes ("/") in the JOB_NAME are replaced with dashes ("-"). This will anyway create new thread for each notification as BUILD_NUMBER is going to be different each time.

Instead, JOB_NAME which is a String of "Name of the project of this build, such as foo or foo/bar. will help to group related notifications in one thread. Going ahead with implementing threadKey=${JOB_NAME}

chris-orchard commented 6 years ago

I think this is a great idea. Grouping by JOB_NAME would make the status of different Jenkins jobs in chat much clearer.

chiragnaik commented 6 years ago

This is released in latest 1.3 release

chris-orchard commented 6 years ago

This feature errors when the job name has spaces. See #9 for full details.