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
f66ec1bc
Commit
f66ec1bc
authored
Oct 26, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
parents
ef85b31f
b6f8d010
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
47 additions
and
12 deletions
+47
-12
CHANGELOG
CHANGELOG
+1
-0
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+9
-0
app/models/merge_request.rb
app/models/merge_request.rb
+8
-2
app/models/repository.rb
app/models/repository.rb
+1
-1
app/views/projects/commits/_commit.html.haml
app/views/projects/commits/_commit.html.haml
+1
-2
app/views/projects/merge_requests/_merge_request.html.haml
app/views/projects/merge_requests/_merge_request.html.haml
+3
-0
app/views/projects/merge_requests/widget/_heading.html.haml
app/views/projects/merge_requests/widget/_heading.html.haml
+1
-1
app/views/shared/projects/_project.html.haml
app/views/shared/projects/_project.html.haml
+1
-3
features/project/merge_requests.feature
features/project/merge_requests.feature
+6
-0
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+13
-0
lib/gitlab/project_search_results.rb
lib/gitlab/project_search_results.rb
+1
-1
spec/lib/gitlab/project_search_results_spec.rb
spec/lib/gitlab/project_search_results_spec.rb
+2
-2
No files found.
CHANGELOG
View file @
f66ec1bc
...
...
@@ -11,6 +11,7 @@ v 8.2.0 (unreleased)
- Show "Empty Repository Page" for repository without branches (Artem V. Navrotskiy)
- Fix: Inability to reply to code comments in the MR view, if the MR comes from a fork
- Use git follow flag for commits page when retrieve history for file or directory
- Show merge request CI status on merge requests index page
v 8.1.0
- Ensure MySQL CI limits DB migrations occur after the fields have been created (Stan Hu)
...
...
app/helpers/ci_status_helper.rb
View file @
f66ec1bc
...
...
@@ -42,4 +42,13 @@ module CiStatusHelper
icon
(
icon_name
)
end
def
render_ci_status
(
ci_commit
)
link_to
ci_status_path
(
ci_commit
),
class:
"c
#{
ci_status_color
(
ci_commit
)
}
"
,
title:
"Build status:
#{
ci_commit
.
status
}
"
,
data:
{
toggle:
'tooltip'
,
placement:
'left'
}
do
ci_status_icon
(
ci_commit
)
end
end
end
app/models/merge_request.rb
View file @
f66ec1bc
...
...
@@ -159,11 +159,11 @@ class MergeRequest < ActiveRecord::Base
def
last_commit
merge_request_diff
?
merge_request_diff
.
last_commit
:
compare_commits
.
last
end
end
def
first_commit
merge_request_diff
?
merge_request_diff
.
first_commit
:
compare_commits
.
first
end
end
def
last_commit_short_sha
last_commit
.
short_id
...
...
@@ -470,4 +470,10 @@ class MergeRequest < ActiveRecord::Base
unlock_mr
if
locked?
end
end
def
ci_commit
if
last_commit
source_project
.
ci_commit
(
last_commit
.
id
)
end
end
end
app/models/repository.rb
View file @
f66ec1bc
...
...
@@ -496,7 +496,7 @@ class Repository
def
search_files
(
query
,
ref
)
offset
=
2
args
=
%W(git grep -i -n --before-context
#{
offset
}
--after-context
#{
offset
}
#{
query
}
#{
ref
||
root_ref
}
)
args
=
%W(git grep -i -n --before-context
#{
offset
}
--after-context
#{
offset
}
-e
#{
query
}
#{
ref
||
root_ref
}
)
Gitlab
::
Popen
.
popen
(
args
,
path_to_repo
).
first
.
scrub
.
split
(
/^--$/
)
end
...
...
app/views/projects/commits/_commit.html.haml
View file @
f66ec1bc
...
...
@@ -18,8 +18,7 @@
.pull-right
-
if
ci_commit
=
link_to
ci_status_path
(
ci_commit
),
class:
"c
#{
ci_status_color
(
ci_commit
)
}
"
do
=
ci_status_icon
(
ci_commit
)
=
render_ci_status
(
ci_commit
)
=
clipboard_button
=
link_to
commit
.
short_id
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
),
class:
"commit_short_id"
,
data:
{
clipboard_text:
commit
.
id
}
...
...
app/views/projects/merge_requests/_merge_request.html.haml
View file @
f66ec1bc
-
ci_commit
=
merge_request
.
ci_commit
%li
{
class:
mr_css_classes
(
merge_request
)
}
.merge-request-title
%span
.merge-request-title-text
...
...
@@ -6,6 +7,8 @@
-
merge_request
.
labels
.
each
do
|
label
|
=
link_to_label
(
label
,
project:
merge_request
.
project
)
.pull-right.light
-
if
ci_commit
=
render_ci_status
(
ci_commit
)
-
if
merge_request
.
merged?
%span
%i
.fa.fa-check
...
...
app/views/projects/merge_requests/widget/_heading.html.haml
View file @
f66ec1bc
-
ci_commit
=
@merge_request
.
source_project
.
ci_commit
(
@merge_request
.
source_sha
)
-
ci_commit
=
@merge_request
.
ci_commit
-
if
ci_commit
-
status
=
ci_commit
.
status
.mr-widget-heading
...
...
app/views/shared/projects/_project.html.haml
View file @
f66ec1bc
...
...
@@ -21,9 +21,7 @@
.project-controls
-
if
ci
&&
!
project
.
empty_repo?
&&
project
.
commit
-
if
ci_commit
=
project
.
ci_commit
(
project
.
commit
.
sha
)
=
link_to
ci_status_path
(
ci_commit
),
class:
"c
#{
ci_status_color
(
ci_commit
)
}
"
,
title:
"Build status:
#{
ci_commit
.
status
}
"
,
data:
{
toggle:
'tooltip'
,
placement:
'left'
}
do
=
ci_status_icon
(
ci_commit
)
=
render_ci_status
(
ci_commit
)
-
if
stars
%span
...
...
features/project/merge_requests.feature
View file @
f66ec1bc
...
...
@@ -10,6 +10,12 @@ Feature: Project Merge Requests
Then
I should see
"Bug NS-04"
in merge requests
And
I should not see
"Feature NS-03"
in merge requests
Scenario
:
I
should see CI status for merge requests
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
Given
"Bug NS-05"
has CI status
When
I visit project
"Shop"
merge requests page
Then
I should see merge request
"Bug NS-05"
with CI status
Scenario
:
I
should see rejected merge requests
Given
I click link
"Closed"
Then
I should see
"Feature NS-03"
in merge requests
...
...
features/steps/project/merge_requests.rb
View file @
f66ec1bc
...
...
@@ -338,6 +338,19 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
expect
(
page
).
to
have_content
(
'diff --git'
)
end
step
'"Bug NS-05" has CI status'
do
project
=
merge_request
.
source_project
project
.
enable_ci
ci_commit
=
create
:ci_commit
,
gl_project:
project
,
sha:
merge_request
.
last_commit
.
id
create
:ci_build
,
commit:
ci_commit
end
step
'I should see merge request "Bug NS-05" with CI status'
do
page
.
within
".mr-list"
do
expect
(
page
).
to
have_link
"Build status: pending"
end
end
def
merge_request
@merge_request
||=
MergeRequest
.
find_by!
(
title:
"Bug NS-05"
)
end
...
...
lib/gitlab/project_search_results.rb
View file @
f66ec1bc
...
...
@@ -9,7 +9,7 @@ module Gitlab
else
nil
end
@query
=
Shellwords
.
shellescape
(
query
)
if
query
.
present?
@query
=
query
end
def
objects
(
scope
,
page
=
nil
)
...
...
spec/lib/gitlab/project_search_results_spec.rb
View file @
f66ec1bc
...
...
@@ -9,7 +9,7 @@ describe Gitlab::ProjectSearchResults do
it
{
expect
(
results
.
project
).
to
eq
(
project
)
}
it
{
expect
(
results
.
repository_ref
).
to
be_nil
}
it
{
expect
(
results
.
query
).
to
eq
(
'hello
\\
world'
)
}
it
{
expect
(
results
.
query
).
to
eq
(
'hello world'
)
}
end
describe
'initialize with ref'
do
...
...
@@ -18,6 +18,6 @@ describe Gitlab::ProjectSearchResults do
it
{
expect
(
results
.
project
).
to
eq
(
project
)
}
it
{
expect
(
results
.
repository_ref
).
to
eq
(
ref
)
}
it
{
expect
(
results
.
query
).
to
eq
(
'hello
\\
world'
)
}
it
{
expect
(
results
.
query
).
to
eq
(
'hello world'
)
}
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