spinnaker: Triggering a Jenkins job with parameters replace spaces with `+`
After updating Spinnaker from 1.36.0 to 1.37.10, the calls to Jenkins jobs with parameters started being escaped differently. Special characters are escaped fine using percent-encoding, but spaces are being replaced with the plus sign + instead of %20. This break several of our jobs and we had to revert. I also tried with version 1.38.0 and it has the same issues.
It seems loosely related to https://github.com/spinnaker/spinnaker/issues/7021 and https://github.com/square/retrofit/issues/4312 (in this last one, spaces are correctly escaped to %20 though)
I’ve seen the behaviour with Jenkins 2.492.3 and 2.426.3.
It’s probably not good practice to have spaces in parameters, but it’s not always avoidable.
Thanks for any help!
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 17 (10 by maintainers)
Commits related to this issue
- fix(jenkins): fix the issue of Retrofit2EncodeCorrectionInterceptor getting added to retrofit1 client of JenkinsClient. More details on this issue: https://github.com/spinnaker/spinnaker/issues/7059 — committed to kirangodishala/igor by kirangodishala 2 years ago
- fix(jenkins): fix the issue of Retrofit2EncodeCorrectionInterceptor getting added to Jenkins retrofit1 client (#1324) * test(jenkins): add a test to demonstrate the issue of Retrofit2EncodeCorrecti... — committed to spinnaker/igor by kirangodishala 2 years ago
I am able to reproduce the issue. Working on the fix.
Finally, I am able to reproduce the issue after setting up jenkins. And yes, I noticed direct jenkins api call
<baseurl>/job/myjob/buildWithParameters?extra=xyz abcd klmdecoded the parameter asxyz abcd klmin jenkins while igor making the call to the same api made the parameterxyz+abcd+klm.Looking into the fix.
This should be sufficient. I will look into the issue…