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
f09e4d5b
Commit
f09e4d5b
authored
Sep 07, 2020
by
Jan Provaznik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'confdential_epics_removal' into 'master'"
This reverts merge request !41551
parent
ca6c6738
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
124 additions
and
10 deletions
+124
-10
doc/api/epics.md
doc/api/epics.md
+2
-2
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+2
-2
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+2
-2
doc/user/group/epics/manage_epics.md
doc/user/group/epics/manage_epics.md
+12
-0
ee/app/controllers/groups/epics_controller.rb
ee/app/controllers/groups/epics_controller.rb
+1
-0
ee/app/controllers/groups/roadmap_controller.rb
ee/app/controllers/groups/roadmap_controller.rb
+1
-0
ee/app/graphql/mutations/concerns/mutations/shared_epic_arguments.rb
...hql/mutations/concerns/mutations/shared_epic_arguments.rb
+1
-1
ee/app/serializers/epic_entity.rb
ee/app/serializers/epic_entity.rb
+1
-1
ee/app/services/epics/create_service.rb
ee/app/services/epics/create_service.rb
+1
-0
ee/app/services/epics/update_service.rb
ee/app/services/epics/update_service.rb
+1
-0
ee/lib/api/epics.rb
ee/lib/api/epics.rb
+2
-2
ee/spec/controllers/groups/epics_controller_spec.rb
ee/spec/controllers/groups/epics_controller_spec.rb
+14
-0
ee/spec/helpers/ee/issuables_helper_spec.rb
ee/spec/helpers/ee/issuables_helper_spec.rb
+4
-0
ee/spec/requests/api/epics_spec.rb
ee/spec/requests/api/epics_spec.rb
+27
-0
ee/spec/requests/api/graphql/mutations/epics/create_spec.rb
ee/spec/requests/api/graphql/mutations/epics/create_spec.rb
+13
-0
ee/spec/requests/api/graphql/mutations/epics/update_spec.rb
ee/spec/requests/api/graphql/mutations/epics/update_spec.rb
+13
-0
ee/spec/services/epics/create_service_spec.rb
ee/spec/services/epics/create_service_spec.rb
+14
-0
ee/spec/services/epics/update_service_spec.rb
ee/spec/services/epics/update_service_spec.rb
+13
-0
No files found.
doc/api/epics.md
View file @
f09e4d5b
...
@@ -266,7 +266,7 @@ POST /groups/:id/epics
...
@@ -266,7 +266,7 @@ POST /groups/:id/epics
|
`title`
| string | yes | The title of the epic |
|
`title`
| string | yes | The title of the epic |
|
`labels`
| string | no | The comma separated list of labels |
|
`labels`
| string | no | The comma separated list of labels |
|
`description`
| string | no | The description of the epic. Limited to 1,048,576 characters. |
|
`description`
| string | no | The description of the epic. Limited to 1,048,576 characters. |
|
`confidential`
| boolean | no | Whether the epic should be confidential |
|
`confidential`
| boolean | no | Whether the epic should be confidential
. Will be ignored if
`confidential_epics`
feature flag is disabled.
|
|
`start_date_is_fixed`
| boolean | no | Whether start date should be sourced from
`start_date_fixed`
or from milestones (since 11.3) |
|
`start_date_is_fixed`
| boolean | no | Whether start date should be sourced from
`start_date_fixed`
or from milestones (since 11.3) |
|
`start_date_fixed`
| string | no | The fixed start date of an epic (since 11.3) |
|
`start_date_fixed`
| string | no | The fixed start date of an epic (since 11.3) |
|
`due_date_is_fixed`
| boolean | no | Whether due date should be sourced from
`due_date_fixed`
or from milestones (since 11.3) |
|
`due_date_is_fixed`
| boolean | no | Whether due date should be sourced from
`due_date_fixed`
or from milestones (since 11.3) |
...
@@ -347,7 +347,7 @@ PUT /groups/:id/epics/:epic_iid
...
@@ -347,7 +347,7 @@ PUT /groups/:id/epics/:epic_iid
|
`epic_iid`
| integer/string | yes | The internal ID of the epic |
|
`epic_iid`
| integer/string | yes | The internal ID of the epic |
|
`title`
| string | no | The title of an epic |
|
`title`
| string | no | The title of an epic |
|
`description`
| string | no | The description of an epic. Limited to 1,048,576 characters. |
|
`description`
| string | no | The description of an epic. Limited to 1,048,576 characters. |
|
`confidential`
| boolean | no | Whether the epic should be confidential |
|
`confidential`
| boolean | no | Whether the epic should be confidential
. Will be ignored if
`confidential_epics`
feature flag is disabled.
|
|
`labels`
| string | no | The comma separated list of labels |
|
`labels`
| string | no | The comma separated list of labels |
|
`start_date_is_fixed`
| boolean | no | Whether start date should be sourced from
`start_date_fixed`
or from milestones (since 11.3) |
|
`start_date_is_fixed`
| boolean | no | Whether start date should be sourced from
`start_date_fixed`
or from milestones (since 11.3) |
|
`start_date_fixed`
| string | no | The fixed start date of an epic (since 11.3) |
|
`start_date_fixed`
| string | no | The fixed start date of an epic (since 11.3) |
...
...
doc/api/graphql/reference/gitlab_schema.graphql
View file @
f09e4d5b
...
@@ -2614,7 +2614,7 @@ input CreateEpicInput {
...
@@ -2614,7 +2614,7 @@ input CreateEpicInput {
clientMutationId
:
String
clientMutationId
:
String
"""
"""
Indicates
if
the
epic
is
confidential
Indicates
if
the
epic
is
confidential
.
Will
be
ignored
if
`
confidential_epics
`
feature
flag
is
disabled
"""
"""
confidential
:
Boolean
confidential
:
Boolean
...
@@ -16864,7 +16864,7 @@ input UpdateEpicInput {
...
@@ -16864,7 +16864,7 @@ input UpdateEpicInput {
clientMutationId
:
String
clientMutationId
:
String
"""
"""
Indicates
if
the
epic
is
confidential
Indicates
if
the
epic
is
confidential
.
Will
be
ignored
if
`
confidential_epics
`
feature
flag
is
disabled
"""
"""
confidential
:
Boolean
confidential
:
Boolean
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
f09e4d5b
...
@@ -7089,7 +7089,7 @@
...
@@ -7089,7 +7089,7 @@
},
},
{
{
"name": "confidential",
"name": "confidential",
"description": "Indicates if the epic is confidential",
"description": "Indicates if the epic is confidential
. Will be ignored if `confidential_epics` feature flag is disabled
",
"type": {
"type": {
"kind": "SCALAR",
"kind": "SCALAR",
"name": "Boolean",
"name": "Boolean",
...
@@ -49621,7 +49621,7 @@
...
@@ -49621,7 +49621,7 @@
},
},
{
{
"name": "confidential",
"name": "confidential",
"description": "Indicates if the epic is confidential",
"description": "Indicates if the epic is confidential
. Will be ignored if `confidential_epics` feature flag is disabled
",
"type": {
"type": {
"kind": "SCALAR",
"kind": "SCALAR",
"name": "Boolean",
"name": "Boolean",
doc/user/group/epics/manage_epics.md
View file @
f09e4d5b
...
@@ -164,6 +164,18 @@ To make an epic confidential:
...
@@ -164,6 +164,18 @@ To make an epic confidential:
-
**In an existing epic:**
in the epic's sidebar, select
**Edit**
next to
**Confidentiality**
then
-
**In an existing epic:**
in the epic's sidebar, select
**Edit**
next to
**Confidentiality**
then
select
**Turn on**
.
select
**Turn on**
.
### Disable confidential epics **(PREMIUM ONLY)**
The confidential epics feature is deployed behind a feature flag that is
**enabled by default**
.
[
GitLab administrators with access to the GitLab Rails console
](
../../../administration/feature_flags.md
)
can disable it for your self-managed instance.
To disable it:
```
ruby
Feature
.
disable
(
:confidential_epics
)
```
## Manage issues assigned to an epic
## Manage issues assigned to an epic
### Add a new issue to an epic
### Add a new issue to an epic
...
...
ee/app/controllers/groups/epics_controller.rb
View file @
f09e4d5b
...
@@ -18,6 +18,7 @@ class Groups::EpicsController < Groups::ApplicationController
...
@@ -18,6 +18,7 @@ class Groups::EpicsController < Groups::ApplicationController
before_action
do
before_action
do
push_frontend_feature_flag
(
:vue_issuable_epic_sidebar
,
@group
)
push_frontend_feature_flag
(
:vue_issuable_epic_sidebar
,
@group
)
push_frontend_feature_flag
(
:confidential_epics
,
@group
,
default_enabled:
true
)
end
end
def
new
;
end
def
new
;
end
...
...
ee/app/controllers/groups/roadmap_controller.rb
View file @
f09e4d5b
...
@@ -11,6 +11,7 @@ module Groups
...
@@ -11,6 +11,7 @@ module Groups
before_action
:persist_roadmap_layout
,
only:
[
:show
]
before_action
:persist_roadmap_layout
,
only:
[
:show
]
before_action
do
before_action
do
push_frontend_feature_flag
(
:roadmap_buffered_rendering
,
@group
)
push_frontend_feature_flag
(
:roadmap_buffered_rendering
,
@group
)
push_frontend_feature_flag
(
:confidential_epics
,
@group
,
default_enabled:
true
)
push_frontend_feature_flag
(
:async_filtering
,
@group
)
push_frontend_feature_flag
(
:async_filtering
,
@group
)
end
end
...
...
ee/app/graphql/mutations/concerns/mutations/shared_epic_arguments.rb
View file @
f09e4d5b
...
@@ -22,7 +22,7 @@ module Mutations
...
@@ -22,7 +22,7 @@ module Mutations
argument
:confidential
,
argument
:confidential
,
GraphQL
::
BOOLEAN_TYPE
,
GraphQL
::
BOOLEAN_TYPE
,
required:
false
,
required:
false
,
description:
'Indicates if the epic is confidential'
description:
'Indicates if the epic is confidential
. Will be ignored if `confidential_epics` feature flag is disabled
'
argument
:start_date_fixed
,
argument
:start_date_fixed
,
GraphQL
::
STRING_TYPE
,
GraphQL
::
STRING_TYPE
,
...
...
ee/app/serializers/epic_entity.rb
View file @
f09e4d5b
...
@@ -19,7 +19,7 @@ class EpicEntity < IssuableEntity
...
@@ -19,7 +19,7 @@ class EpicEntity < IssuableEntity
expose
:due_date_fixed
,
:due_date_from_milestones
expose
:due_date_fixed
,
:due_date_from_milestones
expose
:state
expose
:state
expose
:lock_version
expose
:lock_version
expose
:confidential
expose
:confidential
,
if:
->
(
epic
)
{
Feature
.
enabled?
(
:confidential_epics
,
epic
.
group
,
default_enabled:
true
)
}
expose
:web_url
do
|
epic
|
expose
:web_url
do
|
epic
|
group_epic_path
(
epic
.
group
,
epic
)
group_epic_path
(
epic
.
group
,
epic
)
...
...
ee/app/services/epics/create_service.rb
View file @
f09e4d5b
...
@@ -4,6 +4,7 @@ module Epics
...
@@ -4,6 +4,7 @@ module Epics
class
CreateService
<
Epics
::
BaseService
class
CreateService
<
Epics
::
BaseService
def
execute
def
execute
set_date_params
set_date_params
params
.
extract!
(
:confidential
)
unless
::
Feature
.
enabled?
(
:confidential_epics
,
group
,
default_enabled:
true
)
epic
=
group
.
epics
.
new
epic
=
group
.
epics
.
new
create
(
epic
)
create
(
epic
)
...
...
ee/app/services/epics/update_service.rb
View file @
f09e4d5b
...
@@ -13,6 +13,7 @@ module Epics
...
@@ -13,6 +13,7 @@ module Epics
# start_date and end_date columns are no longer writable by users because those
# start_date and end_date columns are no longer writable by users because those
# are composite fields managed by the system.
# are composite fields managed by the system.
params
.
extract!
(
:start_date
,
:end_date
)
params
.
extract!
(
:start_date
,
:end_date
)
params
.
extract!
(
:confidential
)
unless
::
Feature
.
enabled?
(
:confidential_epics
,
group
,
default_enabled:
true
)
update_task_event
(
epic
)
||
update
(
epic
)
update_task_event
(
epic
)
||
update
(
epic
)
...
...
ee/lib/api/epics.rb
View file @
f09e4d5b
...
@@ -69,7 +69,7 @@ module API
...
@@ -69,7 +69,7 @@ module API
params
do
params
do
requires
:title
,
type:
String
,
desc:
'The title of an epic'
requires
:title
,
type:
String
,
desc:
'The title of an epic'
optional
:description
,
type:
String
,
desc:
'The description of an epic'
optional
:description
,
type:
String
,
desc:
'The description of an epic'
optional
:confidential
,
type:
Boolean
,
desc:
'Indicates if the epic is confidential'
optional
:confidential
,
type:
Boolean
,
desc:
'Indicates if the epic is confidential
. Will be ignored if `confidential_epics` feature flag is disabled
'
optional
:start_date
,
as: :start_date_fixed
,
type:
String
,
desc:
'The start date of an epic'
optional
:start_date
,
as: :start_date_fixed
,
type:
String
,
desc:
'The start date of an epic'
optional
:start_date_is_fixed
,
type:
Boolean
,
desc:
'Indicates start date should be sourced from start_date_fixed field not the issue milestones'
optional
:start_date_is_fixed
,
type:
Boolean
,
desc:
'Indicates start date should be sourced from start_date_fixed field not the issue milestones'
optional
:end_date
,
as: :due_date_fixed
,
type:
String
,
desc:
'The due date of an epic'
optional
:end_date
,
as: :due_date_fixed
,
type:
String
,
desc:
'The due date of an epic'
...
@@ -95,7 +95,7 @@ module API
...
@@ -95,7 +95,7 @@ module API
requires
:epic_iid
,
type:
Integer
,
desc:
'The internal ID of an epic'
requires
:epic_iid
,
type:
Integer
,
desc:
'The internal ID of an epic'
optional
:title
,
type:
String
,
desc:
'The title of an epic'
optional
:title
,
type:
String
,
desc:
'The title of an epic'
optional
:description
,
type:
String
,
desc:
'The description of an epic'
optional
:description
,
type:
String
,
desc:
'The description of an epic'
optional
:confidential
,
type:
Boolean
,
desc:
'Indicates if the epic is confidential'
optional
:confidential
,
type:
Boolean
,
desc:
'Indicates if the epic is confidential
. Will be ignored if `confidential_epics` feature flag is disabled
'
optional
:start_date
,
as: :start_date_fixed
,
type:
String
,
desc:
'The start date of an epic'
optional
:start_date
,
as: :start_date_fixed
,
type:
String
,
desc:
'The start date of an epic'
optional
:start_date_is_fixed
,
type:
Boolean
,
desc:
'Indicates start date should be sourced from start_date_fixed field not the issue milestones'
optional
:start_date_is_fixed
,
type:
Boolean
,
desc:
'Indicates start date should be sourced from start_date_fixed field not the issue milestones'
optional
:end_date
,
as: :due_date_fixed
,
type:
String
,
desc:
'The due date of an epic'
optional
:end_date
,
as: :due_date_fixed
,
type:
String
,
desc:
'The due date of an epic'
...
...
ee/spec/controllers/groups/epics_controller_spec.rb
View file @
f09e4d5b
...
@@ -312,6 +312,20 @@ RSpec.describe Groups::EpicsController do
...
@@ -312,6 +312,20 @@ RSpec.describe Groups::EpicsController do
expect
(
response
).
to
match_response_schema
(
'entities/epic'
,
dir:
'ee'
)
expect
(
response
).
to
match_response_schema
(
'entities/epic'
,
dir:
'ee'
)
end
end
context
'when confidential_epics flag is disabled'
do
before
do
stub_feature_flags
(
confidential_epics:
false
)
end
it
'does not include confidential attribute'
do
group
.
add_developer
(
user
)
show_epic
(
:json
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
).
not_to
include
(
"confidential"
)
end
end
context
'with unauthorized user'
do
context
'with unauthorized user'
do
it
'returns a not found 404 response'
do
it
'returns a not found 404 response'
do
show_epic
(
:json
)
show_epic
(
:json
)
...
...
ee/spec/helpers/ee/issuables_helper_spec.rb
View file @
f09e4d5b
...
@@ -15,6 +15,10 @@ RSpec.describe IssuablesHelper do
...
@@ -15,6 +15,10 @@ RSpec.describe IssuablesHelper do
context
'for an epic'
do
context
'for an epic'
do
let_it_be
(
:epic
)
{
create
(
:epic
,
author:
user
,
description:
'epic text'
,
confidential:
true
)
}
let_it_be
(
:epic
)
{
create
(
:epic
,
author:
user
,
description:
'epic text'
,
confidential:
true
)
}
before
do
stub_feature_flags
(
confidential_epics:
true
)
end
it
'returns the correct data'
do
it
'returns the correct data'
do
@group
=
epic
.
group
@group
=
epic
.
group
...
...
ee/spec/requests/api/epics_spec.rb
View file @
f09e4d5b
...
@@ -610,6 +610,20 @@ RSpec.describe API::Epics do
...
@@ -610,6 +610,20 @@ RSpec.describe API::Epics do
end
end
end
end
context
'when confidential_epics flag is disabled'
do
before
do
stub_feature_flags
(
confidential_epics:
false
)
post
api
(
url
,
user
),
params:
params
end
it
'ignores confidential attribute'
do
epic
=
Epic
.
last
expect
(
epic
.
confidential
).
to
be_falsey
end
end
it
'creates a new epic with labels param as array'
do
it
'creates a new epic with labels param as array'
do
params
[
:labels
]
=
[
'label1'
,
'label2'
,
'foo, bar'
,
'&,?'
]
params
[
:labels
]
=
[
'label1'
,
'label2'
,
'foo, bar'
,
'&,?'
]
...
@@ -710,6 +724,19 @@ RSpec.describe API::Epics do
...
@@ -710,6 +724,19 @@ RSpec.describe API::Epics do
end
end
end
end
context
'when confidential_epics flag is disabled'
do
before
do
stub_feature_flags
(
confidential_epics:
false
)
stub_licensed_features
(
epics:
true
)
put
api
(
url
,
user
),
params:
params
end
it
'does not include confidential attribute'
do
expect
(
epic
.
reload
.
confidential
).
to
be_falsey
end
end
it
'clears labels when labels param is nil'
do
it
'clears labels when labels param is nil'
do
params
[
:labels
]
=
'label1'
params
[
:labels
]
=
'label1'
put
api
(
url
,
user
),
params:
params
put
api
(
url
,
user
),
params:
params
...
...
ee/spec/requests/api/graphql/mutations/epics/create_spec.rb
View file @
f09e4d5b
...
@@ -96,6 +96,19 @@ RSpec.describe 'Creating an Epic' do
...
@@ -96,6 +96,19 @@ RSpec.describe 'Creating an Epic' do
expect
{
post_graphql_mutation
(
mutation
,
current_user:
current_user
)
}.
not_to
change
(
Epic
,
:count
)
expect
{
post_graphql_mutation
(
mutation
,
current_user:
current_user
)
}.
not_to
change
(
Epic
,
:count
)
end
end
end
end
context
'when confidential_epics is disabled'
do
before
do
stub_feature_flags
(
confidential_epics:
false
)
end
it
'ignores confidential field'
do
post_graphql_mutation
(
mutation
,
current_user:
current_user
)
epic_hash
=
mutation_response
[
'epic'
]
expect
(
epic_hash
[
'confidential'
]).
to
be_falsey
end
end
end
end
end
end
end
end
ee/spec/requests/api/graphql/mutations/epics/update_spec.rb
View file @
f09e4d5b
...
@@ -132,6 +132,19 @@ RSpec.describe Mutations::Epics::Update do
...
@@ -132,6 +132,19 @@ RSpec.describe Mutations::Epics::Update do
it_behaves_like
'a mutation that returns top-level errors'
,
it_behaves_like
'a mutation that returns top-level errors'
,
errors:
[
'The list of epic attributes is empty'
]
errors:
[
'The list of epic attributes is empty'
]
end
end
context
'when confidential_epics is disabled'
do
before
do
stub_feature_flags
(
confidential_epics:
false
)
end
it
'ignores confidential field'
do
post_graphql_mutation
(
mutation
,
current_user:
current_user
)
epic_hash
=
mutation_response
[
'epic'
]
expect
(
epic_hash
[
'confidential'
]).
to
be_falsey
end
end
end
end
end
end
end
end
ee/spec/services/epics/create_service_spec.rb
View file @
f09e4d5b
...
@@ -25,6 +25,20 @@ RSpec.describe Epics::CreateService do
...
@@ -25,6 +25,20 @@ RSpec.describe Epics::CreateService do
expect
(
epic
.
confidential
).
to
be_truthy
expect
(
epic
.
confidential
).
to
be_truthy
expect
(
NewEpicWorker
).
to
have_received
(
:perform_async
).
with
(
epic
.
id
,
user
.
id
)
expect
(
NewEpicWorker
).
to
have_received
(
:perform_async
).
with
(
epic
.
id
,
user
.
id
)
end
end
context
'when confidential_epics is disabled'
do
before
do
stub_feature_flags
(
confidential_epics:
false
)
end
it
'ignores confidential attribute'
do
expect
{
subject
}.
to
change
{
Epic
.
count
}.
by
(
1
)
epic
=
Epic
.
last
expect
(
epic
).
to
be_persisted
expect
(
epic
.
confidential
).
to
be_falsey
end
end
end
end
context
'handling fixed dates'
do
context
'handling fixed dates'
do
...
...
ee/spec/services/epics/update_service_spec.rb
View file @
f09e4d5b
...
@@ -60,6 +60,19 @@ RSpec.describe Epics::UpdateService do
...
@@ -60,6 +60,19 @@ RSpec.describe Epics::UpdateService do
it
'updates the last_edited_at value'
do
it
'updates the last_edited_at value'
do
expect
{
update_epic
(
opts
)
}.
to
change
{
epic
.
last_edited_at
}
expect
{
update_epic
(
opts
)
}.
to
change
{
epic
.
last_edited_at
}
end
end
context
'when confidential_epics is disabled'
do
before
do
stub_feature_flags
(
confidential_epics:
false
)
end
it
'ignores confidential attribute on update'
do
update_epic
(
opts
)
expect
(
epic
).
to
be_valid
expect
(
epic
.
confidential
).
to
be_falsey
end
end
end
end
context
'when title has changed'
do
context
'when title has changed'
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