Skip to content

Bamboo Service: Fix missing credentials & URL handling

Created by: bentolor

Update: Added another fix which fixes an error introduced in the latest changes using URI.join() in favour to URL.parse() and rebased to the latest master.

This improves the Bamboo Service and provides two fixes:

  1. One for the situation, where the build trigger won't work because Bamboo is requiring authentication credentials for the trigger GET: https://github.com/gitlabhq/gitlabhq/pull/9428/commits/8f25aca307b49ee006172b8c2985a878800aa6b6
  2. One which fixes the way how the configured Bamboo base URL is assembled to the final REST URL. https://github.com/gitlabhq/gitlabhq/pull/9428/commits/fe9eb30d7ebe4a83eefea7e06f8b69b135dad15d

Regarding credentials

The change now does provide additional HTTP Basic Auth parameters if user credentials were provided and appends an request parameter indicating the HTTP Basic Authentication should be used. This aligns interaction with Bamboo with the other calls this service executes.

Regarding URL handling

If one had configured a bamboo_url like http://foo.bar/bamboo in the previous implementation the plugin directed it's request i.e. to http://foo.bar/rest/... instead of http://foo.bar/bamboo/rest/...

This i probably an unwanted side effect of how Ruby's URI.join is working. It will only work correctly, if

  • ... the prefix URL has at least one or more trailing /
  • .. the appendix parts are not prefixed with /

Backported & tested successfully in our environment.

Merge request reports