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
a7a1d022
Commit
a7a1d022
authored
Apr 28, 2021
by
Furkan Ayhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging for legacy usage of ProcessPipelineService#update_retried
This will help us identify why we still use this method.
parent
f637b48d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
app/services/ci/process_pipeline_service.rb
app/services/ci/process_pipeline_service.rb
+7
-1
spec/services/ci/process_pipeline_service_spec.rb
spec/services/ci/process_pipeline_service_spec.rb
+9
-4
No files found.
app/services/ci/process_pipeline_service.rb
View file @
a7a1d022
...
@@ -48,7 +48,13 @@ module Ci
...
@@ -48,7 +48,13 @@ module Ci
# This counter is temporary. It will be used to check whether if we still use this method or not
# This counter is temporary. It will be used to check whether if we still use this method or not
# after setting correct value of `GenericCommitStatus#retried`.
# after setting correct value of `GenericCommitStatus#retried`.
# More info: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50465#note_491657115
# More info: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50465#note_491657115
metrics
.
legacy_update_jobs_counter
.
increment
if
updated_count
>
0
if
updated_count
>
0
Gitlab
::
AppJsonLogger
.
info
(
event:
'update_retried_is_used'
,
project_id:
pipeline
.
project
.
id
,
pipeline_id:
pipeline
.
id
)
metrics
.
legacy_update_jobs_counter
.
increment
end
end
end
end
end
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: enable CodeReuse/ActiveRecord
...
...
spec/services/ci/process_pipeline_service_spec.rb
View file @
a7a1d022
...
@@ -3,8 +3,7 @@
...
@@ -3,8 +3,7 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
Ci
::
ProcessPipelineService
do
RSpec
.
describe
Ci
::
ProcessPipelineService
do
let
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
do
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
ref:
'master'
,
project:
project
)
create
(
:ci_empty_pipeline
,
ref:
'master'
,
project:
project
)
...
@@ -24,8 +23,6 @@ RSpec.describe Ci::ProcessPipelineService do
...
@@ -24,8 +23,6 @@ RSpec.describe Ci::ProcessPipelineService do
stub_ci_pipeline_to_return_yaml_file
stub_ci_pipeline_to_return_yaml_file
stub_not_protect_default_branch
stub_not_protect_default_branch
project
.
add_developer
(
user
)
allow
(
subject
).
to
receive
(
:metrics
).
and_return
(
metrics
)
allow
(
subject
).
to
receive
(
:metrics
).
and_return
(
metrics
)
end
end
...
@@ -69,6 +66,14 @@ RSpec.describe Ci::ProcessPipelineService do
...
@@ -69,6 +66,14 @@ RSpec.describe Ci::ProcessPipelineService do
subject
.
execute
subject
.
execute
end
end
it
'logs the project and pipeline id'
do
expect
(
Gitlab
::
AppJsonLogger
).
to
receive
(
:info
).
with
(
event:
'update_retried_is_used'
,
project_id:
project
.
id
,
pipeline_id:
pipeline
.
id
)
subject
.
execute
end
context
'when the previous build has already retried column true'
do
context
'when the previous build has already retried column true'
do
before
do
before
do
build_retried
.
update_columns
(
retried:
true
)
build_retried
.
update_columns
(
retried:
true
)
...
...
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