kuleuven / jenkins-mattermost-plugin

Jenkins plugin for Mattermost
MIT License
24 stars 46 forks source link

Cannot update Jenkins config.xml via POST #37

Open jperkin opened 4 years ago

jperkin commented 4 years ago

Hi!

Thanks for this plugin. It works great for me, except that I manage my Jenkins job configurations by POSTing config.xml for each job that I have configured. This allows me to easily manage many jobs and update them with new settings, however something in this plugin does not like this procedure.

If I configure the post-build action via the web interface it works fine, but as soon as I POST config.xml it disappears, even if I use exactly the same config.xml that I retrieve from the job (using the encrypted endpoint value).

It appears to be something to do with the encryption used for the endpoint. I tried configuring the endpoint as a global setting and leaving the <endpoint> value blank, as well as removing it entirely, but whatever I do, as soon as config.xml is POSTed, the whole mattermost post-build action disappears.

I normally update config.xml using curl, and so tried using jenkins-cli.jar instead to see if that made any difference, but no change.

The only thing relevant that I can see in the log is this:

Nov 01, 2019 10:41:07 AM WARNING hudson.util.Secret toString
Use of toString() on hudson.util.Secret from hudson.util.Secret$1.convert(Secret.java:306). Prefer getPlainText() or getEncryptedValue() depending your needs. see https://jenkins.io/redirect/hudson.util.Secret/

Let me know if you need any further information.

Thanks.

jovandeginste commented 4 years ago

Did you use this before the update to encrypted endpoint, and if so, did it work then?

jperkin commented 4 years ago

No, sorry, I've only just started using this plugin.

jovandeginste commented 4 years ago

Could you provide me with a minimal, trivial, anonymized example? I'm no longer using per-job configs myself (all-in on Jenkinsfiles), so having an example to start from might help. Also, you could try to downgrade the plugin (manually probably) to the previous version, which does not use secret endpoints yet. Just to be sure it's related to those changes.