Commit 0c317019 authored by Douwe Maan's avatar Douwe Maan
Browse files

Merge branch 'bitbucket-show-incompatible' into 'master'

Show incompatible projects in Bitbucket import status

### What does this MR do?

This MR displays incompatible Bitbucket projects (e.g. SVN, hg) in the status table.

### Why was this MR needed?

Users are confused when they don't see projects show up. The import list should show incompatible projects as we do for Google Code to make it more obvious to the user what is happening. (See !586 and 9c76a6fa).

### Screenshot


### What are the relevant issue numbers?


See merge request !1114
parents 4773f38e d7accda1
Please view this file on the master branch, on stable branches it's out of date.
v 7.14.0 (unreleased)
- Show incompatible projects in Bitbucket import status (Stan Hu)
- Fix coloring of diffs on MR Discussion-tab (Gert Goet)
- Fix "Network" and "Graphs" pages for branches with encoded slashes (Stan Hu)
- Fix errors deleting and creating branches with encoded slashes (Stan Hu)
......@@ -22,6 +22,7 @@ def callback
def status
@repos = client.projects
@incompatible_repos = client.incompatible_projects
@already_added_projects = current_user.created_projects.where(import_type: "bitbucket")
already_added_projects_names = @already_added_projects.pluck(:import_source)
......@@ -3,11 +3,16 @@
Import projects from Bitbucket
Select projects you want to import.
= button_tag 'Import all projects', class: "btn btn-success js-import-all"
- if @repos.any?
Select projects you want to import.
- if @incompatible_repos.any?
= button_tag 'Import all compatible projects', class: "btn btn-success js-import-all"
- else
= button_tag 'Import all projects', class: "btn btn-success js-import-all"
......@@ -41,6 +46,24 @@
= "#{repo["owner"]}/#{repo["slug"]}"
= button_tag "Import", class: "btn js-add-to-import"
- @incompatible_repos.each do |repo|
%tr{id: "repo_#{repo["owner"]}___#{repo["slug"]}"}
= link_to "#{repo["owner"]}/#{repo["slug"]}", "{repo["owner"]}/#{repo["slug"]}", target: "_blank"
= label_tag "Incompatible Project", nil, class: "label label-danger"
- if @incompatible_repos.any?
One or more of your Bitbucket projects cannot be imported into GitLab
directly because they use Subversion or Mercurial for version control,
rather than Git. Please convert
= link_to "them to Git,", ""
and go through the
= link_to "import flow", status_import_bitbucket_path
new ImporterStatus("#{jobs_import_bitbucket_path}", "#{import_bitbucket_path}")
......@@ -87,6 +87,10 @@ def projects
JSON.parse(get("/api/1.0/user/repositories").body).select { |repo| repo["scm"] == "git" }
def incompatible_projects
JSON.parse(get("/api/1.0/user/repositories").body).reject { |repo| repo["scm"] == "git" }
def get(url)
......@@ -39,12 +39,14 @@
it "assigns variables" do
@project = create(:project, import_type: 'bitbucket', creator_id:
stub_client(projects: [@repo])
client = stub_client(projects: [@repo])
allow(client).to receive(:incompatible_projects).and_return([])
get :status
expect(assigns(:already_added_projects)).to eq([@project])
expect(assigns(:repos)).to eq([@repo])
expect(assigns(:incompatible_repos)).to eq([])
it "does not show already added project" do
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment