BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
74dc4c2c
Commit
74dc4c2c
authored
Sep 13, 2017
by
Kamil Trzciński
Committed by
Jarka Kadlecova
Sep 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'zj-feature-flipper-disable-banner' into 'master'
Allow all AutoDevOps banners to be disabled Closes #37653 See merge request !14218
parent
a18f4886
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
1 deletion
+34
-1
auto_devops_helper.rb
app/helpers/auto_devops_helper.rb
+2
-1
zj-feature-flipper-disable-banner.yml
changelogs/unreleased/zj-feature-flipper-disable-banner.yml
+5
-0
index.md
doc/topics/autodevops/index.md
+17
-0
auto_devops_helper_spec.rb
spec/helpers/auto_devops_helper_spec.rb
+10
-0
No files found.
app/helpers/auto_devops_helper.rb
View file @
74dc4c2c
module
AutoDevopsHelper
def
show_auto_devops_callout?
(
project
)
show_callout?
(
'auto_devops_settings_dismissed'
)
&&
Feature
.
get
(
:auto_devops_banner_disabled
).
off?
&&
show_callout?
(
'auto_devops_settings_dismissed'
)
&&
can?
(
current_user
,
:admin_pipeline
,
project
)
&&
project
.
has_auto_devops_implicitly_disabled?
end
...
...
changelogs/unreleased/zj-feature-flipper-disable-banner.yml
0 → 100644
View file @
74dc4c2c
---
title
:
Allow all AutoDevOps banners to be turned off
merge_request
:
author
:
type
:
changed
doc/topics/autodevops/index.md
View file @
74dc4c2c
...
...
@@ -323,6 +323,23 @@ container registry. **Restarting a pod, scaling a service, or other actions whic
require on-going access to the registry will fail
**
. On-going secure access is
planned for a subsequent release.
## Disable the banner instance wide
If an administrater would like to disable the banners on an instance level, this
feature can be disabled either through the console:
```
basb
$ gitlab-rails console
[1] pry(main)> Feature.get(:auto_devops_banner_disabled).disable
=> true
```
Or through the HTTP API with the admin access token:
```
curl --data "value=true" --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/features/auto_devops_banner_disabled
```
## Troubleshooting
-
Auto Build and Auto Test may fail in detecting your language/framework. There
...
...
spec/helpers/auto_devops_helper_spec.rb
View file @
74dc4c2c
...
...
@@ -10,6 +10,8 @@ describe AutoDevopsHelper do
before
do
allow
(
helper
).
to
receive
(
:can?
).
with
(
user
,
:admin_pipeline
,
project
)
{
allowed
}
allow
(
helper
).
to
receive
(
:current_user
)
{
user
}
Feature
.
get
(
:auto_devops_banner_disabled
).
disable
end
subject
{
helper
.
show_auto_devops_callout?
(
project
)
}
...
...
@@ -18,6 +20,14 @@ describe AutoDevopsHelper do
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when the banner is disabled by feature flag'
do
it
'allows the feature flag to disable'
do
Feature
.
get
(
:auto_devops_banner_disabled
).
enable
expect
(
subject
).
to
be
(
false
)
end
end
context
'when dismissed'
do
before
do
helper
.
request
.
cookies
[
:auto_devops_settings_dismissed
]
=
'true'
...
...
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