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
b4f2e859
Commit
b4f2e859
authored
Jun 24, 2021
by
Furkan Ayhan
Committed by
Fabio Pitino
Jul 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the service method name
parent
096a7c43
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
app/services/ci/pipelines/add_job_service.rb
app/services/ci/pipelines/add_job_service.rb
+2
-2
app/services/ci/retry_build_service.rb
app/services/ci/retry_build_service.rb
+1
-1
app/services/projects/update_pages_service.rb
app/services/projects/update_pages_service.rb
+1
-1
lib/api/commit_statuses.rb
lib/api/commit_statuses.rb
+1
-1
spec/services/ci/pipelines/add_job_service_spec.rb
spec/services/ci/pipelines/add_job_service_spec.rb
+4
-4
No files found.
app/services/ci/pipelines/add_job_service.rb
View file @
b4f2e859
...
...
@@ -8,10 +8,10 @@ module Ci
def
initialize
(
pipeline
)
@pipeline
=
pipeline
raise
"Pipeline must be persisted for this service to be used"
unless
@pipeline
.
persisted?
raise
ArgumentError
,
"Pipeline must be persisted for this service to be used"
unless
@pipeline
.
persisted?
end
def
execute
(
job
,
save:
true
)
def
execute
!
(
job
,
save:
true
)
assign_pipeline_attributes
(
job
)
Ci
::
Pipeline
.
transaction
do
...
...
app/services/ci/retry_build_service.rb
View file @
b4f2e859
...
...
@@ -35,7 +35,7 @@ module Ci
check_access!
(
build
)
new_build
=
clone_build
(
build
)
::
Ci
::
Pipelines
::
AddJobService
.
new
(
build
.
pipeline
).
execute
(
new_build
)
::
Ci
::
Pipelines
::
AddJobService
.
new
(
build
.
pipeline
).
execute
!
(
new_build
)
build
.
reset
# refresh the data to get new values of `retried` and `processed`.
new_build
...
...
app/services/projects/update_pages_service.rb
View file @
b4f2e859
...
...
@@ -32,7 +32,7 @@ module Projects
# Create status notifying the deployment of pages
@status
=
build_commit_status
::
Ci
::
Pipelines
::
AddJobService
.
new
(
@build
.
pipeline
).
execute
(
@status
)
::
Ci
::
Pipelines
::
AddJobService
.
new
(
@build
.
pipeline
).
execute
!
(
@status
)
@status
.
enqueue!
@status
.
run!
...
...
lib/api/commit_statuses.rb
View file @
b4f2e859
...
...
@@ -100,7 +100,7 @@ module API
status
.
assign_attributes
(
attributes_for_keys
(
updatable_optional_attributes
))
if
status
.
valid?
::
Ci
::
Pipelines
::
AddJobService
.
new
(
pipeline
).
execute
(
status
,
save:
false
)
::
Ci
::
Pipelines
::
AddJobService
.
new
(
pipeline
).
execute
!
(
status
,
save:
false
)
else
render_validation_error!
(
status
)
end
...
...
spec/services/ci/pipelines/add_job_service_spec.rb
View file @
b4f2e859
...
...
@@ -19,20 +19,20 @@ RSpec.describe Ci::Pipelines::AddJobService do
it
'assigns pipeline attributes to the job'
do
expect
do
service
.
execute
(
job
)
service
.
execute
!
(
job
)
end
.
to
change
{
job
.
slice
(
:pipeline
,
:project
,
:ref
)
}.
to
(
pipeline:
pipeline
,
project:
pipeline
.
project
,
ref:
pipeline
.
ref
)
end
it
'returns the job itself'
do
expect
(
service
.
execute
(
job
)).
to
eq
(
job
)
expect
(
service
.
execute
!
(
job
)).
to
eq
(
job
)
end
it
'calls update_older_statuses_retried!'
do
expect
(
job
).
to
receive
(
:update_older_statuses_retried!
)
service
.
execute
(
job
)
service
.
execute
!
(
job
)
end
context
'when the FF ci_fix_commit_status_retried is disabled'
do
...
...
@@ -43,7 +43,7 @@ RSpec.describe Ci::Pipelines::AddJobService do
it
'does not call update_older_statuses_retried!'
do
expect
(
job
).
not_to
receive
(
:update_older_statuses_retried!
)
service
.
execute
(
job
)
service
.
execute
!
(
job
)
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