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
4aabd520
Commit
4aabd520
authored
Mar 29, 2021
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'ck3g-drop-default_enabled-from-Feature-enabled' into 'master'"
This reverts merge request !56746
parent
f0f0f6b3
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
72 additions
and
157 deletions
+72
-157
config/feature_flags/ops/prometheus_metrics_method_instrumentation.yml
...e_flags/ops/prometheus_metrics_method_instrumentation.yml
+0
-8
config/feature_flags/ops/prometheus_metrics_view_instrumentation.yml
...ure_flags/ops/prometheus_metrics_view_instrumentation.yml
+0
-8
lib/feature.rb
lib/feature.rb
+4
-4
spec/graphql/features/feature_flag_spec.rb
spec/graphql/features/feature_flag_spec.rb
+0
-1
spec/graphql/types/base_field_spec.rb
spec/graphql/types/base_field_spec.rb
+0
-1
spec/lib/api/helpers_spec.rb
spec/lib/api/helpers_spec.rb
+0
-1
spec/lib/feature/gitaly_spec.rb
spec/lib/feature/gitaly_spec.rb
+0
-1
spec/lib/feature_spec.rb
spec/lib/feature_spec.rb
+68
-118
spec/lib/gitlab/gon_helper_spec.rb
spec/lib/gitlab/gon_helper_spec.rb
+0
-1
spec/lib/gitlab/metrics/methods_spec.rb
spec/lib/gitlab/metrics/methods_spec.rb
+0
-5
spec/lib/gitlab/metrics_spec.rb
spec/lib/gitlab/metrics_spec.rb
+0
-5
spec/requests/api/features_spec.rb
spec/requests/api/features_spec.rb
+0
-2
spec/requests/api/usage_data_spec.rb
spec/requests/api/usage_data_spec.rb
+0
-2
No files found.
config/feature_flags/ops/prometheus_metrics_method_instrumentation.yml
deleted
100644 → 0
View file @
f0f0f6b3
---
name
:
prometheus_metrics_method_instrumentation
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4304
rollout_issue_url
:
milestone
:
'
10.5'
type
:
ops
group
:
default_enabled
:
false
config/feature_flags/ops/prometheus_metrics_view_instrumentation.yml
deleted
100644 → 0
View file @
f0f0f6b3
---
name
:
prometheus_metrics_view_instrumentation
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4304
rollout_issue_url
:
milestone
:
'
10.5'
type
:
ops
group
:
default_enabled
:
false
lib/feature.rb
View file @
4aabd520
...
...
@@ -57,7 +57,7 @@ class Feature
# use `default_enabled: true` to default the flag to being `enabled`
# unless set explicitly. The default is `disabled`
# TODO: remove the `default_enabled:` and read it from the `defintion_yaml`
# check: https://gitlab.com/gitlab-org/gitlab/-/issues/
271275
# check: https://gitlab.com/gitlab-org/gitlab/-/issues/
30228
def
enabled?
(
key
,
thing
=
nil
,
type: :development
,
default_enabled:
false
)
if
check_feature_flags_definition?
if
thing
&&
!
thing
.
respond_to?
(
:flipper_id
)
...
...
@@ -65,11 +65,11 @@ class Feature
"The thing '
#{
thing
.
class
.
name
}
' for feature flag '
#{
key
}
' needs to include `FeatureGate` or implement `flipper_id`"
end
Feature
::
Definition
.
valid_usage!
(
key
,
type:
type
,
default_enabled:
:yaml
)
Feature
::
Definition
.
valid_usage!
(
key
,
type:
type
,
default_enabled:
default_enabled
)
end
#
TODO: Remove rubocop disable comment once `default_enabled` argument is removed https://gitlab.com/gitlab-org/gitlab/-/issues/271275
default_enabled
=
Feature
::
Definition
.
default_enabled?
(
key
)
# rubocop:disable Lint/ShadowedArgument
#
If `default_enabled: :yaml` we fetch the value from the YAML definition instead.
default_enabled
=
Feature
::
Definition
.
default_enabled?
(
key
)
if
default_enabled
==
:yaml
# During setup the database does not exist yet. So we haven't stored a value
# for the feature yet and return the default.
...
...
spec/graphql/features/feature_flag_spec.rb
View file @
4aabd520
...
...
@@ -15,7 +15,6 @@ RSpec.describe 'Graphql Field feature flags' do
before
do
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
end
subject
{
result
}
...
...
spec/graphql/types/base_field_spec.rb
View file @
4aabd520
...
...
@@ -128,7 +128,6 @@ RSpec.describe Types::BaseField do
before
do
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
end
it
'returns false if the feature is not enabled'
do
...
...
spec/lib/api/helpers_spec.rb
View file @
4aabd520
...
...
@@ -183,7 +183,6 @@ RSpec.describe API::Helpers do
before
do
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
end
context
'with feature enabled'
do
...
...
spec/lib/feature/gitaly_spec.rb
View file @
4aabd520
...
...
@@ -8,7 +8,6 @@ RSpec.describe Feature::Gitaly do
before
do
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
end
describe
".enabled?"
do
...
...
spec/lib/feature_spec.rb
View file @
4aabd520
This diff is collapsed.
Click to expand it.
spec/lib/gitlab/gon_helper_spec.rb
View file @
4aabd520
...
...
@@ -12,7 +12,6 @@ RSpec.describe Gitlab::GonHelper do
describe
'#push_frontend_feature_flag'
do
before
do
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
end
it
'pushes a feature flag to the frontend'
do
...
...
spec/lib/gitlab/metrics/methods_spec.rb
View file @
4aabd520
...
...
@@ -102,11 +102,6 @@ RSpec.describe Gitlab::Metrics::Methods do
let
(
:feature_name
)
{
:some_metric_feature
}
let
(
:metric
)
{
call_fetch_metric_method
(
docstring:
docstring
,
with_feature:
feature_name
)
}
before
do
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
end
context
'when feature is enabled'
do
before
do
stub_feature_flags
(
feature_name
=>
true
)
...
...
spec/lib/gitlab/metrics_spec.rb
View file @
4aabd520
...
...
@@ -54,11 +54,6 @@ RSpec.describe Gitlab::Metrics do
end
describe
'.measure'
do
before
do
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
end
context
'without a transaction'
do
it
'returns the return value of the block'
do
val
=
described_class
.
measure
(
:foo
)
{
10
}
...
...
spec/requests/api/features_spec.rb
View file @
4aabd520
...
...
@@ -438,8 +438,6 @@ RSpec.describe API::Features, stub_feature_flags: false do
context
'when the gate value was set'
do
before
do
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
Feature
.
enable
(
feature_name
)
end
...
...
spec/requests/api/usage_data_spec.rb
View file @
4aabd520
...
...
@@ -73,7 +73,6 @@ RSpec.describe API::UsageData do
context
'with unknown event'
do
before
do
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
end
it
'returns status ok'
do
...
...
@@ -150,7 +149,6 @@ RSpec.describe API::UsageData do
context
'with unknown event'
do
before
do
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
end
it
'returns status ok'
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