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
a086aa81
Commit
a086aa81
authored
Apr 03, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
5665fd9f
e604344c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
9 deletions
+25
-9
app/models/merge_request.rb
app/models/merge_request.rb
+10
-9
changelogs/unreleased/55268-exclude-system-notes-from-commits-in-mr.yml
...eleased/55268-exclude-system-notes-from-commits-in-mr.yml
+5
-0
doc/api/runners.md
doc/api/runners.md
+2
-0
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+8
-0
No files found.
app/models/merge_request.rb
View file @
a086aa81
...
...
@@ -860,15 +860,6 @@ class MergeRequest < ApplicationRecord
end
def
related_notes
# Fetch comments only from last 100 commits
commits_for_notes_limit
=
100
commit_ids
=
commit_shas
.
take
(
commits_for_notes_limit
)
commit_notes
=
Note
.
except
(
:order
)
.
where
(
project_id:
[
source_project_id
,
target_project_id
])
.
for_commit_id
(
commit_ids
)
# We're using a UNION ALL here since this results in better performance
# compared to using OR statements. We're using UNION ALL since the queries
# used won't produce any duplicates (e.g. a note for a commit can't also be
...
...
@@ -880,6 +871,16 @@ class MergeRequest < ApplicationRecord
alias_method
:discussion_notes
,
:related_notes
def
commit_notes
# Fetch comments only from last 100 commits
commit_ids
=
commit_shas
.
take
(
100
)
Note
.
user
.
where
(
project_id:
[
source_project_id
,
target_project_id
])
.
for_commit_id
(
commit_ids
)
end
def
mergeable_discussions_state?
return
true
unless
project
.
only_allow_merge_if_all_discussions_are_resolved?
...
...
changelogs/unreleased/55268-exclude-system-notes-from-commits-in-mr.yml
0 → 100644
View file @
a086aa81
---
title
:
Exclude system notes from commits in merge request discussions
merge_request
:
26396
author
:
type
:
fixed
doc/api/runners.md
View file @
a086aa81
...
...
@@ -256,6 +256,8 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://git
## List runner's jobs
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15432) in GitLab 10.3.
List jobs that are being processed or were processed by specified Runner.
```
...
...
spec/models/merge_request_spec.rb
View file @
a086aa81
...
...
@@ -806,6 +806,14 @@ describe MergeRequest do
expect
(
merge_request
.
commits
).
not_to
be_empty
expect
(
merge_request
.
related_notes
.
count
).
to
eq
(
3
)
end
it
"excludes system notes for commits"
do
system_note
=
create
(
:note_on_commit
,
:system
,
commit_id:
merge_request
.
commits
.
first
.
id
,
project:
merge_request
.
project
)
expect
(
merge_request
.
related_notes
.
count
).
to
eq
(
2
)
expect
(
merge_request
.
related_notes
).
not_to
include
(
system_note
)
end
end
describe
'#for_fork?'
do
...
...
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