Jenkins CI integration uses previous values for form validation and test
Summary
The form validation and settings test for the Jenkins CI integration uses the previous form values, not the newly-entered values.
This popped up because previously, in the Jenkins CI integration we could leave the username and password fields blank. Now the password field shows a "This field is required." message. Existing integrations still work as they used to, but if we try to change the settings, this error message shows up. I'm not sure if that was an intended change since I don't see anything in the changelog?
What is the current bug behavior?
I started with a project that had the integration set up with a blank username/password. After trying different things to get the settings to save correctly, I was able to get some stable behavior:
- Enter valid username "jdawson" and valid password. => Error banner:
Test failed. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Error 401 Invalid password/token for user: asdf</title> </head> <body><h2>HTTP ERROR 401</h2> <p>Problem accessing /project/pipeline--pipeline-dummy-webapp. Reason: <pre> Invalid password/token for user: asdf</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/> </body> </html>
Note that the username in the error message is "asdf", something I had entered previously, even though I entered "jdawson" in the form.
-
Click "Save anyway".
-
Go back into Jenkins CI settings. Enter the same valid password. => Success.
-
Go back into Jenkins CI settings. Enter a fake username/password (e.g. "asdf"/"asdf"). => Success. (this actually triggers the job in Jenkins!)
Other remarks:
- To come back to the issue of "empty user/pass doesn't work anymore", even that usually works if the previous login I submitted was valid. Weird since this normally would fail at the form validation step, not at the webhook test step.
- To edit the form after an error occurred, I have to leave the page and return. Entering new values and trying to save again has no effect.
- When I was testing things out with changing other field values, I was also able to get error messages showing the previous value of the Jenkins URL or of the Project name. These fields can mostly be changed with no problems though. I'm not sure why sometimes it works and sometimes it doesn't.
Gitlab environment info
We just upgraded to version 9.4.6 (from version 9.2.9). Nothing was changed in our Jenkins installation before and after the Gitlab upgrade.