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
cb49dc14
Commit
cb49dc14
authored
Nov 05, 2021
by
Furkan Ayhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove FF ci_create_external_pr_pipeline_async
It has been enabled by default since 14.4 Changelog: other
parent
a44cff16
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
84 deletions
+3
-84
app/services/ci/external_pull_requests/create_pipeline_service.rb
...ices/ci/external_pull_requests/create_pipeline_service.rb
+3
-8
config/feature_flags/development/ci_create_external_pr_pipeline_async.yml
...lags/development/ci_create_external_pr_pipeline_async.yml
+0
-8
ee/spec/requests/api/project_mirror_spec.rb
ee/spec/requests/api/project_mirror_spec.rb
+0
-23
ee/spec/services/ci/external_pull_requests/process_github_event_service_spec.rb
...ternal_pull_requests/process_github_event_service_spec.rb
+0
-23
spec/services/ci/external_pull_requests/create_pipeline_service_spec.rb
...ci/external_pull_requests/create_pipeline_service_spec.rb
+0
-22
No files found.
app/services/ci/external_pull_requests/create_pipeline_service.rb
View file @
cb49dc14
...
...
@@ -16,14 +16,9 @@ module Ci
private
def
create_pipeline_for
(
pull_request
)
if
::
Feature
.
enabled?
(
:ci_create_external_pr_pipeline_async
,
project
,
default_enabled: :yaml
)
Ci
::
ExternalPullRequests
::
CreatePipelineWorker
.
perform_async
(
project
.
id
,
current_user
.
id
,
pull_request
.
id
)
else
Ci
::
CreatePipelineService
.
new
(
project
,
current_user
,
create_params
(
pull_request
))
.
execute
(
:external_pull_request_event
,
external_pull_request:
pull_request
)
end
Ci
::
ExternalPullRequests
::
CreatePipelineWorker
.
perform_async
(
project
.
id
,
current_user
.
id
,
pull_request
.
id
)
end
def
create_params
(
pull_request
)
...
...
config/feature_flags/development/ci_create_external_pr_pipeline_async.yml
deleted
100644 → 0
View file @
a44cff16
---
name
:
ci_create_external_pr_pipeline_async
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68567
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/338908
milestone
:
'
14.3'
type
:
development
group
:
group::pipeline authoring
default_enabled
:
true
ee/spec/requests/api/project_mirror_spec.rb
View file @
cb49dc14
...
...
@@ -84,29 +84,6 @@ RSpec.describe API::ProjectMirror do
subject
(
:send_request
)
{
do_post
(
params:
params
)
}
shared_examples_for
'triggering pipeline creation'
do
context
'when the FF ci_create_external_pr_pipeline_async is disabled'
do
before
do
stub_feature_flags
(
ci_create_external_pr_pipeline_async:
false
)
end
let
(
:create_pipeline_service
)
{
instance_double
(
Ci
::
CreatePipelineService
)
}
it
'triggers a pipeline for pull request'
do
expect
(
Ci
::
CreatePipelineService
)
.
to
receive
(
:new
)
.
with
(
project_mirrored
,
user
,
pipeline_params
)
.
and_return
(
create_pipeline_service
)
expect
(
create_pipeline_service
)
.
to
receive
(
:execute
)
.
with
(
:external_pull_request_event
,
any_args
)
send_request
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
it
'enqueues Ci::ExternalPullRequests::CreatePipelineWorker'
do
expect
{
send_request
}
.
to
change
{
ExternalPullRequest
.
count
}.
by
(
1
)
...
...
ee/spec/services/ci/external_pull_requests/process_github_event_service_spec.rb
View file @
cb49dc14
...
...
@@ -53,29 +53,6 @@ RSpec.describe Ci::ExternalPullRequests::ProcessGithubEventService do
let
(
:source_branch
)
{
branch
.
name
}
let
(
:source_sha
)
{
branch
.
target
}
context
'when the FF ci_create_external_pr_pipeline_async is disabled'
do
before
do
stub_feature_flags
(
ci_create_external_pr_pipeline_async:
false
)
end
let
(
:create_pipeline_service
)
{
instance_double
(
Ci
::
CreatePipelineService
)
}
it
'creates a pipeline and the external pull request'
do
pipeline_params
=
{
ref:
Gitlab
::
Git
::
BRANCH_REF_PREFIX
+
branch
.
name
,
source_sha:
branch
.
target
,
target_sha:
'a09386439ca39abe575675ffd4b89ae824fec22f'
}
expect
(
Ci
::
CreatePipelineService
).
to
receive
(
:new
)
.
with
(
project
,
user
,
pipeline_params
)
.
and_return
(
create_pipeline_service
)
expect
(
create_pipeline_service
).
to
receive
(
:execute
)
.
with
(
:external_pull_request_event
,
any_args
)
expect
{
subject
.
execute
(
params
)
}.
to
change
{
ExternalPullRequest
.
count
}.
by
(
1
)
end
end
it
'enqueues Ci::ExternalPullRequests::CreatePipelineWorker'
do
expect
{
subject
.
execute
(
params
)
}
.
to
change
{
ExternalPullRequest
.
count
}.
by
(
1
)
...
...
spec/services/ci/external_pull_requests/create_pipeline_service_spec.rb
View file @
cb49dc14
...
...
@@ -26,28 +26,6 @@ RSpec.describe Ci::ExternalPullRequests::CreatePipelineService do
pull_request
.
update!
(
source_branch:
source_branch
.
name
,
source_sha:
source_branch
.
target
)
end
context
'when the FF ci_create_external_pr_pipeline_async is disabled'
do
before
do
stub_feature_flags
(
ci_create_external_pr_pipeline_async:
false
)
end
it
'creates a pipeline for external pull request'
,
:aggregate_failures
do
pipeline
=
execute
.
payload
expect
(
execute
).
to
be_success
expect
(
pipeline
).
to
be_valid
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
).
to
be_external_pull_request_event
expect
(
pipeline
).
to
eq
(
project
.
ci_pipelines
.
last
)
expect
(
pipeline
.
external_pull_request
).
to
eq
(
pull_request
)
expect
(
pipeline
.
user
).
to
eq
(
user
)
expect
(
pipeline
.
status
).
to
eq
(
'created'
)
expect
(
pipeline
.
ref
).
to
eq
(
pull_request
.
source_branch
)
expect
(
pipeline
.
sha
).
to
eq
(
pull_request
.
source_sha
)
expect
(
pipeline
.
source_sha
).
to
eq
(
pull_request
.
source_sha
)
end
end
it
'enqueues Ci::ExternalPullRequests::CreatePipelineWorker'
do
expect
{
execute
}
.
to
change
{
::
Ci
::
ExternalPullRequests
::
CreatePipelineWorker
.
jobs
.
count
}
...
...
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