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
9b58a431
Commit
9b58a431
authored
Apr 04, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
1871caf3
e2425149
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
5 deletions
+50
-5
app/models/ci/build.rb
app/models/ci/build.rb
+10
-3
app/models/concerns/artifact_migratable.rb
app/models/concerns/artifact_migratable.rb
+13
-1
app/uploaders/legacy_artifact_uploader.rb
app/uploaders/legacy_artifact_uploader.rb
+3
-0
changelogs/unreleased/drop-usage-of-leagcy-artifacts.yml
changelogs/unreleased/drop-usage-of-leagcy-artifacts.yml
+5
-0
lib/gitlab/data_builder/pipeline.rb
lib/gitlab/data_builder/pipeline.rb
+1
-1
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+18
-0
No files found.
app/models/ci/build.rb
View file @
9b58a431
...
...
@@ -83,8 +83,13 @@ module Ci
scope
:unstarted
,
->
()
{
where
(
runner_id:
nil
)
}
scope
:ignore_failures
,
->
()
{
where
(
allow_failure:
false
)
}
scope
:with_artifacts_archive
,
->
()
do
where
(
'(artifacts_file IS NOT NULL AND artifacts_file <> ?) OR EXISTS (?)'
,
''
,
Ci
::
JobArtifact
.
select
(
1
).
where
(
'ci_builds.id = ci_job_artifacts.job_id'
).
archive
)
if
Feature
.
enabled?
(
:ci_enable_legacy_artifacts
)
where
(
'(artifacts_file IS NOT NULL AND artifacts_file <> ?) OR EXISTS (?)'
,
''
,
Ci
::
JobArtifact
.
select
(
1
).
where
(
'ci_builds.id = ci_job_artifacts.job_id'
).
archive
)
else
where
(
'EXISTS (?)'
,
Ci
::
JobArtifact
.
select
(
1
).
where
(
'ci_builds.id = ci_job_artifacts.job_id'
).
archive
)
end
end
scope
:with_existing_job_artifacts
,
->
(
query
)
do
...
...
@@ -135,6 +140,8 @@ module Ci
where
(
"EXISTS (?)"
,
matcher
)
end
##
# TODO: Remove these mounters when we remove :ci_enable_legacy_artifacts feature flag
mount_uploader
:legacy_artifacts_file
,
LegacyArtifactUploader
,
mount_on: :artifacts_file
mount_uploader
:legacy_artifacts_metadata
,
LegacyArtifactUploader
,
mount_on: :artifacts_metadata
...
...
@@ -775,7 +782,7 @@ module Ci
private
def
erase_old_artifacts!
# TODO: To be removed once we get rid of
# TODO: To be removed once we get rid of
ci_enable_legacy_artifacts feature flag
remove_artifacts_file!
remove_artifacts_metadata!
save
...
...
app/models/concerns/artifact_migratable.rb
View file @
9b58a431
...
...
@@ -13,7 +13,7 @@ module ArtifactMigratable
end
def
artifacts?
!
artifacts_expired?
&&
artifacts_file
.
exists?
!
artifacts_expired?
&&
artifacts_file
&
.
exists?
end
def
artifacts_metadata?
...
...
@@ -43,4 +43,16 @@ module ArtifactMigratable
def
artifacts_size
read_attribute
(
:artifacts_size
).
to_i
+
job_artifacts
.
sum
(
:size
).
to_i
end
def
legacy_artifacts_file
return
unless
Feature
.
enabled?
(
:ci_enable_legacy_artifacts
)
super
end
def
legacy_artifacts_metadata
return
unless
Feature
.
enabled?
(
:ci_enable_legacy_artifacts
)
super
end
end
app/uploaders/legacy_artifact_uploader.rb
View file @
9b58a431
# frozen_string_literal: true
##
# TODO: Remove this uploader when we remove :ci_enable_legacy_artifacts feature flag
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/58595
class
LegacyArtifactUploader
<
GitlabUploader
extend
Workhorse
::
UploadPath
include
ObjectStorage
::
Concern
...
...
changelogs/unreleased/drop-usage-of-leagcy-artifacts.yml
0 → 100644
View file @
9b58a431
---
title
:
Drop legacy artifacts usage as there are no leftovers
merge_request
:
24294
author
:
type
:
performance
lib/gitlab/data_builder/pipeline.rb
View file @
9b58a431
...
...
@@ -47,7 +47,7 @@ module Gitlab
user:
build
.
user
.
try
(
:hook_attrs
),
runner:
build
.
runner
&&
runner_hook_attrs
(
build
.
runner
),
artifacts_file:
{
filename:
build
.
artifacts_file
.
filename
,
filename:
build
.
artifacts_file
&
.
filename
,
size:
build
.
artifacts_size
}
}
...
...
spec/models/ci/build_spec.rb
View file @
9b58a431
...
...
@@ -117,6 +117,16 @@ describe Ci::Build do
it
'returns the job'
do
is_expected
.
to
include
(
job
)
end
context
'when ci_enable_legacy_artifacts feature flag is disabled'
do
before
do
stub_feature_flags
(
ci_enable_legacy_artifacts:
false
)
end
it
'does not return the job'
do
is_expected
.
not_to
include
(
job
)
end
end
end
context
'when job has a job artifact archive'
do
...
...
@@ -471,6 +481,14 @@ describe Ci::Build do
let
(
:build
)
{
create
(
:ci_build
,
:legacy_artifacts
)
}
it
{
is_expected
.
to
be_truthy
}
context
'when ci_enable_legacy_artifacts feature flag is disabled'
do
before
do
stub_feature_flags
(
ci_enable_legacy_artifacts:
false
)
end
it
{
is_expected
.
to
be_falsy
}
end
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