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
85908a20
Commit
85908a20
authored
Sep 11, 2020
by
Jason Goodman
Committed by
Shinya Maeda
Sep 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable legacy feature flags read-only by default
Update documentation for legacy flags
parent
cdf42646
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
18 deletions
+24
-18
doc/operations/feature_flags.md
doc/operations/feature_flags.md
+17
-16
ee/app/controllers/projects/feature_flags_controller.rb
ee/app/controllers/projects/feature_flags_controller.rb
+2
-2
ee/changelogs/unreleased/default-enable-legacy-read-only-flags.yml
...logs/unreleased/default-enable-legacy-read-only-flags.yml
+5
-0
No files found.
doc/operations/feature_flags.md
View file @
85908a20
...
@@ -54,22 +54,6 @@ To create and enable a feature flag:
...
@@ -54,22 +54,6 @@ To create and enable a feature flag:
You can change these settings by clicking the
**{pencil}**
(edit) button
You can change these settings by clicking the
**{pencil}**
(edit) button
next to any feature flag in the list.
next to any feature flag in the list.
## Rollout strategy (legacy)
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/8240) in GitLab 12.2.
In GitLab 13.0 and earlier, the
**Rollout strategy**
setting affects which users will experience
the feature as enabled. Choose the percentage of users that the feature will be enabled
for. The rollout strategy will have no effect if the environment spec is disabled.
It can be set to:
-
All users
-
[
Percent of users
](
#percent-of-users
)
-
Optionally, you can click the
**Include additional user IDs**
checkbox and add a list
of specific users IDs to enable the feature for.
-
[
User IDs
](
#user-ids
)
## Feature flag strategies
## Feature flag strategies
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/35555) in GitLab 13.0.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/35555) in GitLab 13.0.
...
@@ -208,6 +192,23 @@ To enable it:
...
@@ -208,6 +192,23 @@ To enable it:
Feature
.
enable
(
:feature_flags_new_version
)
Feature
.
enable
(
:feature_flags_new_version
)
```
```
## Rollout strategy (legacy)
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/8240) in GitLab 12.2.
> - [Made read-only](https://gitlab.com/gitlab-org/gitlab/-/issues/220228) in GitLab 13.4.
In GitLab 13.0 and earlier, the
**Rollout strategy**
setting affects which users will experience
the feature as enabled. Choose the percentage of users that the feature will be enabled
for. The rollout strategy will have no effect if the environment spec is disabled.
It can be set to:
-
All users
-
[
Percent of users
](
#percent-of-users
)
-
Optionally, you can click the
**Include additional user IDs**
checkbox and add a list
of specific users IDs to enable the feature for.
-
[
User IDs
](
#user-ids
)
## Disable a feature flag for a specific environment
## Disable a feature flag for a specific environment
In
[
GitLab 13.0 and earlier
](
https://gitlab.com/gitlab-org/gitlab/-/issues/8621
)
,
In
[
GitLab 13.0 and earlier
](
https://gitlab.com/gitlab-org/gitlab/-/issues/8621
)
,
...
...
ee/app/controllers/projects/feature_flags_controller.rb
View file @
85908a20
...
@@ -15,7 +15,7 @@ class Projects::FeatureFlagsController < Projects::ApplicationController
...
@@ -15,7 +15,7 @@ class Projects::FeatureFlagsController < Projects::ApplicationController
before_action
do
before_action
do
push_frontend_feature_flag
(
:feature_flag_permissions
)
push_frontend_feature_flag
(
:feature_flag_permissions
)
push_frontend_feature_flag
(
:feature_flags_new_version
,
project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:feature_flags_new_version
,
project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:feature_flags_legacy_read_only
,
project
)
push_frontend_feature_flag
(
:feature_flags_legacy_read_only
,
project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:feature_flags_legacy_read_only_override
,
project
)
push_frontend_feature_flag
(
:feature_flags_legacy_read_only_override
,
project
)
end
end
...
@@ -111,7 +111,7 @@ class Projects::FeatureFlagsController < Projects::ApplicationController
...
@@ -111,7 +111,7 @@ class Projects::FeatureFlagsController < Projects::ApplicationController
end
end
def
ensure_legacy_flags_writable!
def
ensure_legacy_flags_writable!
if
::
Feature
.
enabled?
(
:feature_flags_legacy_read_only
,
project
)
&&
if
::
Feature
.
enabled?
(
:feature_flags_legacy_read_only
,
project
,
default_enabled:
true
)
&&
::
Feature
.
disabled?
(
:feature_flags_legacy_read_only_override
,
project
)
&&
::
Feature
.
disabled?
(
:feature_flags_legacy_read_only_override
,
project
)
&&
feature_flag
.
legacy_flag?
feature_flag
.
legacy_flag?
render_error_json
([
'Legacy feature flags are read-only'
])
render_error_json
([
'Legacy feature flags are read-only'
])
...
...
ee/changelogs/unreleased/default-enable-legacy-read-only-flags.yml
0 → 100644
View file @
85908a20
---
title
:
Make legacy feature flags read-only
merge_request
:
40320
author
:
type
:
changed
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