BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
150fc0cc
Commit
150fc0cc
authored
Nov 06, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into mentioned_inside_mr
parents
6d775dda
b33d4bc2
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
67 additions
and
54 deletions
+67
-54
base_tree_controller.rb
app/controllers/projects/base_tree_controller.rb
+0
-1
blame_controller.rb
app/controllers/projects/blame_controller.rb
+0
-1
blob_controller.rb
app/controllers/projects/blob_controller.rb
+0
-1
branches_controller.rb
app/controllers/projects/branches_controller.rb
+0
-1
commit_controller.rb
app/controllers/projects/commit_controller.rb
+0
-1
commits_controller.rb
app/controllers/projects/commits_controller.rb
+0
-1
compare_controller.rb
app/controllers/projects/compare_controller.rb
+0
-1
graphs_controller.rb
app/controllers/projects/graphs_controller.rb
+0
-1
network_controller.rb
app/controllers/projects/network_controller.rb
+0
-1
raw_controller.rb
app/controllers/projects/raw_controller.rb
+0
-1
refs_controller.rb
app/controllers/projects/refs_controller.rb
+0
-1
repositories_controller.rb
app/controllers/projects/repositories_controller.rb
+0
-1
tags_controller.rb
app/controllers/projects/tags_controller.rb
+0
-2
projects_controller.rb
app/controllers/projects_controller.rb
+0
-3
event.rb
app/models/event.rb
+0
-4
flowdock_service.rb
app/models/project_services/flowdock_service.rb
+1
-2
gemnasium_service.rb
app/models/project_services/gemnasium_service.rb
+1
-2
gitlab_ci_service.rb
app/models/project_services/gitlab_ci_service.rb
+2
-2
git_push_service.rb
app/services/git_push_service.rb
+3
-3
system_hooks_service.rb
app/services/system_hooks_service.rb
+1
-1
attachment_uploader.rb
app/uploaders/attachment_uploader.rb
+4
-0
new_ssh_key_email.html.haml
app/views/notify/new_ssh_key_email.html.haml
+1
-1
new_ssh_key_email.text.erb
app/views/notify/new_ssh_key_email.text.erb
+2
-2
_actions.html.haml
app/views/projects/blob/_actions.html.haml
+2
-1
installation.md
doc/install/installation.md
+1
-1
event_filters.rb
features/steps/dashboard/event_filters.rb
+1
-1
browse_files.rb
features/steps/project/source/browse_files.rb
+1
-1
project.rb
features/steps/shared/project.rb
+1
-1
repository.rb
lib/backup/repository.rb
+1
-1
shell.rake
lib/tasks/gitlab/shell.rake
+1
-1
event_spec.rb
spec/models/event_spec.rb
+1
-2
gitlab_ci_service_spec.rb
spec/models/gitlab_ci_service_spec.rb
+2
-2
repositories_spec.rb
spec/requests/api/repositories_spec.rb
+1
-2
git_push_service_spec.rb
spec/services/git_push_service_spec.rb
+1
-1
test_env.rb
spec/support/test_env.rb
+39
-6
No files found.
app/controllers/projects/base_tree_controller.rb
View file @
150fc0cc
class
Projects
::
BaseTreeController
<
Projects
::
ApplicationController
include
ExtractsPath
before_filter
:authorize_read_project!
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
end
...
...
app/controllers/projects/blame_controller.rb
View file @
150fc0cc
...
...
@@ -3,7 +3,6 @@ class Projects::BlameController < Projects::ApplicationController
include
ExtractsPath
# Authorize
before_filter
:authorize_read_project!
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
...
...
app/controllers/projects/blob_controller.rb
View file @
150fc0cc
...
...
@@ -3,7 +3,6 @@ class Projects::BlobController < Projects::ApplicationController
include
ExtractsPath
# Authorize
before_filter
:authorize_read_project!
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
before_filter
:authorize_push_code!
,
only:
[
:destroy
]
...
...
app/controllers/projects/branches_controller.rb
View file @
150fc0cc
class
Projects
::
BranchesController
<
Projects
::
ApplicationController
# Authorize
before_filter
:authorize_read_project!
before_filter
:require_non_empty_project
before_filter
:authorize_download_code!
...
...
app/controllers/projects/commit_controller.rb
View file @
150fc0cc
...
...
@@ -3,7 +3,6 @@
# Not to be confused with CommitsController, plural.
class
Projects
::
CommitController
<
Projects
::
ApplicationController
# Authorize
before_filter
:authorize_read_project!
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
before_filter
:commit
...
...
app/controllers/projects/commits_controller.rb
View file @
150fc0cc
...
...
@@ -4,7 +4,6 @@ class Projects::CommitsController < Projects::ApplicationController
include
ExtractsPath
# Authorize
before_filter
:authorize_read_project!
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
...
...
app/controllers/projects/compare_controller.rb
View file @
150fc0cc
class
Projects
::
CompareController
<
Projects
::
ApplicationController
# Authorize
before_filter
:authorize_read_project!
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
...
...
app/controllers/projects/graphs_controller.rb
View file @
150fc0cc
class
Projects
::
GraphsController
<
Projects
::
ApplicationController
# Authorize
before_filter
:authorize_read_project!
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
...
...
app/controllers/projects/network_controller.rb
View file @
150fc0cc
...
...
@@ -3,7 +3,6 @@ class Projects::NetworkController < Projects::ApplicationController
include
ApplicationHelper
# Authorize
before_filter
:authorize_read_project!
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
...
...
app/controllers/projects/raw_controller.rb
View file @
150fc0cc
...
...
@@ -3,7 +3,6 @@ class Projects::RawController < Projects::ApplicationController
include
ExtractsPath
# Authorize
before_filter
:authorize_read_project!
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
...
...
app/controllers/projects/refs_controller.rb
View file @
150fc0cc
...
...
@@ -2,7 +2,6 @@ class Projects::RefsController < Projects::ApplicationController
include
ExtractsPath
# Authorize
before_filter
:authorize_read_project!
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
...
...
app/controllers/projects/repositories_controller.rb
View file @
150fc0cc
class
Projects
::
RepositoriesController
<
Projects
::
ApplicationController
# Authorize
before_filter
:authorize_read_project!
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
...
...
app/controllers/projects/tags_controller.rb
View file @
150fc0cc
class
Projects
::
TagsController
<
Projects
::
ApplicationController
# Authorize
before_filter
:authorize_read_project!
before_filter
:require_non_empty_project
before_filter
:authorize_download_code!
before_filter
:authorize_push_code!
,
only:
[
:create
]
before_filter
:authorize_admin_project!
,
only:
[
:destroy
]
...
...
app/controllers/projects_controller.rb
View file @
150fc0cc
...
...
@@ -4,7 +4,6 @@ class ProjectsController < ApplicationController
before_filter
:repository
,
except:
[
:new
,
:create
]
# Authorize
before_filter
:authorize_read_project!
,
except:
[
:index
,
:new
,
:create
]
before_filter
:authorize_admin_project!
,
only:
[
:edit
,
:update
,
:destroy
,
:transfer
,
:archive
,
:unarchive
,
:retry_import
]
layout
'navless'
,
only:
[
:new
,
:create
,
:fork
]
...
...
@@ -52,8 +51,6 @@ class ProjectsController < ApplicationController
return
end
return
authenticate_user!
unless
@project
.
public?
||
current_user
limit
=
(
params
[
:limit
]
||
20
).
to_i
@events
=
@project
.
events
.
recent
@events
=
event_filter
.
apply_filter
(
@events
)
...
...
app/models/event.rb
View file @
150fc0cc
...
...
@@ -186,10 +186,6 @@ class Event < ActiveRecord::Base
data
[
:ref
][
"refs/heads"
]
end
def
new_branch?
commit_from
=~
/^00000/
end
def
new_ref?
commit_from
=~
/^00000/
end
...
...
app/models/project_services/flowdock_service.rb
View file @
150fc0cc
...
...
@@ -37,13 +37,12 @@ class FlowdockService < Service
end
def
execute
(
push_data
)
repo_path
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
,
"
#{
project
.
path_with_namespace
}
.git"
)
Flowdock
::
Git
.
post
(
push_data
[
:ref
],
push_data
[
:before
],
push_data
[
:after
],
token:
token
,
repo:
repo_path
,
repo:
project
.
repository
.
path_to_repo
,
repo_url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
"
,
commit_url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
/commit/%s"
,
diff_url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
/compare/%s...%s"
,
...
...
app/models/project_services/gemnasium_service.rb
View file @
150fc0cc
...
...
@@ -38,14 +38,13 @@ class GemnasiumService < Service
end
def
execute
(
push_data
)
repo_path
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
,
"
#{
project
.
path_with_namespace
}
.git"
)
Gemnasium
::
GitlabService
.
execute
(
ref:
push_data
[
:ref
],
before:
push_data
[
:before
],
after:
push_data
[
:after
],
token:
token
,
api_key:
api_key
,
repo:
repo_path
repo:
project
.
repository
.
path_to_repo
)
end
end
app/models/project_services/gitlab_ci_service.rb
View file @
150fc0cc
...
...
@@ -28,7 +28,7 @@ class GitlabCiService < CiService
end
def
commit_status_path
(
sha
)
project_url
+
"/
build
s/
#{
sha
}
/status.json?token=
#{
token
}
"
project_url
+
"/
commit
s/
#{
sha
}
/status.json?token=
#{
token
}
"
end
def
get_ci_build
(
sha
)
...
...
@@ -55,7 +55,7 @@ class GitlabCiService < CiService
end
def
build_page
(
sha
)
project_url
+
"/
build
s/
#{
sha
}
"
project_url
+
"/
commit
s/
#{
sha
}
"
end
def
builds_path
...
...
app/services/git_push_service.rb
View file @
150fc0cc
...
...
@@ -160,19 +160,19 @@ class GitPushService
ref_parts
=
ref
.
split
(
'/'
)
# Return if this is not a push to a branch (e.g. new commits)
ref_parts
[
1
]
=~
/heads/
&&
oldrev
!=
"0000000000000000000000000000000000000000"
ref_parts
[
1
]
=~
/heads/
&&
oldrev
!=
Gitlab
::
Git
::
BLANK_SHA
end
def
push_to_new_branch?
(
ref
,
oldrev
)
ref_parts
=
ref
.
split
(
'/'
)
ref_parts
[
1
]
=~
/heads/
&&
oldrev
==
"0000000000000000000000000000000000000000"
ref_parts
[
1
]
=~
/heads/
&&
oldrev
==
Gitlab
::
Git
::
BLANK_SHA
end
def
push_remove_branch?
(
ref
,
newrev
)
ref_parts
=
ref
.
split
(
'/'
)
ref_parts
[
1
]
=~
/heads/
&&
newrev
==
"0000000000000000000000000000000000000000"
ref_parts
[
1
]
=~
/heads/
&&
newrev
==
Gitlab
::
Git
::
BLANK_SHA
end
def
push_to_branch?
(
ref
)
...
...
app/services/system_hooks_service.rb
View file @
150fc0cc
...
...
@@ -18,7 +18,7 @@ class SystemHooksService
def
build_event_data
(
model
,
event
)
data
=
{
event_name:
build_event_name
(
model
,
event
),
created_at:
model
.
created_at
created_at:
model
.
created_at
.
xmlschema
}
case
model
...
...
app/uploaders/attachment_uploader.rb
View file @
150fc0cc
...
...
@@ -26,6 +26,10 @@ class AttachmentUploader < CarrierWave::Uploader::Base
Gitlab
.
config
.
gitlab
.
relative_url_root
+
"/files/
#{
model
.
class
.
to_s
.
underscore
}
/
#{
model
.
id
}
/
#{
file
.
filename
}
"
end
def
url
Gitlab
.
config
.
gitlab
.
relative_url_root
+
super
unless
super
.
nil?
end
def
file_storage?
self
.
class
.
storage
==
CarrierWave
::
Storage
::
File
end
...
...
app/views/notify/new_ssh_key_email.html.haml
View file @
150fc0cc
...
...
@@ -6,5 +6,5 @@
title:
%code
=
@key
.
title
%p
If this key was added in error, you can remove it
here:
If this key was added in error, you can remove it
under
=
link_to
"SSH Keys"
,
profile_keys_url
app/views/notify/new_ssh_key_email.text.erb
View file @
150fc0cc
...
...
@@ -2,6 +2,6 @@ Hi <%= @user.name %>!
A new public key was added to your account:
title..................
<%=
@key
.
title
%>
Title:
<%=
@key
.
title
%>
If this key was added in error, you can remove it
here:
<%=
profile_keys_url
%>
If this key was added in error, you can remove it
at
<%=
profile_keys_url
%>
app/views/projects/blob/_actions.html.haml
View file @
150fc0cc
...
...
@@ -23,5 +23,6 @@
tree_join
(
@commit
.
sha
,
@path
)),
class:
'btn btn-small'
-
if
allowed_tree_edit?
=
link_to
'#modal-remove-blob'
,
class:
"remove-blob btn btn-small btn-remove"
,
"data-toggle"
=>
"modal"
do
=
button_tag
class:
'remove-blob btn btn-small btn-remove'
,
'data-toggle'
=>
'modal'
,
'data-target'
=>
'#modal-remove-blob'
do
Remove
doc/install/installation.md
View file @
150fc0cc
...
...
@@ -199,7 +199,7 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
# Make sure GitLab can write to the log/ and tmp/ directories
sudo chown -R git log/
sudo chown -R git tmp/
sudo chmod -R u+rwX log/
sudo chmod -R u+rwX
,go-w
log/
sudo chmod -R u+rwX tmp/
# Create directory for satellites
...
...
features/steps/dashboard/event_filters.rb
View file @
150fc0cc
...
...
@@ -29,7 +29,7 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps
step
'this project has push event'
do
data
=
{
before:
"0000000000000000000000000000000000000000"
,
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
ref:
"refs/heads/new_design"
,
user_id:
@user
.
id
,
...
...
features/steps/project/source/browse_files.rb
View file @
150fc0cc
...
...
@@ -78,7 +78,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step
'I click on "Remove"'
do
click_
link
'Remove'
click_
button
'Remove'
end
step
'I click on "Remove file"'
do
...
...
features/steps/shared/project.rb
View file @
150fc0cc
...
...
@@ -32,7 +32,7 @@ module SharedProject
@project
=
Project
.
find_by
(
name:
"Shop"
)
data
=
{
before:
"0000000000000000000000000000000000000000"
,
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
"6d394385cf567f80a8fd85055db1ab4c5295806f"
,
ref:
"refs/heads/fix"
,
user_id:
@user
.
id
,
...
...
lib/backup/repository.rb
View file @
150fc0cc
...
...
@@ -91,7 +91,7 @@ module Backup
protected
def
path_to_repo
(
project
)
File
.
join
(
repos_path
,
project
.
path_with_namespace
+
'.git'
)
project
.
repository
.
path_to_repo
end
def
path_to_bundle
(
project
)
...
...
lib/tasks/gitlab/shell.rake
View file @
150fc0cc
...
...
@@ -76,7 +76,7 @@ namespace :gitlab do
desc
"GITLAB | Build missing projects"
task
build_missing_projects: :environment
do
Project
.
find_each
(
batch_size:
1000
)
do
|
project
|
path_to_repo
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
,
"
#{
project
.
path_with_namespace
}
.git"
)
path_to_repo
=
project
.
repository
.
path_to_repo
if
File
.
exists?
(
path_to_repo
)
print
'-'
else
...
...
spec/models/event_spec.rb
View file @
150fc0cc
...
...
@@ -36,7 +36,7 @@ describe Event do
@user
=
project
.
owner
data
=
{
before:
"0000000000000000000000000000000000000000"
,
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
ref:
"refs/heads/master"
,
user_id:
@user
.
id
,
...
...
@@ -60,7 +60,6 @@ describe Event do
it
{
@event
.
push?
.
should
be_true
}
it
{
@event
.
proper?
.
should
be_true
}
it
{
@event
.
new_branch?
.
should
be_true
}
it
{
@event
.
tag?
.
should
be_false
}
it
{
@event
.
branch_name
.
should
==
"master"
}
it
{
@event
.
author
.
should
==
@user
}
...
...
spec/models/gitlab_ci_service_spec.rb
View file @
150fc0cc
...
...
@@ -34,11 +34,11 @@ describe GitlabCiService do
end
describe
:commit_status_path
do
it
{
@service
.
commit_status_path
(
"2ab7834c"
).
should
==
"http://ci.gitlab.org/projects/2/
build
s/2ab7834c/status.json?token=verySecret"
}
it
{
@service
.
commit_status_path
(
"2ab7834c"
).
should
==
"http://ci.gitlab.org/projects/2/
commit
s/2ab7834c/status.json?token=verySecret"
}
end
describe
:build_page
do
it
{
@service
.
build_page
(
"2ab7834c"
).
should
==
"http://ci.gitlab.org/projects/2/
build
s/2ab7834c"
}
it
{
@service
.
build_page
(
"2ab7834c"
).
should
==
"http://ci.gitlab.org/projects/2/
commit
s/2ab7834c"
}
end
end
end
spec/requests/api/repositories_spec.rb
View file @
150fc0cc
...
...
@@ -37,8 +37,7 @@ describe API::API, api: true do
context
'annotated tag'
do
it
'should create a new annotated tag'
do
# Identity must be set in .gitconfig to create annotated tag.
repo_path
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
,
project
.
path_with_namespace
+
'.git'
)
repo_path
=
project
.
repository
.
path_to_repo
system
(
*
%W(git --git-dir=
#{
repo_path
}
config user.name
#{
user
.
name
}
)
)
system
(
*
%W(git --git-dir=
#{
repo_path
}
config user.email
#{
user
.
email
}
)
)
...
...
spec/services/git_push_service_spec.rb
View file @
150fc0cc
...
...
@@ -8,7 +8,7 @@ describe GitPushService do
let
(
:service
)
{
GitPushService
.
new
}
before
do
@blankrev
=
'0000000000000000000000000000000000000000'
@blankrev
=
Gitlab
::
Git
::
BLANK_SHA
@oldrev
=
sample_commit
.
parent_id
@newrev
=
sample_commit
.
id
@ref
=
'refs/heads/master'
...
...
spec/support/test_env.rb
View file @
150fc0cc
...
...
@@ -3,6 +3,16 @@ require 'rspec/mocks'
module
TestEnv
extend
self
# When developing the seed repository, comment out the branch you will modify.
BRANCH_SHA
=
{
'feature'
=>
'0b4bc9a'
,
'feature_conflict'
=>
'bb5206f'
,
'fix'
=>
'12d65c8'
,
'improve/awesome'
=>
'5937ac0'
,
'markdown'
=>
'0ed8c6c'
,
'master'
=>
'5937ac0'
}
# Test environment
#
# See gitlab.yml.example test section for paths
...
...
@@ -18,13 +28,13 @@ module TestEnv
if
File
.
directory?
(
tmp_test_path
)
Dir
.
entries
(
tmp_test_path
).
each
do
|
entry
|
unless
[
'.'
,
'..'
,
'gitlab-shell'
].
include?
(
entry
)
unless
[
'.'
,
'..'
,
'gitlab-shell'
,
factory_repo_name
].
include?
(
entry
)
FileUtils
.
rm_r
(
File
.
join
(
tmp_test_path
,
entry
))
end
end
end
FileUtils
.
mkdir_p
(
tmp_test
_path
)
FileUtils
.
mkdir_p
(
repos
_path
)
# Setup GitLab shell for test instance
setup_gitlab_shell
...
...
@@ -49,13 +59,32 @@ module TestEnv
clone_url
=
"https://gitlab.com/gitlab-org/
#{
factory_repo_name
}
.git"
unless
File
.
directory?
(
factory_repo_path
)
git_cmd
=
%W(git clone --bare
#{
clone_url
}
#{
factory_repo_path
}
)
system
(
*
git_cmd
)
system
(
*
%W(git clone
#{
clone_url
}
#{
factory_repo_path
}
)
)
end
Dir
.
chdir
(
factory_repo_path
)
do
BRANCH_SHA
.
each
do
|
branch
,
sha
|
# Try to reset without fetching to avoid using the network.
reset
=
%W(git update-ref refs/heads/
#{
branch
}
#{
sha
}
)
unless
system
(
*
reset
)
if
system
(
*
%w(git fetch origin)
)
unless
system
(
*
reset
)
raise
'The fetched test seed '
\
'does not contain the required revision.'
end
else
raise
'Could not fetch test seed repository.'
end
end
end
end
# We must copy bare repositories because we will push to them.
system
(
*
%W(git clone --bare
#{
factory_repo_path
}
#{
factory_repo_path_bare
}
)
)
end
def
copy_repo
(
project
)
base_repo_path
=
File
.
expand_path
(
factory_repo_path
)
base_repo_path
=
File
.
expand_path
(
factory_repo_path
_bare
)
target_repo_path
=
File
.
expand_path
(
repos_path
+
"/
#{
project
.
namespace
.
path
}
/
#{
project
.
path
}
.git"
)
FileUtils
.
mkdir_p
(
target_repo_path
)
FileUtils
.
cp_r
(
"
#{
base_repo_path
}
/."
,
target_repo_path
)
...
...
@@ -69,7 +98,11 @@ module TestEnv
private
def
factory_repo_path
@factory_repo_path
||=
repos_path
+
"/root/
#{
factory_repo_name
}
.git"
@factory_repo_path
||=
Rails
.
root
.
join
(
'tmp'
,
'tests'
,
factory_repo_name
)
end
def
factory_repo_path_bare
factory_repo_path
.
to_s
+
'_bare'
end
def
factory_repo_name
...
...
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