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
2cd5f623
Commit
2cd5f623
authored
Nov 09, 2021
by
eugielimpin
Committed by
Douglas Barbosa Alexandre
Nov 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup experiment in Pipeline Editor controller
parent
ec60abcf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
4 deletions
+34
-4
app/controllers/projects/ci/pipeline_editor_controller.rb
app/controllers/projects/ci/pipeline_editor_controller.rb
+7
-0
config/feature_flags/experiment/pipeline_editor_walkthrough.yml
.../feature_flags/experiment/pipeline_editor_walkthrough.yml
+8
-0
spec/controllers/projects/ci/pipeline_editor_controller_spec.rb
...ontrollers/projects/ci/pipeline_editor_controller_spec.rb
+19
-4
No files found.
app/controllers/projects/ci/pipeline_editor_controller.rb
View file @
2cd5f623
...
...
@@ -2,6 +2,7 @@
class
Projects::Ci::PipelineEditorController
<
Projects
::
ApplicationController
before_action
:check_can_collaborate!
before_action
:setup_walkthrough_experiment
,
only: :show
before_action
do
push_frontend_feature_flag
(
:schema_linting
,
@project
,
default_enabled: :yaml
)
end
...
...
@@ -16,4 +17,10 @@ class Projects::Ci::PipelineEditorController < Projects::ApplicationController
def
check_can_collaborate!
render_404
unless
can_collaborate_with_project?
(
@project
)
end
def
setup_walkthrough_experiment
experiment
(
:pipeline_editor_walkthrough
,
actor:
current_user
)
do
|
e
|
e
.
candidate
{}
end
end
end
config/feature_flags/experiment/pipeline_editor_walkthrough.yml
0 → 100644
View file @
2cd5f623
---
name
:
pipeline_editor_walkthrough
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/73050
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/345558
milestone
:
'
14.5'
type
:
experiment
group
:
group::activation
default_enabled
:
false
spec/controllers/projects/ci/pipeline_editor_controller_spec.rb
View file @
2cd5f623
...
...
@@ -6,6 +6,8 @@ RSpec.describe Projects::Ci::PipelineEditorController do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
subject
(
:show_request
)
{
get
:show
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
}
before
do
sign_in
(
user
)
end
...
...
@@ -14,8 +16,7 @@ RSpec.describe Projects::Ci::PipelineEditorController do
context
'with enough privileges'
do
before
do
project
.
add_developer
(
user
)
get
:show
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
show_request
end
it
{
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
}
...
...
@@ -28,13 +29,27 @@ RSpec.describe Projects::Ci::PipelineEditorController do
context
'without enough privileges'
do
before
do
project
.
add_reporter
(
user
)
get
:show
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
show_request
end
it
'responds with 404'
do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
describe
'pipeline_editor_walkthrough experiment'
do
before
do
project
.
add_developer
(
user
)
end
it
'tracks the assignment'
,
:experiment
do
expect
(
experiment
(
:pipeline_editor_walkthrough
))
.
to
track
(
:assignment
)
.
with_context
(
actor:
user
)
.
on_next_instance
show_request
end
end
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