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
f4fbe9d6
Commit
f4fbe9d6
authored
Aug 02, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/security/gitlab@13-12-stable-ee
parent
ca0b403f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
1 deletion
+50
-1
Gemfile.lock
Gemfile.lock
+1
-1
app/services/issues/base_service.rb
app/services/issues/base_service.rb
+3
-0
spec/services/issues/create_service_spec.rb
spec/services/issues/create_service_spec.rb
+21
-0
spec/services/issues/update_service_spec.rb
spec/services/issues/update_service_spec.rb
+25
-0
No files found.
Gemfile.lock
View file @
f4fbe9d6
...
@@ -791,7 +791,7 @@ GEM
...
@@ -791,7 +791,7 @@ GEM
nenv (~> 0.1)
nenv (~> 0.1)
shellany (~> 0.0)
shellany (~> 0.0)
numerizer (0.2.0)
numerizer (0.2.0)
oauth (0.5.
4
)
oauth (0.5.
6
)
oauth2 (1.4.4)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
faraday (>= 0.8, < 2.0)
jwt (>= 1.0, < 3.0)
jwt (>= 1.0, < 3.0)
...
...
app/services/issues/base_service.rb
View file @
f4fbe9d6
...
@@ -47,6 +47,9 @@ module Issues
...
@@ -47,6 +47,9 @@ module Issues
params
.
delete
(
:created_at
)
unless
moved_issue
||
current_user
.
can?
(
:set_issue_created_at
,
project
)
params
.
delete
(
:created_at
)
unless
moved_issue
||
current_user
.
can?
(
:set_issue_created_at
,
project
)
params
.
delete
(
:updated_at
)
unless
moved_issue
||
current_user
.
can?
(
:set_issue_updated_at
,
project
)
params
.
delete
(
:updated_at
)
unless
moved_issue
||
current_user
.
can?
(
:set_issue_updated_at
,
project
)
# Only users with permission to handle error data can add it to issues
params
.
delete
(
:sentry_issue_attributes
)
unless
current_user
.
can?
(
:update_sentry_issue
,
project
)
issue
.
system_note_timestamp
=
params
[
:created_at
]
||
params
[
:updated_at
]
issue
.
system_note_timestamp
=
params
[
:created_at
]
||
params
[
:updated_at
]
end
end
...
...
spec/services/issues/create_service_spec.rb
View file @
f4fbe9d6
...
@@ -224,6 +224,27 @@ RSpec.describe Issues::CreateService do
...
@@ -224,6 +224,27 @@ RSpec.describe Issues::CreateService do
end
end
end
end
context
'when sentry identifier is given'
do
before
do
sentry_attributes
=
{
sentry_issue_attributes:
{
sentry_issue_identifier:
42
}
}
opts
.
merge!
(
sentry_attributes
)
end
context
'user is a guest'
do
before
do
project
.
add_guest
(
user
)
end
it
'does not assign the sentry error'
do
expect
(
issue
.
sentry_issue
).
to
eq
(
nil
)
end
end
it
'assigns the sentry error'
do
expect
(
issue
.
sentry_issue
).
to
be_kind_of
(
SentryIssue
)
end
end
it
'executes issue hooks when issue is not confidential'
do
it
'executes issue hooks when issue is not confidential'
do
opts
=
{
title:
'Title'
,
description:
'Description'
,
confidential:
false
}
opts
=
{
title:
'Title'
,
description:
'Description'
,
confidential:
false
}
...
...
spec/services/issues/update_service_spec.rb
View file @
f4fbe9d6
...
@@ -82,6 +82,31 @@ RSpec.describe Issues::UpdateService, :mailer do
...
@@ -82,6 +82,31 @@ RSpec.describe Issues::UpdateService, :mailer do
expect
(
issue
.
milestone
).
to
eq
milestone
expect
(
issue
.
milestone
).
to
eq
milestone
end
end
context
'when sentry identifier is given'
do
before
do
sentry_attributes
=
{
sentry_issue_attributes:
{
sentry_issue_identifier:
42
}
}
opts
.
merge!
(
sentry_attributes
)
end
it
'assigns the sentry error'
do
update_issue
(
opts
)
expect
(
issue
.
sentry_issue
).
to
be_kind_of
(
SentryIssue
)
end
context
'user is a guest'
do
before
do
project
.
add_guest
(
user
)
end
it
'does not assign the sentry error'
do
update_issue
(
opts
)
expect
(
issue
.
sentry_issue
).
to
eq
(
nil
)
end
end
end
context
'when issue type is not incident'
do
context
'when issue type is not incident'
do
it
'returns default severity'
do
it
'returns default severity'
do
update_issue
(
opts
)
update_issue
(
opts
)
...
...
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