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
d9ad1e4d
Commit
d9ad1e4d
authored
Sep 15, 2020
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove build pending state upon build trace archival
parent
aa6d09db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
0 deletions
+66
-0
app/models/ci/build.rb
app/models/ci/build.rb
+4
-0
app/services/ci/archive_trace_service.rb
app/services/ci/archive_trace_service.rb
+1
-0
spec/requests/api/ci/runner/jobs_put_spec.rb
spec/requests/api/ci/runner/jobs_put_spec.rb
+61
-0
No files found.
app/models/ci/build.rb
View file @
d9ad1e4d
...
...
@@ -954,6 +954,10 @@ module Ci
var
[
:value
]
&
.
to_i
if
var
end
def
remove_pending_state!
pending_state
.
try
(
:delete
)
end
private
def
auto_retry
...
...
app/services/ci/archive_trace_service.rb
View file @
d9ad1e4d
...
...
@@ -13,6 +13,7 @@ module Ci
end
job
.
trace
.
archive!
job
.
remove_pending_state!
# TODO: Remove this logging once we confirmed new live trace architecture is functional.
# See https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/4667.
...
...
spec/requests/api/ci/runner/jobs_put_spec.rb
View file @
d9ad1e4d
...
...
@@ -105,6 +105,67 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
it
{
expect
(
job
).
to
be_unmet_prerequisites
}
end
context
'when unmigrated live trace chunks exist'
do
context
'when accepting trace feature is enabled'
do
before
do
stub_feature_flags
(
ci_accept_trace:
true
)
end
context
'when checksum is present'
do
context
'when live trace chunk is still live'
do
it
'responds with 202'
do
update_job
(
state:
'success'
,
checksum:
'crc32:12345678'
)
expect
(
job
.
pending_state
).
to
be_present
expect
(
response
).
to
have_gitlab_http_status
(
:accepted
)
end
end
context
'when runner retries request after receiving 202'
do
it
'responds with 202 and then with 200'
,
:sidekiq_inline
do
perform_enqueued_jobs
do
update_job
(
state:
'success'
,
checksum:
'crc32:12345678'
)
end
expect
(
job
.
reload
.
pending_state
).
to
be_present
expect
(
response
).
to
have_gitlab_http_status
(
:accepted
)
perform_enqueued_jobs
do
update_job
(
state:
'success'
,
checksum:
'crc32:12345678'
)
end
expect
(
job
.
reload
.
pending_state
).
not_to
be_present
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
context
'when live trace chunk has been migrated'
do
before
do
job
.
trace_chunks
.
first
.
update!
(
data_store: :database
)
end
it
'responds with 200'
do
update_job
(
state:
'success'
,
checksum:
'crc:12345678'
)
expect
(
job
.
reload
).
to
be_success
expect
(
job
.
pending_state
).
not_to
be_present
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
end
context
'when checksum is not present'
do
it
'responds with 200'
do
update_job
(
state:
'success'
)
expect
(
job
.
reload
).
to
be_success
expect
(
job
.
pending_state
).
not_to
be_present
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
end
end
end
context
'when trace is given'
do
...
...
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