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
iv
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
compare_result
=
CompareService
.
new
.
execute
(
@project
,
head_ref
,
@project
,
base_ref
)
@commits
=
compare_result
.
commits
@diffs
=
compare_result
.
diffs
@commit
=
@commits
.
last
@line_notes
=
[]
if
compare_result
@commits
=
compare_result
.
commits
@diffs
=
compare_result
.
diffs
@commit
=
@commits
.
last
@line_notes
=
[]
end
end
def
create
...
...
app/services/compare_service.rb
View file @
3568fd86
...
...
@@ -4,7 +4,10 @@ require 'securerandom'
# and return Gitlab::CompareResult object that responds to commits and diffs
class
CompareService
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
unless
target_project
==
source_project
...
...
app/views/projects/milestones/_form.html.haml
View file @
3568fd86
...
...
@@ -21,7 +21,7 @@
.form-group.milestone-description
=
f
.
label
:description
,
"Description"
,
class:
"control-label"
.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'
.hint
.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 @@
.form-group.wiki-content
=
f
.
label
:content
,
class:
'control-label'
.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'
.col-sm-12.hint
.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 @@
=
f
.
label
:description
,
'Description'
,
class:
'control-label'
.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
,
classes:
'description form-control'
.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
expect
(
assigns
(
:diffs
).
length
).
to
be
>=
1
expect
(
assigns
(
:commits
).
length
).
to
be
>=
1
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
spec/models/ci/variable_spec.rb
View file @
3568fd86
...
...
@@ -38,7 +38,8 @@ describe Ci::Variable do
it
'fails to decrypt if iv is incorrect'
do
subject
.
encrypted_value_iv
=
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
spec/models/ci/web_hook_spec.rb
View file @
3568fd86
...
...
@@ -56,7 +56,8 @@ describe Ci::WebHook do
it
"catches exceptions"
do
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
spec/requests/ci/api/projects_spec.rb
View file @
3568fd86
...
...
@@ -165,7 +165,8 @@ describe Ci::API::API do
project
.
gl_project
.
team
<<
[
user
,
:master
]
delete
ci_api
(
"/projects/
#{
project
.
id
}
"
),
options
expect
(
response
.
status
).
to
eq
(
200
)
expect
{
project
.
reload
}.
to
raise_error
expect
{
project
.
reload
}.
to
raise_error
(
ActiveRecord
::
RecordNotFound
)
end
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
context
'without project dump'
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
...
...
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