Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
4c8e9a8d
Commit
4c8e9a8d
authored
Aug 18, 2016
by
Z.J. van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove gitorious
parent
b2bf01f4
Changes
19
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
12 additions
and
339 deletions
+12
-339
CHANGELOG
CHANGELOG
+1
-0
app/assets/stylesheets/pages/import.scss
app/assets/stylesheets/pages/import.scss
+0
-19
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+1
-5
app/controllers/import/gitorious_controller.rb
app/controllers/import/gitorious_controller.rb
+0
-47
app/models/application_setting.rb
app/models/application_setting.rb
+1
-1
app/views/import/gitorious/status.html.haml
app/views/import/gitorious/status.html.haml
+0
-54
app/views/projects/new.html.haml
app/views/projects/new.html.haml
+0
-5
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-1
config/routes.rb
config/routes.rb
+0
-6
doc/workflow/gitlab_flow.md
doc/workflow/gitlab_flow.md
+1
-1
features/steps/dashboard/new_project.rb
features/steps/dashboard/new_project.rb
+0
-1
lib/gitlab/current_settings.rb
lib/gitlab/current_settings.rb
+1
-1
lib/gitlab/gitorious_import.rb
lib/gitlab/gitorious_import.rb
+0
-5
lib/gitlab/gitorious_import/client.rb
lib/gitlab/gitorious_import/client.rb
+0
-29
lib/gitlab/gitorious_import/project_creator.rb
lib/gitlab/gitorious_import/project_creator.rb
+0
-27
lib/gitlab/gitorious_import/repository.rb
lib/gitlab/gitorious_import/repository.rb
+0
-35
lib/gitlab/import_sources.rb
lib/gitlab/import_sources.rb
+6
-7
spec/controllers/import/gitorious_controller_spec.rb
spec/controllers/import/gitorious_controller_spec.rb
+0
-69
spec/lib/gitlab/gitorious_import/project_creator_spec.rb
spec/lib/gitlab/gitorious_import/project_creator_spec.rb
+0
-26
No files found.
CHANGELOG
View file @
4c8e9a8d
...
...
@@ -6,6 +6,7 @@ v 8.12.0 (unreleased)
- Add `web_url` field to issue, merge request, and snippet API objects (Ben Boeckel)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Remove Gitorious import
- Add Sentry logging to API calls
- Added tests for diff notes
- Added 'only_allow_merge_if_build_succeeds' project setting in the API. !5930 (Duck)
...
...
app/assets/stylesheets/pages/import.scss
View file @
4c8e9a8d
i
.icon-gitorious
{
display
:
inline-block
;
background-position
:
0
0
;
background-size
:
contain
;
background-repeat
:
no-repeat
;
}
i
.icon-gitorious-small
{
background-image
:
image-url
(
'gitorious-logo-blue.png'
);
width
:
13px
;
height
:
13px
;
}
i
.icon-gitorious-big
{
background-image
:
image-url
(
'gitorious-logo-black.png'
);
width
:
18px
;
height
:
18px
;
}
.import-jobs-from-col
,
.import-jobs-to-col
{
width
:
40%
;
...
...
app/controllers/application_controller.rb
View file @
4c8e9a8d
...
...
@@ -25,7 +25,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery
with: :exception
helper_method
:abilities
,
:can?
,
:current_application_settings
helper_method
:import_sources_enabled?
,
:github_import_enabled?
,
:github_import_configured?
,
:gitlab_import_enabled?
,
:gitlab_import_configured?
,
:bitbucket_import_enabled?
,
:bitbucket_import_configured?
,
:g
itorious_import_enabled?
,
:g
oogle_code_import_enabled?
,
:fogbugz_import_enabled?
,
:git_import_enabled?
,
:gitlab_project_import_enabled?
helper_method
:import_sources_enabled?
,
:github_import_enabled?
,
:github_import_configured?
,
:gitlab_import_enabled?
,
:gitlab_import_configured?
,
:bitbucket_import_enabled?
,
:bitbucket_import_configured?
,
:google_code_import_enabled?
,
:fogbugz_import_enabled?
,
:git_import_enabled?
,
:gitlab_project_import_enabled?
rescue_from
Encoding
::
CompatibilityError
do
|
exception
|
log_exception
(
exception
)
...
...
@@ -250,10 +250,6 @@ class ApplicationController < ActionController::Base
Gitlab
::
OAuth
::
Provider
.
enabled?
(
:bitbucket
)
&&
Gitlab
::
BitbucketImport
.
public_key
.
present?
end
def
gitorious_import_enabled?
current_application_settings
.
import_sources
.
include?
(
'gitorious'
)
end
def
google_code_import_enabled?
current_application_settings
.
import_sources
.
include?
(
'google_code'
)
end
...
...
app/controllers/import/gitorious_controller.rb
deleted
100644 → 0
View file @
b2bf01f4
class
Import::GitoriousController
<
Import
::
BaseController
before_action
:verify_gitorious_import_enabled
def
new
redirect_to
client
.
authorize_url
(
callback_import_gitorious_url
)
end
def
callback
session
[
:gitorious_repos
]
=
params
[
:repos
]
redirect_to
status_import_gitorious_path
end
def
status
@repos
=
client
.
repos
@already_added_projects
=
current_user
.
created_projects
.
where
(
import_type:
"gitorious"
)
already_added_projects_names
=
@already_added_projects
.
pluck
(
:import_source
)
@repos
.
reject!
{
|
repo
|
already_added_projects_names
.
include?
repo
.
full_name
}
end
def
jobs
jobs
=
current_user
.
created_projects
.
where
(
import_type:
"gitorious"
).
to_json
(
only:
[
:id
,
:import_status
])
render
json:
jobs
end
def
create
@repo_id
=
params
[
:repo_id
]
repo
=
client
.
repo
(
@repo_id
)
@target_namespace
=
params
[
:new_namespace
].
presence
||
repo
.
namespace
@project_name
=
repo
.
name
namespace
=
get_or_create_namespace
||
(
render
and
return
)
@project
=
Gitlab
::
GitoriousImport
::
ProjectCreator
.
new
(
repo
,
namespace
,
current_user
).
execute
end
private
def
client
@client
||=
Gitlab
::
GitoriousImport
::
Client
.
new
(
session
[
:gitorious_repos
])
end
def
verify_gitorious_import_enabled
render_404
unless
gitorious_import_enabled?
end
end
app/models/application_setting.rb
View file @
4c8e9a8d
...
...
@@ -146,7 +146,7 @@ class ApplicationSetting < ActiveRecord::Base
default_project_visibility:
Settings
.
gitlab
.
default_projects_features
[
'visibility_level'
],
default_snippet_visibility:
Settings
.
gitlab
.
default_projects_features
[
'visibility_level'
],
domain_whitelist:
Settings
.
gitlab
[
'domain_whitelist'
],
import_sources:
%w[github bitbucket gitlab g
itorious g
oogle_code fogbugz git gitlab_project]
,
import_sources:
%w[github bitbucket gitlab google_code fogbugz git gitlab_project]
,
shared_runners_enabled:
Settings
.
gitlab_ci
[
'shared_runners_enabled'
],
max_artifacts_size:
Settings
.
artifacts
[
'max_size'
],
require_two_factor_authentication:
false
,
...
...
app/views/import/gitorious/status.html.haml
deleted
100644 → 0
View file @
b2bf01f4
-
page_title
"Gitorious import"
-
header_title
"Projects"
,
root_path
%h3
.page-title
%i
.icon-gitorious.icon-gitorious-big
Import projects from Gitorious.org
%p
.light
Select projects you want to import.
%hr
%p
=
button_tag
class:
"btn btn-import btn-success js-import-all"
do
Import all projects
=
icon
(
"spinner spin"
,
class:
"loading-icon"
)
.table-responsive
%table
.table.import-jobs
%colgroup
.import-jobs-from-col
%colgroup
.import-jobs-to-col
%colgroup
.import-jobs-status-col
%thead
%tr
%th
From Gitorious.org
%th
To GitLab
%th
Status
%tbody
-
@already_added_projects
.
each
do
|
project
|
%tr
{
id:
"project_#{project.id}"
,
class:
"#{project_status_css_class(project.import_status)}"
}
%td
=
link_to
project
.
import_source
,
"https://gitorious.org/
#{
project
.
import_source
}
"
,
target:
"_blank"
%td
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
%td
.job-status
-
if
project
.
import_status
==
'finished'
%span
%i
.fa.fa-check
done
-
elsif
project
.
import_status
==
'started'
%i
.fa.fa-spinner.fa-spin
started
-
else
=
project
.
human_import_status_name
-
@repos
.
each
do
|
repo
|
%tr
{
id:
"repo_#{repo.id}"
}
%td
=
link_to
repo
.
full_name
,
"https://gitorious.org/
#{
repo
.
full_name
}
"
,
target:
"_blank"
%td
.import-target
=
repo
.
full_name
%td
.import-actions.job-status
=
button_tag
class:
"btn btn-import js-add-to-import"
do
Import
=
icon
(
"spinner spin"
,
class:
"loading-icon"
)
.js-importer-status
{
data:
{
jobs_import_path:
"#{jobs_import_gitorious_path}"
,
import_path:
"#{import_gitorious_path}"
}
}
app/views/projects/new.html.haml
View file @
4c8e9a8d
...
...
@@ -59,11 +59,6 @@
=
icon
(
'gitlab'
,
text:
'GitLab.com'
)
-
unless
gitlab_import_configured?
=
render
'gitlab_import_modal'
%div
-
if
gitorious_import_enabled?
=
link_to
new_import_gitorious_path
,
class:
'btn import_gitorious'
do
%i
.icon-gitorious.icon-gitorious-small
Gitorious.org
%div
-
if
google_code_import_enabled?
=
link_to
new_import_google_code_path
,
class:
'btn import_google_code'
do
...
...
config/initializers/1_settings.rb
View file @
4c8e9a8d
...
...
@@ -212,7 +212,7 @@ Settings.gitlab.default_projects_features['builds'] = true if Settin
Settings
.
gitlab
.
default_projects_features
[
'container_registry'
]
=
true
if
Settings
.
gitlab
.
default_projects_features
[
'container_registry'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'visibility_level'
]
=
Settings
.
send
(
:verify_constant
,
Gitlab
::
VisibilityLevel
,
Settings
.
gitlab
.
default_projects_features
[
'visibility_level'
],
Gitlab
::
VisibilityLevel
::
PRIVATE
)
Settings
.
gitlab
[
'domain_whitelist'
]
||=
[]
Settings
.
gitlab
[
'import_sources'
]
||=
%w[github bitbucket gitlab g
itorious g
oogle_code fogbugz git gitlab_project]
Settings
.
gitlab
[
'import_sources'
]
||=
%w[github bitbucket gitlab google_code fogbugz git gitlab_project]
Settings
.
gitlab
[
'trusted_proxies'
]
||=
[]
#
...
...
config/routes.rb
View file @
4c8e9a8d
...
...
@@ -157,12 +157,6 @@ Rails.application.routes.draw do
get
:jobs
end
resource
:gitorious
,
only:
[
:create
,
:new
],
controller: :gitorious
do
get
:status
get
:callback
get
:jobs
end
resource
:google_code
,
only:
[
:create
,
:new
],
controller: :google_code
do
get
:status
post
:callback
...
...
doc/workflow/gitlab_flow.md
View file @
4c8e9a8d
...
...
@@ -115,7 +115,7 @@ In this flow it is not common to have a production branch (or git flow master br
Merge or pull requests are created in a git management application and ask an assigned person to merge two branches.
Tools such as GitHub and Bitbucket choose the name pull request since the first manual action would be to pull the feature branch.
Tools such as GitLab and
Gitoriou
s choose the name merge request since that is the final action that is requested of the assignee.
Tools such as GitLab and
other
s choose the name merge request since that is the final action that is requested of the assignee.
In this article we'll refer to them as merge requests.
If you work on a feature branch for more than a few hours it is good to share the intermediate result with the rest of the team.
...
...
features/steps/dashboard/new_project.rb
View file @
4c8e9a8d
...
...
@@ -18,7 +18,6 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
expect
(
page
).
to
have_link
(
'GitHub'
)
expect
(
page
).
to
have_link
(
'Bitbucket'
)
expect
(
page
).
to
have_link
(
'GitLab.com'
)
expect
(
page
).
to
have_link
(
'Gitorious.org'
)
expect
(
page
).
to
have_link
(
'Google Code'
)
expect
(
page
).
to
have_link
(
'Repo by URL'
)
end
...
...
lib/gitlab/current_settings.rb
View file @
4c8e9a8d
...
...
@@ -41,7 +41,7 @@ module Gitlab
default_project_visibility:
Settings
.
gitlab
.
default_projects_features
[
'visibility_level'
],
default_snippet_visibility:
Settings
.
gitlab
.
default_projects_features
[
'visibility_level'
],
domain_whitelist:
Settings
.
gitlab
[
'domain_whitelist'
],
import_sources:
%w[github bitbucket gitlab g
itorious g
oogle_code fogbugz git gitlab_project]
,
import_sources:
%w[github bitbucket gitlab google_code fogbugz git gitlab_project]
,
shared_runners_enabled:
Settings
.
gitlab_ci
[
'shared_runners_enabled'
],
max_artifacts_size:
Settings
.
artifacts
[
'max_size'
],
require_two_factor_authentication:
false
,
...
...
lib/gitlab/gitorious_import.rb
deleted
100644 → 0
View file @
b2bf01f4
module
Gitlab
module
GitoriousImport
GITORIOUS_HOST
=
"https://gitorious.org"
end
end
lib/gitlab/gitorious_import/client.rb
deleted
100644 → 0
View file @
b2bf01f4
module
Gitlab
module
GitoriousImport
class
Client
attr_reader
:repo_list
def
initialize
(
repo_list
)
@repo_list
=
repo_list
end
def
authorize_url
(
redirect_uri
)
"
#{
GITORIOUS_HOST
}
/gitlab-import?callback_url=
#{
redirect_uri
}
"
end
def
repos
@repos
||=
repo_names
.
map
{
|
full_name
|
GitoriousImport
::
Repository
.
new
(
full_name
)
}
end
def
repo
(
id
)
repos
.
find
{
|
repo
|
repo
.
id
==
id
}
end
private
def
repo_names
repo_list
.
to_s
.
split
(
','
).
map
(
&
:strip
).
reject
(
&
:blank?
)
end
end
end
end
lib/gitlab/gitorious_import/project_creator.rb
deleted
100644 → 0
View file @
b2bf01f4
module
Gitlab
module
GitoriousImport
class
ProjectCreator
attr_reader
:repo
,
:namespace
,
:current_user
def
initialize
(
repo
,
namespace
,
current_user
)
@repo
=
repo
@namespace
=
namespace
@current_user
=
current_user
end
def
execute
::
Projects
::
CreateService
.
new
(
current_user
,
name:
repo
.
name
,
path:
repo
.
path
,
description:
repo
.
description
,
namespace_id:
namespace
.
id
,
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
,
import_type:
"gitorious"
,
import_source:
repo
.
full_name
,
import_url:
repo
.
import_url
).
execute
end
end
end
end
lib/gitlab/gitorious_import/repository.rb
deleted
100644 → 0
View file @
b2bf01f4
module
Gitlab
module
GitoriousImport
Repository
=
Struct
.
new
(
:full_name
)
do
def
id
Digest
::
SHA1
.
hexdigest
(
full_name
)
end
def
namespace
segments
.
first
end
def
path
segments
.
last
end
def
name
path
.
titleize
end
def
description
""
end
def
import_url
"
#{
GITORIOUS_HOST
}
/
#{
full_name
}
.git"
end
private
def
segments
full_name
.
split
(
'/'
)
end
end
end
end
lib/gitlab/import_sources.rb
View file @
4c8e9a8d
...
...
@@ -17,7 +17,6 @@ module Gitlab
'GitHub'
=>
'github'
,
'Bitbucket'
=>
'bitbucket'
,
'GitLab.com'
=>
'gitlab'
,
'Gitorious.org'
=>
'gitorious'
,
'Google Code'
=>
'google_code'
,
'FogBugz'
=>
'fogbugz'
,
'Repo by URL'
=>
'git'
,
...
...
spec/controllers/import/gitorious_controller_spec.rb
deleted
100644 → 0
View file @
b2bf01f4
require
'spec_helper'
describe
Import
::
GitoriousController
do
include
ImportSpecHelper
let
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
end
describe
"GET new"
do
it
"redirects to import endpoint on gitorious.org"
do
get
:new
expect
(
controller
).
to
redirect_to
(
"https://gitorious.org/gitlab-import?callback_url=http://test.host/import/gitorious/callback"
)
end
end
describe
"GET callback"
do
it
"stores repo list in session"
do
get
:callback
,
repos:
'foo/bar,baz/qux'
expect
(
session
[
:gitorious_repos
]).
to
eq
(
'foo/bar,baz/qux'
)
end
end
describe
"GET status"
do
before
do
@repo
=
OpenStruct
.
new
(
full_name:
'asd/vim'
)
end
it
"assigns variables"
do
@project
=
create
(
:project
,
import_type:
'gitorious'
,
creator_id:
user
.
id
)
stub_client
(
repos:
[
@repo
])
get
:status
expect
(
assigns
(
:already_added_projects
)).
to
eq
([
@project
])
expect
(
assigns
(
:repos
)).
to
eq
([
@repo
])
end
it
"does not show already added project"
do
@project
=
create
(
:project
,
import_type:
'gitorious'
,
creator_id:
user
.
id
,
import_source:
'asd/vim'
)
stub_client
(
repos:
[
@repo
])
get
:status
expect
(
assigns
(
:already_added_projects
)).
to
eq
([
@project
])
expect
(
assigns
(
:repos
)).
to
eq
([])
end
end
describe
"POST create"
do
before
do
@repo
=
Gitlab
::
GitoriousImport
::
Repository
.
new
(
'asd/vim'
)
end
it
"takes already existing namespace"
do
namespace
=
create
(
:namespace
,
name:
"asd"
,
owner:
user
)
expect
(
Gitlab
::
GitoriousImport
::
ProjectCreator
).
to
receive
(
:new
).
with
(
@repo
,
namespace
,
user
).
and_return
(
double
(
execute:
true
))
stub_client
(
repo:
@repo
)
post
:create
,
format: :js
end
end
end
spec/lib/gitlab/gitorious_import/project_creator_spec.rb
deleted
100644 → 0
View file @
b2bf01f4
require
'spec_helper'
describe
Gitlab
::
GitoriousImport
::
ProjectCreator
,
lib:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:repo
)
{
Gitlab
::
GitoriousImport
::
Repository
.
new
(
'foo/bar-baz-qux'
)
}
let
(
:namespace
){
create
(
:group
,
owner:
user
)
}
before
do
namespace
.
add_owner
(
user
)
end
it
'creates project'
do
allow_any_instance_of
(
Project
).
to
receive
(
:add_import_job
)
project_creator
=
Gitlab
::
GitoriousImport
::
ProjectCreator
.
new
(
repo
,
namespace
,
user
)
project
=
project_creator
.
execute
expect
(
project
.
name
).
to
eq
(
"Bar Baz Qux"
)
expect
(
project
.
path
).
to
eq
(
"bar-baz-qux"
)
expect
(
project
.
namespace
).
to
eq
(
namespace
)
expect
(
project
.
visibility_level
).
to
eq
(
Gitlab
::
VisibilityLevel
::
PUBLIC
)
expect
(
project
.
import_type
).
to
eq
(
"gitorious"
)
expect
(
project
.
import_source
).
to
eq
(
"foo/bar-baz-qux"
)
expect
(
project
.
import_url
).
to
eq
(
"https://gitorious.org/foo/bar-baz-qux.git"
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment