You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The results after calling slackUserIdsFromCommitters() should return a list, I shouldn't have to resolve the changeSets myself and call this.
Actual Results
slackUserIdsFromCommitters() seems to always return an empty list. No log messages are seen when I comment out the section from currentBuild.changeSets and down. However, I am getting a authorization token missing log-message if I enable the code. This indicates that the problem isn't in calling the functions that tries to reach out to the slack servers, but before that.
I suspect that the way I configured my project, as a pipeline project and that I skip the default checkout is causing this issue. The following code seems suspect to me SlackUserIdResolver.java:
I know for a fact that the changeSets isn't empty when I trigger a build where I'd expect there to be a list of changes here. Not entirely sure how I can make this work.
Anything else?
No response
The text was updated successfully, but these errors were encountered:
With some more tweaks to the above code, I was able to create a EmailSlackUserIdResolver with appropriate HttpClient and Autorization tokens, the rest api to slack works and the user ids was resolved.
Try pasting in the following into your Jenkins pipeline script to see if fixes it
// Until slack-plugin fixes the slackUserIdsFromCommitters() function, see: https://github.com/jenkinsci/slack-plugin/issues/930// this does require a few approvals in the script sandbox.@NonCPSdefgetSlackUsers(changesets) {
def resolver =newjenkins.plugins.slack.user.EmailSlackUserIdResolver(
"${env.BOT_CRED_PSW}",
jenkins.plugins.slack.HttpClient.getCloseableHttpClient(null))
resolver.setMailAddressResolvers(hudson.tasks.MailAddressResolver.all())
return resolver.resolveUserIdsForChangeLogSets(currentBuild.getChangeSets()).toSet().collect { "<@$it>" }.join(', ')
}
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Ubuntu Linux 22.04 for all systems involved
Reproduction steps
Expected Results
The results after calling
slackUserIdsFromCommitters()
should return a list, I shouldn't have to resolve the changeSets myself and call this.Actual Results
slackUserIdsFromCommitters() seems to always return an empty list. No log messages are seen when I comment out the section from currentBuild.changeSets and down. However, I am getting a authorization token missing log-message if I enable the code. This indicates that the problem isn't in calling the functions that tries to reach out to the slack servers, but before that.
I suspect that the way I configured my project, as a pipeline project and that I skip the default checkout is causing this issue. The following code seems suspect to me SlackUserIdResolver.java:
I know for a fact that the changeSets isn't empty when I trigger a build where I'd expect there to be a list of changes here. Not entirely sure how I can make this work.
Anything else?
No response
The text was updated successfully, but these errors were encountered: