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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3568fd86
Commit
3568fd86
authored
Sep 21, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 8-0-stable
parents
f3837d05
eb5fd3f8
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
311 additions
and
232 deletions
+311
-232
app/controllers/projects/compare_controller.rb
app/controllers/projects/compare_controller.rb
+6
-4
app/services/compare_service.rb
app/services/compare_service.rb
+4
-1
app/views/projects/milestones/_form.html.haml
app/views/projects/milestones/_form.html.haml
+1
-1
app/views/projects/wikis/_form.html.haml
app/views/projects/wikis/_form.html.haml
+1
-1
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+1
-1
doc/migrate_ci_to_ce/README.md
doc/migrate_ci_to_ce/README.md
+264
-220
spec/controllers/projects/compare_controller_spec.rb
spec/controllers/projects/compare_controller_spec.rb
+26
-0
spec/models/ci/variable_spec.rb
spec/models/ci/variable_spec.rb
+2
-1
spec/models/ci/web_hook_spec.rb
spec/models/ci/web_hook_spec.rb
+2
-1
spec/requests/ci/api/projects_spec.rb
spec/requests/ci/api/projects_spec.rb
+2
-1
spec/services/ci/create_project_service_spec.rb
spec/services/ci/create_project_service_spec.rb
+2
-1
No files found.
app/controllers/projects/compare_controller.rb
View file @
3568fd86
...
@@ -16,10 +16,12 @@ class Projects::CompareController < Projects::ApplicationController
...
@@ -16,10 +16,12 @@ class Projects::CompareController < Projects::ApplicationController
compare_result
=
CompareService
.
new
.
compare_result
=
CompareService
.
new
.
execute
(
@project
,
head_ref
,
@project
,
base_ref
)
execute
(
@project
,
head_ref
,
@project
,
base_ref
)
@commits
=
compare_result
.
commits
if
compare_result
@diffs
=
compare_result
.
diffs
@commits
=
compare_result
.
commits
@commit
=
@commits
.
last
@diffs
=
compare_result
.
diffs
@line_notes
=
[]
@commit
=
@commits
.
last
@line_notes
=
[]
end
end
end
def
create
def
create
...
...
app/services/compare_service.rb
View file @
3568fd86
...
@@ -4,7 +4,10 @@ require 'securerandom'
...
@@ -4,7 +4,10 @@ require 'securerandom'
# and return Gitlab::CompareResult object that responds to commits and diffs
# and return Gitlab::CompareResult object that responds to commits and diffs
class
CompareService
class
CompareService
def
execute
(
source_project
,
source_branch
,
target_project
,
target_branch
)
def
execute
(
source_project
,
source_branch
,
target_project
,
target_branch
)
source_sha
=
source_project
.
commit
(
source_branch
).
sha
source_commit
=
source_project
.
commit
(
source_branch
)
return
unless
source_commit
source_sha
=
source_commit
.
sha
# If compare with other project we need to fetch ref first
# If compare with other project we need to fetch ref first
unless
target_project
==
source_project
unless
target_project
==
source_project
...
...
app/views/projects/milestones/_form.html.haml
View file @
3568fd86
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
.form-group.milestone-description
.form-group.milestone-description
=
f
.
label
:description
,
"Description"
,
class:
"control-label"
=
f
.
label
:description
,
"Description"
,
class:
"control-label"
.col-sm-10
.col-sm-10
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"
wiki
"
}
do
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"
md-preview
"
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :description
,
classes:
'description form-control'
=
render
'projects/zen'
,
f:
f
,
attr: :description
,
classes:
'description form-control'
.hint
.hint
.pull-left
Milestones are parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_page_path
(
"markdown"
,
"markdown"
),
target:
'_blank'
}
.
.pull-left
Milestones are parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_page_path
(
"markdown"
,
"markdown"
),
target:
'_blank'
}
.
...
...
app/views/projects/wikis/_form.html.haml
View file @
3568fd86
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
.form-group.wiki-content
.form-group.wiki-content
=
f
.
label
:content
,
class:
'control-label'
=
f
.
label
:content
,
class:
'control-label'
.col-sm-10
.col-sm-10
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"
wiki
"
}
do
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"
md-preview
"
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :content
,
classes:
'description form-control'
=
render
'projects/zen'
,
f:
f
,
attr: :content
,
classes:
'description form-control'
.col-sm-12.hint
.col-sm-12.hint
.pull-left
Wiki content is parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_page_path
(
"markdown"
,
"markdown"
),
target:
'_blank'
}
.pull-left
Wiki content is parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_page_path
(
"markdown"
,
"markdown"
),
target:
'_blank'
}
...
...
app/views/shared/issuable/_form.html.haml
View file @
3568fd86
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
=
f
.
label
:description
,
'Description'
,
class:
'control-label'
=
f
.
label
:description
,
'Description'
,
class:
'control-label'
.col-sm-10
.col-sm-10
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"
wiki
"
,
referenced_users:
true
}
do
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"
md-preview
"
,
referenced_users:
true
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :description
,
=
render
'projects/zen'
,
f:
f
,
attr: :description
,
classes:
'description form-control'
classes:
'description form-control'
.col-sm-12.hint
.col-sm-12.hint
...
...
doc/migrate_ci_to_ce/README.md
View file @
3568fd86
This diff is collapsed.
Click to expand it.
spec/controllers/projects/compare_controller_spec.rb
View file @
3568fd86
...
@@ -22,4 +22,30 @@ describe Projects::CompareController do
...
@@ -22,4 +22,30 @@ describe Projects::CompareController do
expect
(
assigns
(
:diffs
).
length
).
to
be
>=
1
expect
(
assigns
(
:diffs
).
length
).
to
be
>=
1
expect
(
assigns
(
:commits
).
length
).
to
be
>=
1
expect
(
assigns
(
:commits
).
length
).
to
be
>=
1
end
end
describe
'non-existent refs'
do
it
'invalid source ref'
do
get
(
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
from:
'non-existent'
,
to:
ref_to
)
expect
(
response
).
to
be_success
expect
(
assigns
(
:diffs
)).
to
eq
([])
expect
(
assigns
(
:commits
)).
to
eq
([])
end
it
'invalid target ref'
do
get
(
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
from:
ref_from
,
to:
'non-existent'
)
expect
(
response
).
to
be_success
expect
(
assigns
(
:diffs
)).
to
eq
(
nil
)
expect
(
assigns
(
:commits
)).
to
eq
(
nil
)
end
end
end
end
spec/models/ci/variable_spec.rb
View file @
3568fd86
...
@@ -38,7 +38,8 @@ describe Ci::Variable do
...
@@ -38,7 +38,8 @@ describe Ci::Variable do
it
'fails to decrypt if iv is incorrect'
do
it
'fails to decrypt if iv is incorrect'
do
subject
.
encrypted_value_iv
=
nil
subject
.
encrypted_value_iv
=
nil
subject
.
instance_variable_set
(
:@value
,
nil
)
subject
.
instance_variable_set
(
:@value
,
nil
)
expect
{
subject
.
value
}.
to
raise_error
expect
{
subject
.
value
}.
to
raise_error
(
OpenSSL
::
Cipher
::
CipherError
,
'bad decrypt'
)
end
end
end
end
end
end
spec/models/ci/web_hook_spec.rb
View file @
3568fd86
...
@@ -56,7 +56,8 @@ describe Ci::WebHook do
...
@@ -56,7 +56,8 @@ describe Ci::WebHook do
it
"catches exceptions"
do
it
"catches exceptions"
do
expect
(
Ci
::
WebHook
).
to
receive
(
:post
).
and_raise
(
"Some HTTP Post error"
)
expect
(
Ci
::
WebHook
).
to
receive
(
:post
).
and_raise
(
"Some HTTP Post error"
)
expect
{
@web_hook
.
execute
(
@data
)
}.
to
raise_error
expect
{
@web_hook
.
execute
(
@data
)
}.
to
raise_error
(
RuntimeError
,
'Some HTTP Post error'
)
end
end
end
end
end
end
spec/requests/ci/api/projects_spec.rb
View file @
3568fd86
...
@@ -165,7 +165,8 @@ describe Ci::API::API do
...
@@ -165,7 +165,8 @@ describe Ci::API::API do
project
.
gl_project
.
team
<<
[
user
,
:master
]
project
.
gl_project
.
team
<<
[
user
,
:master
]
delete
ci_api
(
"/projects/
#{
project
.
id
}
"
),
options
delete
ci_api
(
"/projects/
#{
project
.
id
}
"
),
options
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
{
project
.
reload
}.
to
raise_error
expect
{
project
.
reload
}.
to
raise_error
(
ActiveRecord
::
RecordNotFound
)
end
end
it
"non-manager is not authorized"
do
it
"non-manager is not authorized"
do
...
...
spec/services/ci/create_project_service_spec.rb
View file @
3568fd86
...
@@ -15,7 +15,8 @@ describe Ci::CreateProjectService do
...
@@ -15,7 +15,8 @@ describe Ci::CreateProjectService do
context
'without project dump'
do
context
'without project dump'
do
it
'should raise exception'
do
it
'should raise exception'
do
expect
{
service
.
execute
(
current_user
,
''
,
''
)
}.
to
raise_error
expect
{
service
.
execute
(
current_user
,
''
,
''
)
}.
to
raise_error
(
NoMethodError
)
end
end
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