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

Most upvoted comments

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 klm decoded the parameter as xyz abcd klm in jenkins while igor making the call to the same api made the parameter xyz+abcd+klm.

Looking into the fix.

This should be sufficient. I will look into the issue…