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
0617fb47
Commit
0617fb47
authored
Apr 26, 2021
by
Jan Provaznik
Committed by
Heinrich Lee Yu
Apr 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new issue type for requirements
parent
ac7a6af6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
5 deletions
+11
-5
app/models/issue.rb
app/models/issue.rb
+2
-1
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-0
ee/app/services/ee/issues/build_service.rb
ee/app/services/ee/issues/build_service.rb
+3
-1
ee/spec/services/issues/build_service_spec.rb
ee/spec/services/issues/build_service_spec.rb
+5
-3
No files found.
app/models/issue.rb
View file @
0617fb47
...
...
@@ -87,7 +87,8 @@ class Issue < ApplicationRecord
enum
issue_type:
{
issue:
0
,
incident:
1
,
test_case:
2
## EE-only
test_case:
2
,
## EE-only
requirement:
3
## EE-only
}
alias_method
:issuing_parent
,
:project
...
...
doc/api/graphql/reference/index.md
View file @
0617fb47
...
...
@@ -13385,6 +13385,7 @@ Issue type.
| ----- | ----------- |
|
<a
id=
"issuetypeincident"
></a>
`INCIDENT`
| Incident issue type. |
|
<a
id=
"issuetypeissue"
></a>
`ISSUE`
| Issue issue type. |
|
<a
id=
"issuetyperequirement"
></a>
`REQUIREMENT`
| Requirement issue type. |
|
<a
id=
"issuetypetest_case"
></a>
`TEST_CASE`
| Test Case issue type. |
### `IterationState`
...
...
ee/app/services/ee/issues/build_service.rb
View file @
0617fb47
...
...
@@ -5,6 +5,8 @@ module EE
module
BuildService
extend
::
Gitlab
::
Utils
::
Override
DISABLED_ISSUE_TYPES
=
%w[test_case requirement]
.
freeze
def
issue_params_from_template
return
{}
unless
project
.
feature_available?
(
:issuable_default_templates
)
...
...
@@ -22,7 +24,7 @@ module EE
override
:allowed_issue_base_params
def
allowed_issue_base_params
return
super
-
[
:issue_type
]
if
params
[
:issue_type
]
==
'test_case'
return
super
-
[
:issue_type
]
if
DISABLED_ISSUE_TYPES
.
include?
(
params
[
:issue_type
])
super
end
...
...
ee/spec/services/issues/build_service_spec.rb
View file @
0617fb47
...
...
@@ -63,12 +63,14 @@ RSpec.describe Issues::BuildService do
let
(
:user
)
{
guest
}
context
'setting issue type'
do
it
'cannot set test_case'
do
issue
=
build_issue
(
issue_type:
'test_case'
)
Issues
::
BuildService
::
DISABLED_ISSUE_TYPES
.
each
do
|
type
|
it
"cannot set
#{
type
}
"
do
issue
=
build_issue
(
issue_type:
type
)
expect
(
issue
).
to
be_issue
end
end
end
end
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