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
a2eec9fb
Commit
a2eec9fb
authored
Oct 14, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '3435-backport-9-5' into 'security-9-5'
3435 backport for 9.5 See merge request gitlab/gitlabhq!2207
parents
099928ad
4d1d4151
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
23 deletions
+2
-23
app/models/note.rb
app/models/note.rb
+1
-1
app/services/system_note_service.rb
app/services/system_note_service.rb
+0
-7
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+1
-1
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+0
-14
No files found.
app/models/note.rb
View file @
a2eec9fb
...
...
@@ -144,7 +144,7 @@ class Note < ActiveRecord::Base
end
def
cross_reference?
system
?
&&
SystemNoteService
.
cross_reference?
(
note
)
system
?
&&
matches_cross_reference_regex?
end
def
diff_note?
...
...
app/services/system_note_service.rb
View file @
a2eec9fb
...
...
@@ -162,7 +162,6 @@ module SystemNoteService
# "changed time estimate to 3d 5h"
#
# Returns the created Note object
def
change_time_estimate
(
noteable
,
project
,
author
)
parsed_time
=
Gitlab
::
TimeTrackingFormatter
.
output
(
noteable
.
time_estimate
)
body
=
if
noteable
.
time_estimate
==
0
...
...
@@ -188,7 +187,6 @@ module SystemNoteService
# "added 2h 30m of time spent"
#
# Returns the created Note object
def
change_time_spent
(
noteable
,
project
,
author
)
time_spent
=
noteable
.
time_spent
...
...
@@ -451,10 +449,6 @@ module SystemNoteService
end
end
def
cross_reference?
(
note_text
)
note_text
=~
/\A
#{
cross_reference_note_prefix
}
/i
end
# Check if a cross-reference is disallowed
#
# This method prevents adding a "mentioned in !1" note on every single commit
...
...
@@ -484,7 +478,6 @@ module SystemNoteService
# mentioner - Mentionable object
#
# Returns Boolean
def
cross_reference_exists?
(
noteable
,
mentioner
)
# Initial scope should be system notes of this noteable type
notes
=
Note
.
system
.
where
(
noteable_type:
noteable
.
class
)
...
...
spec/controllers/projects/issues_controller_spec.rb
View file @
a2eec9fb
...
...
@@ -226,7 +226,7 @@ describe Projects::IssuesController do
id:
issue
.
iid
,
issue:
{
assignee_ids:
[
assignee
.
id
]
},
format: :json
body
=
JSON
.
parse
(
response
.
body
)
body
=
json_response
expect
(
body
[
'assignees'
].
first
.
keys
)
.
to
match_array
(
%w(id name username avatar_url state web_url)
)
...
...
spec/services/system_note_service_spec.rb
View file @
a2eec9fb
...
...
@@ -530,20 +530,6 @@ describe SystemNoteService do
end
end
describe
'.cross_reference?'
do
it
'is truthy when text begins with expected text'
do
expect
(
described_class
.
cross_reference?
(
'mentioned in something'
)).
to
be_truthy
end
it
'is truthy when text begins with legacy capitalized expected text'
do
expect
(
described_class
.
cross_reference?
(
'mentioned in something'
)).
to
be_truthy
end
it
'is falsey when text does not begin with expected text'
do
expect
(
described_class
.
cross_reference?
(
'this is a note'
)).
to
be_falsey
end
end
describe
'.cross_reference_disallowed?'
do
context
'when mentioner is not a MergeRequest'
do
it
'is falsey'
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