Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Fixed
-
Component/s: mattermost-plugin
-
Labels:None
-
Environment:Jenkins 2.144
Plugin: mattermost: 2.5.2
Mattermost: 5.3.1
-
Similar Issues:
Description
Problem
Job status notifications sent to Jenkins have the following link back url:
http://nulljob/test-mattermost/8/
While "Test" button notifications (from Global Configuration or from Job Config) have the correct Jenkins base URL:
Mattermost/Jenkins plugin: you're all set! (parameters: endpoint='https://MATTERMOST/hooks/xxxxxxxxxxxx', room='test', icon='', buildServerUrl='http://JENKINS:8080/')
Configuration
My global configuration has a Jenkins URL correctly set.
I've tried both setting and not setting the Build Server URL in the Mattermost config section (to the same value), same result.
It doesn't matter if I specify the mattermost endpoint URL/channel in the job or in global, or both.
Jenkins log:
Oct 12, 2018 9:34:21 AM INFO jenkins.plugins.mattermost.MattermostNotifier prebuild Invoking Started... Oct 12, 2018 9:34:21 AM INFO jenkins.plugins.mattermost.StandardMattermostService publish Posting: to test@https://MATTERMOST/hooks/xxxxxx: test-mattermost - #9 Started by user XXXX [Open](nulljob/test-mattermost/9/) (good) Oct 12, 2018 9:34:21 AM INFO jenkins.plugins.mattermost.StandardMattermostService publish Posting succeeded
After glancing at the code I determined that builds started by SCM polling notify with correct build URL (both in start and completed notification).
The problem only affects manually triggered builds.
It gets worse:
Once the job has had SCM/polling configuration and successfully notified Mattermost, it will continue to work correctly even after removing SCM/polling configuration. In other words, problem only exists for new jobs that were created without SCM info.