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
416f87c8
Commit
416f87c8
authored
Jun 22, 2021
by
Max Woolf
Committed by
Michael Kozono
Jun 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ff_compliance_approval_gates to ff_external_status_checks
parent
a2bc1221
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
50 additions
and
50 deletions
+50
-50
doc/api/status_checks.md
doc/api/status_checks.md
+4
-4
doc/user/project/merge_requests/status_checks.md
doc/user/project/merge_requests/status_checks.md
+4
-4
ee/app/models/license.rb
ee/app/models/license.rb
+1
-1
ee/app/presenters/ee/merge_request_presenter.rb
ee/app/presenters/ee/merge_request_presenter.rb
+1
-1
ee/app/views/projects/_merge_request_settings.html.haml
ee/app/views/projects/_merge_request_settings.html.haml
+1
-1
ee/config/feature_flags/development/ff_external_status_checks.yml
...g/feature_flags/development/ff_external_status_checks.yml
+2
-2
ee/lib/api/status_checks.rb
ee/lib/api/status_checks.rb
+10
-10
ee/spec/features/merge_request/user_sees_status_checks_widget_spec.rb
...ures/merge_request/user_sees_status_checks_widget_spec.rb
+3
-3
ee/spec/features/projects/settings/merge_requests_settings_spec.rb
...eatures/projects/settings/merge_requests_settings_spec.rb
+2
-2
ee/spec/presenters/merge_request_presenter_spec.rb
ee/spec/presenters/merge_request_presenter_spec.rb
+1
-1
ee/spec/requests/api/status_checks_spec.rb
ee/spec/requests/api/status_checks_spec.rb
+19
-19
ee/spec/views/projects/edit.html.haml_spec.rb
ee/spec/views/projects/edit.html.haml_spec.rb
+2
-2
No files found.
doc/api/status_checks.md
View file @
416f87c8
...
...
@@ -161,18 +161,18 @@ To enable it:
```
ruby
# For the instance
Feature
.
enable
(
:ff_
compliance_approval_gate
s
)
Feature
.
enable
(
:ff_
external_status_check
s
)
# For a single project
Feature
.
enable
(
:ff_
compliance_approval_gate
s
,
Project
.
find
(
<
project
id
>
))
Feature
.
enable
(
:ff_
external_status_check
s
,
Project
.
find
(
<
project
id
>
))
```
To disable it:
```
ruby
# For the instance
Feature
.
disable
(
:ff_
compliance_approval_gate
s
)
Feature
.
disable
(
:ff_
external_status_check
s
)
# For a single project
Feature
.
disable
(
:ff_
compliance_approval_gate
s
,
Project
.
find
(
<
project
id
>
))
Feature
.
disable
(
:ff_
external_status_check
s
,
Project
.
find
(
<
project
id
>
))
```
## Related links
...
...
doc/user/project/merge_requests/status_checks.md
View file @
416f87c8
...
...
@@ -160,18 +160,18 @@ To enable it:
```
ruby
# For the instance
Feature
.
enable
(
:ff_
compliance_approval_gate
s
)
Feature
.
enable
(
:ff_
external_status_check
s
)
# For a single project
Feature
.
enable
(
:ff_
compliance_approval_gate
s
,
Project
.
find
(
<
project
id
>
))
Feature
.
enable
(
:ff_
external_status_check
s
,
Project
.
find
(
<
project
id
>
))
```
To disable it:
```
ruby
# For the instance
Feature
.
disable
(
:ff_
compliance_approval_gate
s
)
Feature
.
disable
(
:ff_
external_status_check
s
)
# For a single project
Feature
.
disable
(
:ff_
compliance_approval_gate
s
,
Project
.
find
(
<
project
id
>
)
Feature
.
disable
(
:ff_
external_status_check
s
,
Project
.
find
(
<
project
id
>
)
```
## Related links
...
...
ee/app/models/license.rb
View file @
416f87c8
...
...
@@ -141,7 +141,7 @@ class License < ApplicationRecord
api_fuzzing
auto_rollback
cilium_alerts
compliance_approval_gate
s
external_status_check
s
container_scanning
coverage_fuzzing
credentials_inventory
...
...
ee/app/presenters/ee/merge_request_presenter.rb
View file @
416f87c8
...
...
@@ -69,7 +69,7 @@ module EE
private
def
expose_mr_status_checks?
::
Feature
.
enabled?
(
:ff_
compliance_approval_gate
s
,
project
,
default_enabled: :yaml
)
&&
::
Feature
.
enabled?
(
:ff_
external_status_check
s
,
project
,
default_enabled: :yaml
)
&&
current_user
.
present?
&&
project
.
external_status_checks
.
any?
end
...
...
ee/app/views/projects/_merge_request_settings.html.haml
View file @
416f87c8
...
...
@@ -8,7 +8,7 @@
=
render_ce
'projects/merge_request_merge_checks_settings'
,
project:
@project
,
form:
form
-
if
::
Feature
.
enabled?
(
:ff_
compliance_approval_gate
s
,
@project
,
default_enabled: :yaml
)
-
if
::
Feature
.
enabled?
(
:ff_
external_status_check
s
,
@project
,
default_enabled: :yaml
)
=
render_if_exists
'projects/merge_request_status_checks_settings'
=
render
'projects/merge_request_merge_suggestions_settings'
,
project:
@project
,
form:
form
...
...
ee/config/feature_flags/development/ff_
compliance_approval_gate
s.yml
→
ee/config/feature_flags/development/ff_
external_status_check
s.yml
View file @
416f87c8
---
name
:
ff_
compliance_approval_gate
s
name
:
ff_
external_status_check
s
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54002
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/320783
milestone
:
'
1
3.10
'
milestone
:
'
1
4.1
'
type
:
development
group
:
group::compliance
default_enabled
:
false
ee/lib/api/status_checks.rb
View file @
416f87c8
...
...
@@ -13,8 +13,8 @@ module API
helpers
do
def
check_feature_enabled!
unauthorized!
unless
user_project
.
licensed_feature_available?
(
:
compliance_approval_gate
s
)
&&
Feature
.
enabled?
(
:ff_
compliance_approval_gate
s
,
user_project
)
unauthorized!
unless
user_project
.
licensed_feature_available?
(
:
external_status_check
s
)
&&
Feature
.
enabled?
(
:ff_
external_status_check
s
,
user_project
)
end
end
...
...
@@ -22,7 +22,7 @@ module API
segment
':id/external_status_checks'
do
desc
'Create a new external status check'
do
success
::
API
::
Entities
::
ExternalStatusCheck
detail
'This feature is gated by the :ff_
compliance_approval_gate
s feature flag.'
detail
'This feature is gated by the :ff_
external_status_check
s feature flag.'
end
params
do
requires
:name
,
type:
String
,
desc:
'The name of the external status check'
...
...
@@ -46,7 +46,7 @@ module API
end
end
desc
'List project\'s external approval rules'
do
detail
'This feature is gated by the :ff_
compliance_approval_gate
s feature flag.'
detail
'This feature is gated by the :ff_
external_status_check
s feature flag.'
end
params
do
use
:pagination
...
...
@@ -60,7 +60,7 @@ module API
segment
':check_id'
do
desc
'Update an external approval rule'
do
success
::
API
::
Entities
::
ExternalStatusCheck
detail
'This feature is gated by the :ff_
compliance_approval_gate
s feature flag.'
detail
'This feature is gated by the :ff_
external_status_check
s feature flag.'
end
params
do
requires
:check_id
,
type:
Integer
,
desc:
'The ID of the external status check'
...
...
@@ -86,7 +86,7 @@ module API
end
desc
'Delete an external status check'
do
detail
'This feature is gated by the :ff_
compliance_approval_gate
s feature flag.'
detail
'This feature is gated by the :ff_
external_status_check
s feature flag.'
end
params
do
requires
:check_id
,
type:
Integer
,
desc:
'The ID of the status check'
...
...
@@ -106,7 +106,7 @@ module API
segment
':id/merge_requests/:merge_request_iid'
do
desc
'Externally approve a merge request'
do
detail
'This feature was introduced in 13.12 and is gated behind the :ff_
compliance_approval_gate
s feature flag.'
detail
'This feature was introduced in 13.12 and is gated behind the :ff_
external_status_check
s feature flag.'
success
Entities
::
MergeRequests
::
StatusCheckResponse
end
params
do
...
...
@@ -116,7 +116,7 @@ module API
requires
:sha
,
type:
String
,
desc:
'The current SHA at HEAD of the merge request.'
end
post
'status_check_responses'
do
not_found!
unless
::
Feature
.
enabled?
(
:ff_
compliance_approval_gate
s
,
user_project
)
not_found!
unless
::
Feature
.
enabled?
(
:ff_
external_status_check
s
,
user_project
)
merge_request
=
find_merge_request_with_access
(
params
[
:merge_request_iid
],
:approve_merge_request
)
...
...
@@ -128,10 +128,10 @@ module API
end
desc
'List all status checks for a merge request and their state.'
do
detail
'This feature was introduced in 13.12 and is gated behind the :ff_
compliance_approval_gate
s feature flag.'
detail
'This feature was introduced in 13.12 and is gated behind the :ff_
external_status_check
s feature flag.'
end
get
'status_checks'
do
not_found!
unless
::
Feature
.
enabled?
(
:ff_
compliance_approval_gate
s
,
user_project
)
not_found!
unless
::
Feature
.
enabled?
(
:ff_
external_status_check
s
,
user_project
)
merge_request
=
find_merge_request_with_access
(
params
[
:merge_request_iid
],
:approve_merge_request
)
...
...
ee/spec/features/merge_request/user_sees_status_checks_widget_spec.rb
View file @
416f87c8
...
...
@@ -18,7 +18,7 @@ RSpec.describe 'Merge request > User sees status checks widget', :js do
end
before
do
stub_licensed_features
(
compliance_approval_gate
s:
true
)
stub_licensed_features
(
external_status_check
s:
true
)
end
context
'user is authorized'
do
...
...
@@ -31,7 +31,7 @@ RSpec.describe 'Merge request > User sees status checks widget', :js do
context
'feature flag is enabled'
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
true
)
stub_feature_flags
(
ff_
external_status_check
s:
true
)
end
it
'shows the widget'
do
...
...
@@ -55,7 +55,7 @@ RSpec.describe 'Merge request > User sees status checks widget', :js do
context
'feature flag is disabled'
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
false
)
stub_feature_flags
(
ff_
external_status_check
s:
false
)
end
it_behaves_like
'no status checks widget'
...
...
ee/spec/features/projects/settings/merge_requests_settings_spec.rb
View file @
416f87c8
...
...
@@ -19,7 +19,7 @@ RSpec.describe 'Project settings > [EE] Merge Requests', :js do
context
'Status checks'
do
context
'Feature is not available'
do
before
do
stub_licensed_features
(
compliance_approval_gate
s:
false
)
stub_licensed_features
(
external_status_check
s:
false
)
end
it
'does not render the status checks area'
do
...
...
@@ -29,7 +29,7 @@ RSpec.describe 'Project settings > [EE] Merge Requests', :js do
context
'Feature is available'
do
before
do
stub_licensed_features
(
compliance_approval_gate
s:
true
)
stub_licensed_features
(
external_status_check
s:
true
)
end
it
'adds a status check'
do
...
...
ee/spec/presenters/merge_request_presenter_spec.rb
View file @
416f87c8
...
...
@@ -200,7 +200,7 @@ RSpec.describe MergeRequestPresenter do
let
(
:path
)
{
exposes_path?
?
expose_path
(
"/api/v4/projects/
#{
merge_request
.
project
.
id
}
/merge_requests/
#{
merge_request
.
iid
}
/status_checks"
)
:
nil
}
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
feature_flag_enabled?
)
stub_feature_flags
(
ff_
external_status_check
s:
feature_flag_enabled?
)
allow
(
project
.
external_status_checks
).
to
receive
(
:any?
).
and_return
(
has_status_checks?
)
end
...
...
ee/spec/requests/api/status_checks_spec.rb
View file @
416f87c8
...
...
@@ -21,7 +21,7 @@ RSpec.describe API::StatusChecks do
describe
'permissions'
do
before
do
stub_licensed_features
(
compliance_approval_gate
s:
true
)
stub_licensed_features
(
external_status_check
s:
true
)
end
it
{
expect
{
subject
}.
to
be_allowed_for
(
:maintainer
).
of
(
project
)
}
...
...
@@ -34,7 +34,7 @@ RSpec.describe API::StatusChecks do
context
'feature flag is disabled'
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
false
)
stub_feature_flags
(
ff_
external_status_check
s:
false
)
end
it
'returns a not found error'
do
...
...
@@ -46,7 +46,7 @@ RSpec.describe API::StatusChecks do
context
'when current_user has access'
do
before
do
stub_licensed_features
(
compliance_approval_gate
s:
true
)
stub_licensed_features
(
external_status_check
s:
true
)
project
.
add_user
(
project_maintainer
,
:maintainer
)
end
...
...
@@ -83,7 +83,7 @@ RSpec.describe API::StatusChecks do
context
'feature flag is disabled'
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
false
)
stub_feature_flags
(
ff_
external_status_check
s:
false
)
end
it
'returns a not found error'
do
...
...
@@ -95,7 +95,7 @@ RSpec.describe API::StatusChecks do
context
'when user has access'
do
before
do
stub_licensed_features
(
compliance_approval_gate
s:
true
)
stub_licensed_features
(
external_status_check
s:
true
)
project
.
add_user
(
project_maintainer
,
:maintainer
)
end
...
...
@@ -143,7 +143,7 @@ RSpec.describe API::StatusChecks do
describe
'DELETE projects/:id/external_status_checks/:check_id'
do
before
do
stub_licensed_features
(
compliance_approval_gate
s:
true
)
stub_licensed_features
(
external_status_check
s:
true
)
end
it
'deletes the specified rule'
do
...
...
@@ -166,8 +166,8 @@ RSpec.describe API::StatusChecks do
with_them
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
flag
)
stub_licensed_features
(
compliance_approval_gate
s:
licensed
)
stub_feature_flags
(
ff_
external_status_check
s:
flag
)
stub_licensed_features
(
external_status_check
s:
licensed
)
end
it
'returns the correct status code'
do
...
...
@@ -182,8 +182,8 @@ RSpec.describe API::StatusChecks do
describe
'POST projects/:id/external_status_checks'
do
context
'successfully creating new external approval rule'
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
true
)
stub_licensed_features
(
compliance_approval_gate
s:
true
)
stub_feature_flags
(
ff_
external_status_check
s:
true
)
stub_licensed_features
(
external_status_check
s:
true
)
end
subject
do
...
...
@@ -242,8 +242,8 @@ RSpec.describe API::StatusChecks do
with_them
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
flag
)
stub_licensed_features
(
compliance_approval_gate
s:
licensed
)
stub_feature_flags
(
ff_
external_status_check
s:
flag
)
stub_licensed_features
(
external_status_check
s:
licensed
)
end
it
'returns the correct status code'
do
...
...
@@ -263,7 +263,7 @@ RSpec.describe API::StatusChecks do
end
before
do
stub_licensed_features
(
compliance_approval_gate
s:
true
)
stub_licensed_features
(
external_status_check
s:
true
)
end
it
'responds with expected JSON'
,
:aggregate_failures
do
...
...
@@ -293,8 +293,8 @@ RSpec.describe API::StatusChecks do
with_them
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
flag
)
stub_licensed_features
(
compliance_approval_gate
s:
licensed
)
stub_feature_flags
(
ff_
external_status_check
s:
flag
)
stub_licensed_features
(
external_status_check
s:
licensed
)
end
it
'returns the correct status code'
do
...
...
@@ -311,8 +311,8 @@ RSpec.describe API::StatusChecks do
context
'successfully updating external approval rule'
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
true
)
stub_licensed_features
(
compliance_approval_gate
s:
true
)
stub_feature_flags
(
ff_
external_status_check
s:
true
)
stub_licensed_features
(
external_status_check
s:
true
)
end
subject
do
...
...
@@ -375,8 +375,8 @@ RSpec.describe API::StatusChecks do
with_them
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
flag
)
stub_licensed_features
(
compliance_approval_gate
s:
licensed
)
stub_feature_flags
(
ff_
external_status_check
s:
flag
)
stub_licensed_features
(
external_status_check
s:
licensed
)
end
it
'returns the correct status code'
do
...
...
ee/spec/views/projects/edit.html.haml_spec.rb
View file @
416f87c8
...
...
@@ -18,7 +18,7 @@ RSpec.describe 'projects/edit' do
context
'status checks'
do
context
'feature enabled'
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
true
)
stub_feature_flags
(
ff_
external_status_check
s:
true
)
render
end
...
...
@@ -30,7 +30,7 @@ RSpec.describe 'projects/edit' do
context
'feature disabled'
do
before
do
stub_feature_flags
(
ff_
compliance_approval_gate
s:
false
)
stub_feature_flags
(
ff_
external_status_check
s:
false
)
render
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