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
Kazuhiko Shiozaki
gitlab-ce
Commits
e8905826
Commit
e8905826
authored
Feb 02, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rubocop enabled for: Use spaces inside hash literal braces
parent
84a5a548
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
66 additions
and
66 deletions
+66
-66
.rubocop.yml
.rubocop.yml
+1
-1
app/controllers/snippets_controller.rb
app/controllers/snippets_controller.rb
+1
-1
app/helpers/compare_helper.rb
app/helpers/compare_helper.rb
+2
-2
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-1
app/models/hooks/web_hook.rb
app/models/hooks/web_hook.rb
+1
-1
app/models/identity.rb
app/models/identity.rb
+1
-1
app/models/project_services/custom_issue_tracker_service.rb
app/models/project_services/custom_issue_tracker_service.rb
+2
-2
app/models/project_services/gitlab_ci_service.rb
app/models/project_services/gitlab_ci_service.rb
+1
-1
app/models/project_services/issue_tracker_service.rb
app/models/project_services/issue_tracker_service.rb
+2
-2
app/models/project_wiki.rb
app/models/project_wiki.rb
+1
-1
app/models/user.rb
app/models/user.rb
+2
-2
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-1
config/initializers/carrierwave.rb
config/initializers/carrierwave.rb
+1
-1
config/routes.rb
config/routes.rb
+24
-24
lib/api/api.rb
lib/api/api.rb
+2
-2
lib/api/api_guard.rb
lib/api/api_guard.rb
+1
-1
lib/api/helpers.rb
lib/api/helpers.rb
+1
-1
lib/api/project_members.rb
lib/api/project_members.rb
+1
-1
lib/gitlab/backend/grack_auth.rb
lib/gitlab/backend/grack_auth.rb
+4
-4
lib/gitlab/git_access_status.rb
lib/gitlab/git_access_status.rb
+2
-2
lib/gitlab/satellite/action.rb
lib/gitlab/satellite/action.rb
+1
-1
lib/gitlab/satellite/files/delete_file_action.rb
lib/gitlab/satellite/files/delete_file_action.rb
+2
-2
lib/gitlab/satellite/files/edit_file_action.rb
lib/gitlab/satellite/files/edit_file_action.rb
+2
-2
lib/gitlab/satellite/files/new_file_action.rb
lib/gitlab/satellite/files/new_file_action.rb
+2
-2
lib/gitlab/satellite/merge_action.rb
lib/gitlab/satellite/merge_action.rb
+3
-3
lib/gitlab/satellite/satellite.rb
lib/gitlab/satellite/satellite.rb
+3
-3
lib/gitlab/upgrader.rb
lib/gitlab/upgrader.rb
+1
-1
No files found.
.rubocop.yml
View file @
e8905826
...
@@ -617,7 +617,7 @@ Style/SpaceInsideBrackets:
...
@@ -617,7 +617,7 @@ Style/SpaceInsideBrackets:
Style/SpaceInsideHashLiteralBraces
:
Style/SpaceInsideHashLiteralBraces
:
Description
:
"
Use
spaces
inside
hash
literal
braces
-
or
don't."
Description
:
"
Use
spaces
inside
hash
literal
braces
-
or
don't."
StyleGuide
:
'
https://github.com/bbatsov/ruby-style-guide#spaces-operators'
StyleGuide
:
'
https://github.com/bbatsov/ruby-style-guide#spaces-operators'
Enabled
:
fals
e
Enabled
:
tru
e
Style/SpaceInsideParens
:
Style/SpaceInsideParens
:
Description
:
'
No
spaces
after
(
or
before
).'
Description
:
'
No
spaces
after
(
or
before
).'
...
...
app/controllers/snippets_controller.rb
View file @
e8905826
...
@@ -27,7 +27,7 @@ class SnippetsController < ApplicationController
...
@@ -27,7 +27,7 @@ class SnippetsController < ApplicationController
@snippets
=
SnippetsFinder
.
new
.
execute
(
current_user
,
{
@snippets
=
SnippetsFinder
.
new
.
execute
(
current_user
,
{
filter: :by_user
,
filter: :by_user
,
user:
@user
,
user:
@user
,
scope:
params
[
:scope
]}).
scope:
params
[
:scope
]
}).
page
(
params
[
:page
]).
per
(
20
)
page
(
params
[
:page
]).
per
(
20
)
if
@user
==
current_user
if
@user
==
current_user
...
...
app/helpers/compare_helper.rb
View file @
e8905826
module
CompareHelper
module
CompareHelper
def
compare_to_mr_button?
def
compare_to_mr_button?
@project
.
merge_requests_enabled
&&
@project
.
merge_requests_enabled
&&
params
[
:from
].
present?
&&
params
[
:from
].
present?
&&
params
[
:to
].
present?
&&
params
[
:to
].
present?
&&
@repository
.
branch_names
.
include?
(
params
[
:from
])
&&
@repository
.
branch_names
.
include?
(
params
[
:from
])
&&
@repository
.
branch_names
.
include?
(
params
[
:to
])
&&
@repository
.
branch_names
.
include?
(
params
[
:to
])
&&
...
@@ -10,6 +10,6 @@ module CompareHelper
...
@@ -10,6 +10,6 @@ module CompareHelper
end
end
def
compare_mr_path
def
compare_mr_path
new_project_merge_request_path
(
@project
,
merge_request:
{
source_branch:
params
[
:to
],
target_branch:
params
[
:from
]
})
new_project_merge_request_path
(
@project
,
merge_request:
{
source_branch:
params
[
:to
],
target_branch:
params
[
:from
]
})
end
end
end
end
app/helpers/projects_helper.rb
View file @
e8905826
...
@@ -95,7 +95,7 @@ module ProjectsHelper
...
@@ -95,7 +95,7 @@ module ProjectsHelper
class:
cls
,
class:
cls
,
method: :post
,
method: :post
,
remote:
true
,
remote:
true
,
data:
{
type:
'json'
}
data:
{
type:
'json'
}
}
}
...
...
app/models/hooks/web_hook.rb
View file @
e8905826
...
@@ -44,7 +44,7 @@ class WebHook < ActiveRecord::Base
...
@@ -44,7 +44,7 @@ class WebHook < ActiveRecord::Base
}
}
WebHook
.
post
(
post_url
,
WebHook
.
post
(
post_url
,
body:
data
.
to_json
,
body:
data
.
to_json
,
headers:
{
"Content-Type"
=>
"application/json"
},
headers:
{
"Content-Type"
=>
"application/json"
},
verify:
false
,
verify:
false
,
basic_auth:
auth
)
basic_auth:
auth
)
end
end
...
...
app/models/identity.rb
View file @
e8905826
...
@@ -11,5 +11,5 @@
...
@@ -11,5 +11,5 @@
class
Identity
<
ActiveRecord
::
Base
class
Identity
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:user
validates
:extern_uid
,
allow_blank:
true
,
uniqueness:
{
scope: :provider
}
validates
:extern_uid
,
allow_blank:
true
,
uniqueness:
{
scope: :provider
}
end
end
app/models/project_services/custom_issue_tracker_service.rb
View file @
e8905826
...
@@ -41,8 +41,8 @@ class CustomIssueTrackerService < IssueTrackerService
...
@@ -41,8 +41,8 @@ class CustomIssueTrackerService < IssueTrackerService
{
type:
'text'
,
name:
'title'
,
placeholder:
title
},
{
type:
'text'
,
name:
'title'
,
placeholder:
title
},
{
type:
'text'
,
name:
'description'
,
placeholder:
description
},
{
type:
'text'
,
name:
'description'
,
placeholder:
description
},
{
type:
'text'
,
name:
'project_url'
,
placeholder:
'Project url'
},
{
type:
'text'
,
name:
'project_url'
,
placeholder:
'Project url'
},
{
type:
'text'
,
name:
'issues_url'
,
placeholder:
'Issue url'
},
{
type:
'text'
,
name:
'issues_url'
,
placeholder:
'Issue url'
},
{
type:
'text'
,
name:
'new_issue_url'
,
placeholder:
'New Issue url'
}
{
type:
'text'
,
name:
'new_issue_url'
,
placeholder:
'New Issue url'
}
]
]
end
end
...
...
app/models/project_services/gitlab_ci_service.rb
View file @
e8905826
...
@@ -81,7 +81,7 @@ class GitlabCiService < CiService
...
@@ -81,7 +81,7 @@ class GitlabCiService < CiService
def
fields
def
fields
[
[
{
type:
'text'
,
name:
'token'
,
placeholder:
'GitLab CI project specific token'
},
{
type:
'text'
,
name:
'token'
,
placeholder:
'GitLab CI project specific token'
},
{
type:
'text'
,
name:
'project_url'
,
placeholder:
'http://ci.gitlabhq.com/projects/3'
}
{
type:
'text'
,
name:
'project_url'
,
placeholder:
'http://ci.gitlabhq.com/projects/3'
}
]
]
end
end
end
end
app/models/project_services/issue_tracker_service.rb
View file @
e8905826
...
@@ -44,8 +44,8 @@ class IssueTrackerService < Service
...
@@ -44,8 +44,8 @@ class IssueTrackerService < Service
[
[
{
type:
'text'
,
name:
'description'
,
placeholder:
description
},
{
type:
'text'
,
name:
'description'
,
placeholder:
description
},
{
type:
'text'
,
name:
'project_url'
,
placeholder:
'Project url'
},
{
type:
'text'
,
name:
'project_url'
,
placeholder:
'Project url'
},
{
type:
'text'
,
name:
'issues_url'
,
placeholder:
'Issue url'
},
{
type:
'text'
,
name:
'issues_url'
,
placeholder:
'Issue url'
},
{
type:
'text'
,
name:
'new_issue_url'
,
placeholder:
'New Issue url'
}
{
type:
'text'
,
name:
'new_issue_url'
,
placeholder:
'New Issue url'
}
]
]
end
end
...
...
app/models/project_wiki.rb
View file @
e8905826
...
@@ -136,7 +136,7 @@ class ProjectWiki
...
@@ -136,7 +136,7 @@ class ProjectWiki
def
commit_details
(
action
,
message
=
nil
,
title
=
nil
)
def
commit_details
(
action
,
message
=
nil
,
title
=
nil
)
commit_message
=
message
||
default_message
(
action
,
title
)
commit_message
=
message
||
default_message
(
action
,
title
)
{
email:
@user
.
email
,
name:
@user
.
name
,
message:
commit_message
}
{
email:
@user
.
email
,
name:
@user
.
name
,
message:
commit_message
}
end
end
def
default_message
(
action
,
title
)
def
default_message
(
action
,
title
)
...
...
app/models/user.rb
View file @
e8905826
...
@@ -113,9 +113,9 @@ class User < ActiveRecord::Base
...
@@ -113,9 +113,9 @@ class User < ActiveRecord::Base
# Validations
# Validations
#
#
validates
:name
,
presence:
true
validates
:name
,
presence:
true
validates
:email
,
presence:
true
,
email:
{
strict_mode:
true
},
uniqueness:
true
validates
:email
,
presence:
true
,
email:
{
strict_mode:
true
},
uniqueness:
true
validates
:bio
,
length:
{
maximum:
255
},
allow_blank:
true
validates
:bio
,
length:
{
maximum:
255
},
allow_blank:
true
validates
:projects_limit
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
validates
:projects_limit
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
validates
:username
,
presence:
true
,
uniqueness:
{
case_sensitive:
false
},
validates
:username
,
presence:
true
,
uniqueness:
{
case_sensitive:
false
},
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
format:
{
with:
Gitlab
::
Regex
.
username_regex
,
format:
{
with:
Gitlab
::
Regex
.
username_regex
,
...
...
config/initializers/1_settings.rb
View file @
e8905826
...
@@ -148,7 +148,7 @@ Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.send(:build_gitlab_shell_s
...
@@ -148,7 +148,7 @@ Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.send(:build_gitlab_shell_s
Settings
[
'backup'
]
||=
Settingslogic
.
new
({})
Settings
[
'backup'
]
||=
Settingslogic
.
new
({})
Settings
.
backup
[
'keep_time'
]
||=
0
Settings
.
backup
[
'keep_time'
]
||=
0
Settings
.
backup
[
'path'
]
=
File
.
expand_path
(
Settings
.
backup
[
'path'
]
||
"tmp/backups/"
,
Rails
.
root
)
Settings
.
backup
[
'path'
]
=
File
.
expand_path
(
Settings
.
backup
[
'path'
]
||
"tmp/backups/"
,
Rails
.
root
)
Settings
.
backup
[
'upload'
]
||=
Settingslogic
.
new
({
'remote_directory'
=>
nil
,
'connection'
=>
nil
})
Settings
.
backup
[
'upload'
]
||=
Settingslogic
.
new
({
'remote_directory'
=>
nil
,
'connection'
=>
nil
})
# Convert upload connection settings to use symbol keys, to make Fog happy
# Convert upload connection settings to use symbol keys, to make Fog happy
if
Settings
.
backup
[
'upload'
][
'connection'
]
if
Settings
.
backup
[
'upload'
][
'connection'
]
Settings
.
backup
[
'upload'
][
'connection'
]
=
Hash
[
Settings
.
backup
[
'upload'
][
'connection'
].
map
{
|
k
,
v
|
[
k
.
to_sym
,
v
]
}]
Settings
.
backup
[
'upload'
][
'connection'
]
=
Hash
[
Settings
.
backup
[
'upload'
][
'connection'
].
map
{
|
k
,
v
|
[
k
.
to_sym
,
v
]
}]
...
...
config/initializers/carrierwave.rb
View file @
e8905826
...
@@ -14,7 +14,7 @@ if File.exists?(aws_file)
...
@@ -14,7 +14,7 @@ if File.exists?(aws_file)
}
}
config
.
fog_directory
=
AWS_CONFIG
[
'bucket'
]
# required
config
.
fog_directory
=
AWS_CONFIG
[
'bucket'
]
# required
config
.
fog_public
=
false
# optional, defaults to true
config
.
fog_public
=
false
# optional, defaults to true
config
.
fog_attributes
=
{
'Cache-Control'
=>
'max-age=315576000'
}
# optional, defaults to {}
config
.
fog_attributes
=
{
'Cache-Control'
=>
'max-age=315576000'
}
# optional, defaults to {}
config
.
fog_authenticated_url_expiration
=
1
<<
29
# optional time (in seconds) that authenticated urls will be valid.
config
.
fog_authenticated_url_expiration
=
1
<<
29
# optional time (in seconds) that authenticated urls will be valid.
# when fog_public is false and provider is AWS or Google, defaults to 600
# when fog_public is false and provider is AWS or Google, defaults to 600
end
end
...
...
config/routes.rb
View file @
e8905826
...
@@ -177,7 +177,7 @@ Gitlab::Application.routes.draw do
...
@@ -177,7 +177,7 @@ Gitlab::Application.routes.draw do
#
#
# Groups Area
# Groups Area
#
#
resources
:groups
,
constraints:
{
id:
/(?:[^.]|\.(?!atom$))+/
,
format:
/atom/
}
do
resources
:groups
,
constraints:
{
id:
/(?:[^.]|\.(?!atom$))+/
,
format:
/atom/
}
do
member
do
member
do
get
:issues
get
:issues
get
:merge_requests
get
:merge_requests
...
@@ -215,40 +215,40 @@ Gitlab::Application.routes.draw do
...
@@ -215,40 +215,40 @@ Gitlab::Application.routes.draw do
scope
module: :projects
do
scope
module: :projects
do
# Blob routes:
# Blob routes:
get
'/new/:id'
,
to:
'blob#new'
,
constraints:
{
id:
/.+/
},
as:
'new_blob'
get
'/new/:id'
,
to:
'blob#new'
,
constraints:
{
id:
/.+/
},
as:
'new_blob'
post
'/create/:id'
,
to:
'blob#create'
,
constraints:
{
id:
/.+/
},
as:
'create_blob'
post
'/create/:id'
,
to:
'blob#create'
,
constraints:
{
id:
/.+/
},
as:
'create_blob'
get
'/edit/:id'
,
to:
'blob#edit'
,
constraints:
{
id:
/.+/
},
as:
'edit_blob'
get
'/edit/:id'
,
to:
'blob#edit'
,
constraints:
{
id:
/.+/
},
as:
'edit_blob'
put
'/update/:id'
,
to:
'blob#update'
,
constraints:
{
id:
/.+/
},
as:
'update_blob'
put
'/update/:id'
,
to:
'blob#update'
,
constraints:
{
id:
/.+/
},
as:
'update_blob'
post
'/preview/:id'
,
to:
'blob#preview'
,
constraints:
{
id:
/.+/
},
as:
'preview_blob'
post
'/preview/:id'
,
to:
'blob#preview'
,
constraints:
{
id:
/.+/
},
as:
'preview_blob'
resources
:blob
,
only:
[
:show
,
:destroy
],
constraints:
{
id:
/.+/
,
format:
false
}
do
resources
:blob
,
only:
[
:show
,
:destroy
],
constraints:
{
id:
/.+/
,
format:
false
}
do
get
:diff
,
on: :member
get
:diff
,
on: :member
end
end
resources
:raw
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
resources
:raw
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
resources
:tree
,
only:
[
:show
],
constraints:
{
id:
/.+/
,
format:
/(html|js)/
}
resources
:tree
,
only:
[
:show
],
constraints:
{
id:
/.+/
,
format:
/(html|js)/
}
resource
:avatar
,
only:
[
:show
,
:destroy
]
resource
:avatar
,
only:
[
:show
,
:destroy
]
resources
:commit
,
only:
[
:show
],
constraints:
{
id:
/[[:alnum:]]{6,40}/
}
resources
:commit
,
only:
[
:show
],
constraints:
{
id:
/[[:alnum:]]{6,40}/
}
resources
:commits
,
only:
[
:show
],
constraints:
{
id:
/(?:[^.]|\.(?!atom$))+/
,
format:
/atom/
}
resources
:commits
,
only:
[
:show
],
constraints:
{
id:
/(?:[^.]|\.(?!atom$))+/
,
format:
/atom/
}
resources
:compare
,
only:
[
:index
,
:create
]
resources
:compare
,
only:
[
:index
,
:create
]
resources
:blame
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
resources
:blame
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
resources
:network
,
only:
[
:show
],
constraints:
{
id:
/(?:[^.]|\.(?!json$))+/
,
format:
/json/
}
resources
:network
,
only:
[
:show
],
constraints:
{
id:
/(?:[^.]|\.(?!json$))+/
,
format:
/json/
}
resources
:graphs
,
only:
[
:show
],
constraints:
{
id:
/(?:[^.]|\.(?!json$))+/
,
format:
/json/
}
do
resources
:graphs
,
only:
[
:show
],
constraints:
{
id:
/(?:[^.]|\.(?!json$))+/
,
format:
/json/
}
do
member
do
member
do
get
:commits
get
:commits
end
end
end
end
get
'/compare/:from...:to'
=>
'compare#show'
,
:as
=>
'compare'
,
get
'/compare/:from...:to'
=>
'compare#show'
,
:as
=>
'compare'
,
:constraints
=>
{
from:
/.+/
,
to:
/.+/
}
:constraints
=>
{
from:
/.+/
,
to:
/.+/
}
resources
:snippets
,
constraints:
{
id:
/\d+/
}
do
resources
:snippets
,
constraints:
{
id:
/\d+/
}
do
member
do
member
do
get
'raw'
get
'raw'
end
end
end
end
resources
:wikis
,
only:
[
:show
,
:edit
,
:destroy
,
:create
],
constraints:
{
id:
/[a-zA-Z.0-9_\-\/]+/
}
do
resources
:wikis
,
only:
[
:show
,
:edit
,
:destroy
,
:create
],
constraints:
{
id:
/[a-zA-Z.0-9_\-\/]+/
}
do
collection
do
collection
do
get
:pages
get
:pages
put
':id'
=>
'wikis#update'
put
':id'
=>
'wikis#update'
...
@@ -275,7 +275,7 @@ Gitlab::Application.routes.draw do
...
@@ -275,7 +275,7 @@ Gitlab::Application.routes.draw do
end
end
end
end
resources
:deploy_keys
,
constraints:
{
id:
/\d+/
}
do
resources
:deploy_keys
,
constraints:
{
id:
/\d+/
}
do
member
do
member
do
put
:enable
put
:enable
put
:disable
put
:disable
...
@@ -303,7 +303,7 @@ Gitlab::Application.routes.draw do
...
@@ -303,7 +303,7 @@ Gitlab::Application.routes.draw do
end
end
end
end
resources
:merge_requests
,
constraints:
{
id:
/\d+/
},
except:
[
:destroy
]
do
resources
:merge_requests
,
constraints:
{
id:
/\d+/
},
except:
[
:destroy
]
do
member
do
member
do
get
:diffs
get
:diffs
post
:automerge
post
:automerge
...
@@ -318,27 +318,27 @@ Gitlab::Application.routes.draw do
...
@@ -318,27 +318,27 @@ Gitlab::Application.routes.draw do
end
end
end
end
resources
:hooks
,
only:
[
:index
,
:create
,
:destroy
],
constraints:
{
id:
/\d+/
}
do
resources
:hooks
,
only:
[
:index
,
:create
,
:destroy
],
constraints:
{
id:
/\d+/
}
do
member
do
member
do
get
:test
get
:test
end
end
end
end
resources
:team
,
controller:
'team_members'
,
only:
[
:index
]
resources
:team
,
controller:
'team_members'
,
only:
[
:index
]
resources
:milestones
,
except:
[
:destroy
],
constraints:
{
id:
/\d+/
}
do
resources
:milestones
,
except:
[
:destroy
],
constraints:
{
id:
/\d+/
}
do
member
do
member
do
put
:sort_issues
put
:sort_issues
put
:sort_merge_requests
put
:sort_merge_requests
end
end
end
end
resources
:labels
,
constraints:
{
id:
/\d+/
}
do
resources
:labels
,
constraints:
{
id:
/\d+/
}
do
collection
do
collection
do
post
:generate
post
:generate
end
end
end
end
resources
:issues
,
constraints:
{
id:
/\d+/
},
except:
[
:destroy
]
do
resources
:issues
,
constraints:
{
id:
/\d+/
},
except:
[
:destroy
]
do
collection
do
collection
do
post
:bulk_update
post
:bulk_update
end
end
...
@@ -355,7 +355,7 @@ Gitlab::Application.routes.draw do
...
@@ -355,7 +355,7 @@ Gitlab::Application.routes.draw do
end
end
end
end
resources
:notes
,
only:
[
:index
,
:create
,
:destroy
,
:update
],
constraints:
{
id:
/\d+/
}
do
resources
:notes
,
only:
[
:index
,
:create
,
:destroy
,
:update
],
constraints:
{
id:
/\d+/
}
do
member
do
member
do
delete
:delete_attachment
delete
:delete_attachment
end
end
...
@@ -364,7 +364,7 @@ Gitlab::Application.routes.draw do
...
@@ -364,7 +364,7 @@ Gitlab::Application.routes.draw do
end
end
end
end
get
':id'
=>
'namespaces#show'
,
constraints:
{
id:
/(?:[^.]|\.(?!atom$))+/
,
format:
/atom/
}
get
':id'
=>
'namespaces#show'
,
constraints:
{
id:
/(?:[^.]|\.(?!atom$))+/
,
format:
/atom/
}
root
to:
'dashboard#show'
root
to:
'dashboard#show'
end
end
lib/api/api.rb
View file @
e8905826
...
@@ -6,7 +6,7 @@ module API
...
@@ -6,7 +6,7 @@ module API
version
'v3'
,
using: :path
version
'v3'
,
using: :path
rescue_from
ActiveRecord
::
RecordNotFound
do
rescue_from
ActiveRecord
::
RecordNotFound
do
rack_response
({
'message'
=>
'404 Not found'
}.
to_json
,
404
)
rack_response
({
'message'
=>
'404 Not found'
}.
to_json
,
404
)
end
end
rescue_from
:all
do
|
exception
|
rescue_from
:all
do
|
exception
|
...
@@ -19,7 +19,7 @@ module API
...
@@ -19,7 +19,7 @@ module API
message
<<
" "
<<
trace
.
join
(
"
\n
"
)
message
<<
" "
<<
trace
.
join
(
"
\n
"
)
API
.
logger
.
add
Logger
::
FATAL
,
message
API
.
logger
.
add
Logger
::
FATAL
,
message
rack_response
({
'message'
=>
'500 Internal Server Error'
},
500
)
rack_response
({
'message'
=>
'500 Internal Server Error'
},
500
)
end
end
format
:json
format
:json
...
...
lib/api/api_guard.rb
View file @
e8905826
...
@@ -146,7 +146,7 @@ module APIGuard
...
@@ -146,7 +146,7 @@ module APIGuard
Rack
::
OAuth2
::
Server
::
Resource
::
Bearer
::
Forbidden
.
new
(
Rack
::
OAuth2
::
Server
::
Resource
::
Bearer
::
Forbidden
.
new
(
:insufficient_scope
,
:insufficient_scope
,
Rack
::
OAuth2
::
Server
::
Resource
::
ErrorMethods
::
DEFAULT_DESCRIPTION
[
:insufficient_scope
],
Rack
::
OAuth2
::
Server
::
Resource
::
ErrorMethods
::
DEFAULT_DESCRIPTION
[
:insufficient_scope
],
{
scope:
e
.
scopes
})
{
scope:
e
.
scopes
})
end
end
response
.
finish
response
.
finish
...
...
lib/api/helpers.rb
View file @
e8905826
...
@@ -173,7 +173,7 @@ module API
...
@@ -173,7 +173,7 @@ module API
end
end
def
render_api_error!
(
message
,
status
)
def
render_api_error!
(
message
,
status
)
error!
({
'message'
=>
message
},
status
)
error!
({
'message'
=>
message
},
status
)
end
end
private
private
...
...
lib/api/project_members.rb
View file @
e8905826
...
@@ -106,7 +106,7 @@ module API
...
@@ -106,7 +106,7 @@ module API
unless
team_member
.
nil?
unless
team_member
.
nil?
team_member
.
destroy
team_member
.
destroy
else
else
{
message:
"Access revoked"
,
id:
params
[
:user_id
].
to_i
}
{
message:
"Access revoked"
,
id:
params
[
:user_id
].
to_i
}
end
end
end
end
end
end
...
...
lib/gitlab/backend/grack_auth.rb
View file @
e8905826
...
@@ -34,7 +34,7 @@ module Grack
...
@@ -34,7 +34,7 @@ module Grack
def
auth!
def
auth!
if
@auth
.
provided?
if
@auth
.
provided?
return
bad_request
unless
@auth
.
basic?
return
bad_request
unless
@auth
.
basic?
# Authentication with username and password
# Authentication with username and password
login
,
password
=
@auth
.
credentials
login
,
password
=
@auth
.
credentials
...
@@ -80,11 +80,11 @@ module Grack
...
@@ -80,11 +80,11 @@ module Grack
def
authenticate_user
(
login
,
password
)
def
authenticate_user
(
login
,
password
)
user
=
Gitlab
::
Auth
.
new
.
find
(
login
,
password
)
user
=
Gitlab
::
Auth
.
new
.
find
(
login
,
password
)
unless
user
unless
user
user
=
oauth_access_token_check
(
login
,
password
)
user
=
oauth_access_token_check
(
login
,
password
)
end
end
return
user
if
user
.
present?
return
user
if
user
.
present?
# At this point, we know the credentials were wrong. We let Rack::Attack
# At this point, we know the credentials were wrong. We let Rack::Attack
...
@@ -154,7 +154,7 @@ module Grack
...
@@ -154,7 +154,7 @@ module Grack
end
end
def
render_not_found
def
render_not_found
[
404
,
{
"Content-Type"
=>
"text/plain"
},
[
"Not Found"
]]
[
404
,
{
"Content-Type"
=>
"text/plain"
},
[
"Not Found"
]]
end
end
end
end
end
end
lib/gitlab/git_access_status.rb
View file @
e8905826
...
@@ -9,7 +9,7 @@ module Gitlab
...
@@ -9,7 +9,7 @@ module Gitlab
end
end
def
to_json
def
to_json
{
status:
@status
,
message:
@message
}.
to_json
{
status:
@status
,
message:
@message
}.
to_json
end
end
end
end
end
end
\ No newline at end of file
lib/gitlab/satellite/action.rb
View file @
e8905826
...
@@ -44,7 +44,7 @@ module Gitlab
...
@@ -44,7 +44,7 @@ module Gitlab
end
end
def
default_options
(
options
=
{})
def
default_options
(
options
=
{})
{
raise:
true
,
timeout:
true
}.
merge
(
options
)
{
raise:
true
,
timeout:
true
}.
merge
(
options
)
end
end
def
handle_exception
(
exception
)
def
handle_exception
(
exception
)
...
...
lib/gitlab/satellite/files/delete_file_action.rb
View file @
e8905826
...
@@ -13,7 +13,7 @@ module Gitlab
...
@@ -13,7 +13,7 @@ module Gitlab
prepare_satellite!
(
repo
)
prepare_satellite!
(
repo
)
# create target branch in satellite at the corresponding commit from bare repo
# create target branch in satellite at the corresponding commit from bare repo
repo
.
git
.
checkout
({
raise:
true
,
timeout:
true
,
b:
true
},
ref
,
"origin/
#{
ref
}
"
)
repo
.
git
.
checkout
({
raise:
true
,
timeout:
true
,
b:
true
},
ref
,
"origin/
#{
ref
}
"
)
# update the file in the satellite's working dir
# update the file in the satellite's working dir
file_path_in_satellite
=
File
.
join
(
repo
.
working_dir
,
file_path
)
file_path_in_satellite
=
File
.
join
(
repo
.
working_dir
,
file_path
)
...
@@ -36,7 +36,7 @@ module Gitlab
...
@@ -36,7 +36,7 @@ module Gitlab
# push commit back to bare repo
# push commit back to bare repo
# will raise CommandFailed when push fails
# will raise CommandFailed when push fails
repo
.
git
.
push
({
raise:
true
,
timeout:
true
},
:origin
,
ref
)
repo
.
git
.
push
({
raise:
true
,
timeout:
true
},
:origin
,
ref
)
# everything worked
# everything worked
true
true
...
...
lib/gitlab/satellite/files/edit_file_action.rb
View file @
e8905826
...
@@ -15,7 +15,7 @@ module Gitlab
...
@@ -15,7 +15,7 @@ module Gitlab
prepare_satellite!
(
repo
)
prepare_satellite!
(
repo
)
# create target branch in satellite at the corresponding commit from bare repo
# create target branch in satellite at the corresponding commit from bare repo
repo
.
git
.
checkout
({
raise:
true
,
timeout:
true
,
b:
true
},
ref
,
"origin/
#{
ref
}
"
)
repo
.
git
.
checkout
({
raise:
true
,
timeout:
true
,
b:
true
},
ref
,
"origin/
#{
ref
}
"
)
# update the file in the satellite's working dir
# update the file in the satellite's working dir
file_path_in_satellite
=
File
.
join
(
repo
.
working_dir
,
file_path
)
file_path_in_satellite
=
File
.
join
(
repo
.
working_dir
,
file_path
)
...
@@ -36,7 +36,7 @@ module Gitlab
...
@@ -36,7 +36,7 @@ module Gitlab
# push commit back to bare repo
# push commit back to bare repo
# will raise CommandFailed when push fails
# will raise CommandFailed when push fails
repo
.
git
.
push
({
raise:
true
,
timeout:
true
},
:origin
,
ref
)
repo
.
git
.
push
({
raise:
true
,
timeout:
true
},
:origin
,
ref
)
# everything worked
# everything worked
true
true
...
...
lib/gitlab/satellite/files/new_file_action.rb
View file @
e8905826
...
@@ -19,7 +19,7 @@ module Gitlab
...
@@ -19,7 +19,7 @@ module Gitlab
# skip this step if we want to add first file to empty repo
# skip this step if we want to add first file to empty repo
Satellite
::
PARKING_BRANCH
Satellite
::
PARKING_BRANCH
else
else
repo
.
git
.
checkout
({
raise:
true
,
timeout:
true
,
b:
true
},
ref
,
"origin/
#{
ref
}
"
)
repo
.
git
.
checkout
({
raise:
true
,
timeout:
true
,
b:
true
},
ref
,
"origin/
#{
ref
}
"
)
ref
ref
end
end
...
@@ -47,7 +47,7 @@ module Gitlab
...
@@ -47,7 +47,7 @@ module Gitlab
# push commit back to bare repo
# push commit back to bare repo
# will raise CommandFailed when push fails
# will raise CommandFailed when push fails
repo
.
git
.
push
({
raise:
true
,
timeout:
true
},
:origin
,
"
#{
current_ref
}
:
#{
ref
}
"
)
repo
.
git
.
push
({
raise:
true
,
timeout:
true
},
:origin
,
"
#{
current_ref
}
:
#{
ref
}
"
)
# everything worked
# everything worked
true
true
...
...
lib/gitlab/satellite/merge_action.rb
View file @
e8905826
...
@@ -86,7 +86,7 @@ module Gitlab
...
@@ -86,7 +86,7 @@ module Gitlab
in_locked_and_timed_satellite
do
|
merge_repo
|
in_locked_and_timed_satellite
do
|
merge_repo
|
prepare_satellite!
(
merge_repo
)
prepare_satellite!
(
merge_repo
)
update_satellite_source_and_target!
(
merge_repo
)
update_satellite_source_and_target!
(
merge_repo
)
patch
=
merge_repo
.
git
.
format_patch
(
default_options
({
stdout:
true
}),
"origin/
#{
merge_request
.
target_branch
}
..source/
#{
merge_request
.
source_branch
}
"
)
patch
=
merge_repo
.
git
.
format_patch
(
default_options
({
stdout:
true
}),
"origin/
#{
merge_request
.
target_branch
}
..source/
#{
merge_request
.
source_branch
}
"
)
end
end
rescue
Grit
::
Git
::
CommandFailed
=>
ex
rescue
Grit
::
Git
::
CommandFailed
=>
ex
handle_exception
(
ex
)
handle_exception
(
ex
)
...
@@ -128,7 +128,7 @@ module Gitlab
...
@@ -128,7 +128,7 @@ module Gitlab
# merge the source branch into the satellite
# merge the source branch into the satellite
# will raise CommandFailed when merge fails
# will raise CommandFailed when merge fails
repo
.
git
.
merge
(
default_options
({
no_ff:
true
}),
"-m
#{
message
}
"
,
"source/
#{
merge_request
.
source_branch
}
"
)
repo
.
git
.
merge
(
default_options
({
no_ff:
true
}),
"-m
#{
message
}
"
,
"source/
#{
merge_request
.
source_branch
}
"
)
rescue
Grit
::
Git
::
CommandFailed
=>
ex
rescue
Grit
::
Git
::
CommandFailed
=>
ex
handle_exception
(
ex
)
handle_exception
(
ex
)
end
end
...
@@ -137,7 +137,7 @@ module Gitlab
...
@@ -137,7 +137,7 @@ module Gitlab
def
update_satellite_source_and_target!
(
repo
)
def
update_satellite_source_and_target!
(
repo
)
repo
.
remote_add
(
'source'
,
merge_request
.
source_project
.
repository
.
path_to_repo
)
repo
.
remote_add
(
'source'
,
merge_request
.
source_project
.
repository
.
path_to_repo
)
repo
.
remote_fetch
(
'source'
)
repo
.
remote_fetch
(
'source'
)
repo
.
git
.
checkout
(
default_options
({
b:
true
}),
merge_request
.
target_branch
,
"origin/
#{
merge_request
.
target_branch
}
"
)
repo
.
git
.
checkout
(
default_options
({
b:
true
}),
merge_request
.
target_branch
,
"origin/
#{
merge_request
.
target_branch
}
"
)
rescue
Grit
::
Git
::
CommandFailed
=>
ex
rescue
Grit
::
Git
::
CommandFailed
=>
ex
handle_exception
(
ex
)
handle_exception
(
ex
)
end
end
...
...
lib/gitlab/satellite/satellite.rb
View file @
e8905826
...
@@ -98,13 +98,13 @@ module Gitlab
...
@@ -98,13 +98,13 @@ module Gitlab
if
heads
.
include?
PARKING_BRANCH
if
heads
.
include?
PARKING_BRANCH
repo
.
git
.
checkout
({},
PARKING_BRANCH
)
repo
.
git
.
checkout
({},
PARKING_BRANCH
)
else
else
repo
.
git
.
checkout
(
default_options
({
b:
true
}),
PARKING_BRANCH
)
repo
.
git
.
checkout
(
default_options
({
b:
true
}),
PARKING_BRANCH
)
end
end
# remove the parking branch from the list of heads ...
# remove the parking branch from the list of heads ...
heads
.
delete
(
PARKING_BRANCH
)
heads
.
delete
(
PARKING_BRANCH
)
# ... and delete all others
# ... and delete all others
heads
.
each
{
|
head
|
repo
.
git
.
branch
(
default_options
({
D
:
true
}),
head
)
}
heads
.
each
{
|
head
|
repo
.
git
.
branch
(
default_options
({
D
:
true
}),
head
)
}
end
end
# Deletes all remotes except origin
# Deletes all remotes except origin
...
@@ -126,7 +126,7 @@ module Gitlab
...
@@ -126,7 +126,7 @@ module Gitlab
end
end
def
default_options
(
options
=
{})
def
default_options
(
options
=
{})
{
raise:
true
,
timeout:
true
}.
merge
(
options
)
{
raise:
true
,
timeout:
true
}.
merge
(
options
)
end
end
# Create directory for storing
# Create directory for storing
...
...
lib/gitlab/upgrader.rb
View file @
e8905826
...
@@ -62,7 +62,7 @@ module Gitlab
...
@@ -62,7 +62,7 @@ module Gitlab
end
end
def
env
def
env
{
'RAILS_ENV'
=>
'production'
}
{
'RAILS_ENV'
=>
'production'
}
end
end
def
upgrade
def
upgrade
...
...
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