Commit graph

21 commits

Author SHA1 Message Date
Stan Hu
a0856cf7b9 Fix BitbucketServer::Client failing with Webmock 3.5.1
Webmock 3.1.0 changed the behavior to return `nil` for the body if an
HTTP 204 No Content response were received
(b837e64278).

Update the Bitbucket Server connection to ignore these No Content
response codes.
2019-02-16 15:30:02 -08:00
Stan Hu
660dcd5b7c Fix Bitbucket Server importer error handling
The importer would display a 500 error page if you attempted to import
using a non-existent DNS entry. This commit rescues known network issues
and consolidates them into
BitbucketServer::Connection::ConnectionError`.  The previous error
handling in the paginator doesn't work because it returns a lazy
collection.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56154
2019-01-12 22:14:08 -08:00
Stan Hu
39f252254b Make sure there's only one slash as path separator
In Ruby 2.4, `URI.join("http://test//", "a").to_s` will
remove the double slash, however it's not the case in
Ruby 2.5. Using chomp should work better for the intention,
as we're not trying to allow things like ../ or / paths
resolution.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53180
2018-11-09 15:36:45 -08:00
Stan Hu
aa5821e571 Assorted Bitbucket Server importer code cleanup based on review 2018-08-01 10:45:04 -07:00
Stan Hu
d2fd6d2351 Deal with subpaths and trailing slashes properly 2018-07-31 21:14:36 -07:00
Stan Hu
fc5df829bd Use URI.join to avoid slash headaches 2018-07-31 13:22:40 -07:00
Stan Hu
dbef9f2151 Hide error details if there are none 2018-07-31 12:58:26 -07:00
Stan Hu
57d1b60f61 Handle invalid JSON from server 2018-07-27 14:29:05 -07:00
Stan Hu
450030e902 Add Accept header for JSON 2018-07-27 12:58:17 -07:00
Stan Hu
4160a8dd81 Enable frozen_string_literal 2018-07-25 05:22:53 -07:00
Stan Hu
9d59616b95 Fix URL for deleting branches 2018-07-18 23:15:24 -07:00
Stan Hu
19cd1ba7bc Fix identation in lib/bitbucket_server/connection.rb 2018-07-17 22:29:18 -07:00
Stan Hu
c793252e8b Add support for deleting branches via the Bitbucket Server API 2018-07-13 15:39:24 -07:00
Stan Hu
ec4109d413 Make Connection#post consistent with Connection#get and add specs 2018-07-12 23:17:05 -07:00
Stan Hu
15220291ae Add spec for BitbucketServer::Connection 2018-07-12 22:33:36 -07:00
Stan Hu
12b031ce8f Fix pagination 2018-07-05 21:11:16 -07:00
Stan Hu
a78e36abab Improve error handling of Bitbucket login errors 2018-07-05 14:09:01 -07:00
Stan Hu
d3c75ea4d9 Support creating a remote branch to import closed pull requests 2018-07-03 16:37:17 -07:00
Stan Hu
3735ce43fc Add a Reconfigure button and improve layout of import screen 2018-07-01 05:13:15 -07:00
Stan Hu
046a5e398d More work towards supporting Bitbucket Server 2018-06-25 22:40:11 -07:00
Stan Hu
ebd8e4333a WIP: Add support for Bitbucket Server imports 2018-06-25 13:06:10 -07:00