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
c4566a3f
Commit
c4566a3f
authored
Apr 29, 2020
by
Matija Čupić
Committed by
Robert Speicher
Apr 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gate feature behind FF
parent
25d703d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
app/services/ci/create_job_artifacts_service.rb
app/services/ci/create_job_artifacts_service.rb
+9
-4
app/services/ci/destroy_expired_job_artifacts_service.rb
app/services/ci/destroy_expired_job_artifacts_service.rb
+7
-1
No files found.
app/services/ci/create_job_artifacts_service.rb
View file @
c4566a3f
...
...
@@ -33,8 +33,7 @@ module Ci
file_type:
params
[
'artifact_type'
],
file_format:
params
[
'artifact_format'
],
file_sha256:
artifacts_file
.
sha256
,
expire_in:
expire_in
,
locked:
true
)
expire_in:
expire_in
)
artifact_metadata
=
if
metadata_file
Ci
::
JobArtifact
.
new
(
...
...
@@ -44,10 +43,14 @@ module Ci
file_type: :metadata
,
file_format: :gzip
,
file_sha256:
metadata_file
.
sha256
,
expire_in:
expire_in
,
locked:
true
)
expire_in:
expire_in
)
end
if
Feature
.
enabled?
(
:keep_latest_artifact_for_ref
,
job
.
project
)
artifact
.
locked
=
true
artifact_metadata
.
locked
=
true
end
[
artifact
,
artifact_metadata
]
end
...
...
@@ -85,6 +88,8 @@ module Ci
end
def
unlock_previous_artifacts!
(
artifact
)
return
unless
Feature
.
enabled?
(
:keep_latest_artifact_for_ref
,
artifact
.
job
.
project
)
Ci
::
JobArtifact
.
for_ref
(
artifact
.
job
.
ref
,
artifact
.
project_id
).
locked
.
update_all
(
locked:
false
)
end
...
...
app/services/ci/destroy_expired_job_artifacts_service.rb
View file @
c4566a3f
...
...
@@ -28,7 +28,13 @@ module Ci
private
def
destroy_batch
artifacts
=
Ci
::
JobArtifact
.
expired
(
BATCH_SIZE
).
unlocked
.
to_a
artifact_batch
=
if
Feature
.
enabled?
(
:keep_latest_artifact_for_ref
)
Ci
::
JobArtifact
.
expired
(
BATCH_SIZE
).
unlocked
else
Ci
::
JobArtifact
.
expired
(
BATCH_SIZE
)
end
artifacts
=
artifact_batch
.
to_a
return
false
if
artifacts
.
empty?
...
...
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