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
4ff2e1c4
Commit
4ff2e1c4
authored
Nov 19, 2020
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove suggest pipeline feature flag
- feature is fully rolled out and validated.
parent
7ed55907
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
61 additions
and
129 deletions
+61
-129
app/assets/javascripts/pages/projects/blob/show/index.js
app/assets/javascripts/pages/projects/blob/show/index.js
+13
-15
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
...avascripts/vue_merge_request_widget/mr_widget_options.vue
+1
-4
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+0
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-1
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+1
-2
app/helpers/suggest_pipeline_helper.rb
app/helpers/suggest_pipeline_helper.rb
+1
-3
app/serializers/merge_request_widget_entity.rb
app/serializers/merge_request_widget_entity.rb
+3
-3
config/feature_flags/development/suggest_pipeline.yml
config/feature_flags/development/suggest_pipeline.yml
+0
-8
spec/frontend/vue_mr_widget/mr_widget_options_spec.js
spec/frontend/vue_mr_widget/mr_widget_options_spec.js
+1
-17
spec/helpers/blob_helper_spec.rb
spec/helpers/blob_helper_spec.rb
+24
-38
spec/serializers/merge_request_widget_entity_spec.rb
spec/serializers/merge_request_widget_entity_spec.rb
+17
-37
No files found.
app/assets/javascripts/pages/projects/blob/show/index.js
View file @
4ff2e1c4
...
...
@@ -73,22 +73,20 @@ document.addEventListener('DOMContentLoaded', () => {
);
}
if
(
gon
.
features
?.
suggestPipeline
)
{
const
successPipelineEl
=
document
.
querySelector
(
'
.js-success-pipeline-modal
'
);
const
successPipelineEl
=
document
.
querySelector
(
'
.js-success-pipeline-modal
'
);
if
(
successPipelineEl
)
{
// eslint-disable-next-line no-new
new
Vue
({
el
:
successPipelineEl
,
render
(
createElement
)
{
return
createElement
(
PipelineTourSuccessModal
,
{
props
:
{
...
successPipelineEl
.
dataset
,
},
});
},
});
}
if
(
successPipelineEl
)
{
// eslint-disable-next-line no-new
new
Vue
({
el
:
successPipelineEl
,
render
(
createElement
)
{
return
createElement
(
PipelineTourSuccessModal
,
{
props
:
{
...
successPipelineEl
.
dataset
,
},
});
},
});
}
if
(
gon
?.
features
?.
gitlabCiYmlPreview
)
{
...
...
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
View file @
4ff2e1c4
...
...
@@ -155,10 +155,7 @@ export default {
},
shouldSuggestPipelines
()
{
return
(
gon
.
features
?.
suggestPipeline
&&
!
this
.
mr
.
hasCI
&&
this
.
mr
.
mergeRequestAddCiConfigPath
&&
!
this
.
mr
.
isDismissedSuggestPipeline
!
this
.
mr
.
hasCI
&&
this
.
mr
.
mergeRequestAddCiConfigPath
&&
!
this
.
mr
.
isDismissedSuggestPipeline
);
},
shouldRenderCodeQuality
()
{
...
...
app/controllers/projects/blob_controller.rb
View file @
4ff2e1c4
...
...
@@ -33,7 +33,6 @@ class Projects::BlobController < Projects::ApplicationController
before_action
:set_last_commit_sha
,
only:
[
:edit
,
:update
]
before_action
only: :show
do
push_frontend_feature_flag
(
:suggest_pipeline
,
default_enabled:
true
)
push_frontend_feature_flag
(
:gitlab_ci_yml_preview
,
@project
,
default_enabled:
false
)
end
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
4ff2e1c4
...
...
@@ -27,7 +27,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action
:authenticate_user!
,
only:
[
:assign_related_issues
]
before_action
:check_user_can_push_to_source_branch!
,
only:
[
:rebase
]
before_action
only:
[
:show
]
do
push_frontend_feature_flag
(
:suggest_pipeline
,
default_enabled:
true
)
push_frontend_feature_flag
(
:widget_visibility_polling
,
@project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:mr_commit_neighbor_nav
,
@project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:multiline_comments
,
@project
,
default_enabled:
true
)
...
...
app/helpers/blob_helper.rb
View file @
4ff2e1c4
...
...
@@ -382,8 +382,7 @@ module BlobHelper
end
def
show_suggest_pipeline_creation_celebration?
Feature
.
enabled?
(
:suggest_pipeline
,
default_enabled:
true
)
&&
@blob
.
path
==
Gitlab
::
FileDetector
::
PATTERNS
[
:gitlab_ci
]
&&
@blob
.
path
==
Gitlab
::
FileDetector
::
PATTERNS
[
:gitlab_ci
]
&&
@blob
.
auxiliary_viewer
&
.
valid?
(
project:
@project
,
sha:
@commit
.
sha
,
user:
current_user
)
&&
@project
.
uses_default_ci_config?
&&
cookies
[
suggest_pipeline_commit_cookie_name
].
present?
...
...
app/helpers/suggest_pipeline_helper.rb
View file @
4ff2e1c4
...
...
@@ -2,8 +2,6 @@
module
SuggestPipelineHelper
def
should_suggest_gitlab_ci_yml?
Feature
.
enabled?
(
:suggest_pipeline
,
default_enabled:
true
)
&&
current_user
&&
params
[
:suggest_gitlab_ci_yml
]
==
'true'
current_user
&&
params
[
:suggest_gitlab_ci_yml
]
==
'true'
end
end
app/serializers/merge_request_widget_entity.rb
View file @
4ff2e1c4
...
...
@@ -67,15 +67,15 @@ class MergeRequestWidgetEntity < Grape::Entity
)
end
expose
:user_callouts_path
,
if:
->
(
*
)
{
Feature
.
enabled?
(
:suggest_pipeline
,
default_enabled:
true
)
}
do
|
_merge_request
|
expose
:user_callouts_path
do
|
_merge_request
|
user_callouts_path
end
expose
:suggest_pipeline_feature_id
,
if:
->
(
*
)
{
Feature
.
enabled?
(
:suggest_pipeline
,
default_enabled:
true
)
}
do
|
_merge_request
|
expose
:suggest_pipeline_feature_id
do
|
_merge_request
|
SUGGEST_PIPELINE
end
expose
:is_dismissed_suggest_pipeline
,
if:
->
(
*
)
{
Feature
.
enabled?
(
:suggest_pipeline
,
default_enabled:
true
)
}
do
|
_merge_request
|
expose
:is_dismissed_suggest_pipeline
do
|
_merge_request
|
current_user
&&
current_user
.
dismissed_callout?
(
feature_name:
SUGGEST_PIPELINE
)
end
...
...
config/feature_flags/development/suggest_pipeline.yml
deleted
100644 → 0
View file @
7ed55907
---
name
:
suggest_pipeline
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45926
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/267492
milestone
:
'
13.6'
type
:
development
group
:
group::expansion
default_enabled
:
true
spec/frontend/vue_mr_widget/mr_widget_options_spec.js
View file @
4ff2e1c4
...
...
@@ -849,7 +849,7 @@ describe('mrWidgetOptions', () => {
});
});
describe
(
'
suggestPipeline
feature flag
'
,
()
=>
{
describe
(
'
suggestPipeline
'
,
()
=>
{
beforeEach
(()
=>
{
mock
.
onAny
().
reply
(
200
);
...
...
@@ -860,8 +860,6 @@ describe('mrWidgetOptions', () => {
describe
(
'
given feature flag is enabled
'
,
()
=>
{
beforeEach
(()
=>
{
gon
.
features
=
{
suggestPipeline
:
true
};
createComponent
();
vm
.
mr
.
hasCI
=
false
;
...
...
@@ -891,19 +889,5 @@ describe('mrWidgetOptions', () => {
expect
(
findSuggestPipeline
()).
toBeNull
();
});
});
describe
(
'
given feature flag is not enabled
'
,
()
=>
{
beforeEach
(()
=>
{
gon
.
features
=
{
suggestPipeline
:
false
};
createComponent
();
vm
.
mr
.
hasCI
=
false
;
});
it
(
'
should not suggest pipelines when none exist
'
,
()
=>
{
expect
(
findSuggestPipeline
()).
toBeNull
();
});
});
});
});
spec/helpers/blob_helper_spec.rb
View file @
4ff2e1c4
...
...
@@ -236,53 +236,41 @@ RSpec.describe BlobHelper do
let
(
:data
)
{
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
}
let
(
:blob
)
{
fake_blob
(
path:
Gitlab
::
FileDetector
::
PATTERNS
[
:gitlab_ci
],
data:
data
)
}
context
'feature enabled'
do
it
'is true'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_truthy
end
it
'is true'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_truthy
end
context
'file is invalid format'
do
let
(
:data
)
{
'foo'
}
context
'file is invalid format'
do
let
(
:data
)
{
'foo'
}
it
'is false'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_falsey
end
it
'is false'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_falsey
end
end
context
'does not use the default ci config'
do
before
do
project
.
ci_config_path
=
'something_bad'
end
it
'is false'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_falsey
end
context
'does not use the default ci config'
do
before
do
project
.
ci_config_path
=
'something_bad'
end
context
'does not have the needed cookie'
do
before
do
helper
.
request
.
cookies
.
delete
"suggest_gitlab_ci_yml_commit_
#{
project
.
id
}
"
end
it
'is false'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_falsey
end
it
'is false'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_falsey
end
end
context
'blob does not have auxiliary view
'
do
before
do
allow
(
blob
).
to
receive
(
:auxiliary_viewer
).
and_return
(
nil
)
end
context
'does not have the needed cookie
'
do
before
do
helper
.
request
.
cookies
.
delete
"suggest_gitlab_ci_yml_commit_
#{
project
.
id
}
"
end
it
'is false'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_falsey
end
it
'is false'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_falsey
end
end
context
'
feature disabled
'
do
context
'
blob does not have auxiliary view
'
do
before
do
stub_feature_flags
(
suggest_pipeline:
false
)
allow
(
blob
).
to
receive
(
:auxiliary_viewer
).
and_return
(
nil
)
end
it
'is false'
do
...
...
@@ -294,10 +282,8 @@ RSpec.describe BlobHelper do
context
'when file is not a pipeline config file'
do
let
(
:blob
)
{
fake_blob
(
path:
'LICENSE'
)
}
context
'feature enabled'
do
it
'is false'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_falsey
end
it
'is false'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_falsey
end
end
end
...
...
spec/serializers/merge_request_widget_entity_spec.rb
View file @
4ff2e1c4
...
...
@@ -285,54 +285,34 @@ RSpec.describe MergeRequestWidgetEntity do
end
describe
'user callouts'
do
context
'when suggest pipeline feature is enabled'
do
subject
{
described_class
.
new
(
resource
,
request:
request
,
experiment_enabled: :suggest_pipeline
).
as_json
}
subject
{
described_class
.
new
(
resource
,
request:
request
).
as_json
}
it
'provides a valid path value for user callout path'
do
expect
(
subject
[
:user_callouts_path
]).
to
eq
'/-/user_callouts'
end
it
'provides a valid value for suggest pipeline feature id'
do
expect
(
subject
[
:suggest_pipeline_feature_id
]).
to
eq
described_class
::
SUGGEST_PIPELINE
end
it
'provides a valid value for if it is dismissed'
do
expect
(
subject
[
:is_dismissed_suggest_pipeline
]).
to
be
(
false
)
end
context
'when the suggest pipeline has been dismissed'
do
before
do
create
(
:user_callout
,
user:
user
,
feature_name:
described_class
::
SUGGEST_PIPELINE
)
end
it
'indicates suggest pipeline has been dismissed'
do
expect
(
subject
[
:is_dismissed_suggest_pipeline
]).
to
be
(
true
)
end
end
it
'provides a valid path value for user callout path'
do
expect
(
subject
[
:user_callouts_path
]).
to
eq
'/-/user_callouts'
end
context
'when user is not logged in'
do
let
(
:request
)
{
double
(
'request'
,
current_user:
nil
,
project:
project
)
}
it
'provides a valid value for suggest pipeline feature id'
do
expect
(
subject
[
:suggest_pipeline_feature_id
]).
to
eq
described_class
::
SUGGEST_PIPELINE
end
it
'returns a blank is dismissed value'
do
expect
(
subject
[
:is_dismissed_suggest_pipeline
]).
to
be_nil
end
end
it
'provides a valid value for if it is dismissed'
do
expect
(
subject
[
:is_dismissed_suggest_pipeline
]).
to
be
(
false
)
end
context
'when
suggest pipeline feature is not enabl
ed'
do
context
'when
the suggest pipeline has been dismiss
ed'
do
before
do
stub_feature_flags
(
suggest_pipeline:
false
)
create
(
:user_callout
,
user:
user
,
feature_name:
described_class
::
SUGGEST_PIPELINE
)
end
it
'
provides no valid value for user callout path
'
do
expect
(
subject
[
:
user_callouts_path
]).
to
be_nil
it
'
indicates suggest pipeline has been dismissed
'
do
expect
(
subject
[
:
is_dismissed_suggest_pipeline
]).
to
be
(
true
)
end
end
it
'provides no valid value for suggest pipeline feature id'
do
expect
(
subject
[
:suggest_pipeline_feature_id
]).
to
be_nil
end
context
'when user is not logged in'
do
let
(
:request
)
{
double
(
'request'
,
current_user:
nil
,
project:
project
)
}
it
'
provides no valid value for if it is dismissed
'
do
it
'
returns a blank is dismissed value
'
do
expect
(
subject
[
:is_dismissed_suggest_pipeline
]).
to
be_nil
end
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