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
ca8e9af3
Commit
ca8e9af3
authored
Nov 04, 2021
by
Furkan Ayhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove FF ci_new_artifact_file_reader
It has been enabled by default since 14.3 Changelog: other
parent
a44cff16
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
46 deletions
+0
-46
config/feature_flags/development/ci_new_artifact_file_reader.yml
...feature_flags/development/ci_new_artifact_file_reader.yml
+0
-8
lib/gitlab/ci/artifact_file_reader.rb
lib/gitlab/ci/artifact_file_reader.rb
+0
-27
spec/lib/gitlab/ci/artifact_file_reader_spec.rb
spec/lib/gitlab/ci/artifact_file_reader_spec.rb
+0
-11
No files found.
config/feature_flags/development/ci_new_artifact_file_reader.yml
deleted
100644 → 0
View file @
a44cff16
---
name
:
ci_new_artifact_file_reader
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46552
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/273755
milestone
:
'
13.6'
type
:
development
group
:
group::pipeline authoring
default_enabled
:
true
lib/gitlab/ci/artifact_file_reader.rb
View file @
ca8e9af3
...
@@ -45,14 +45,6 @@ module Gitlab
...
@@ -45,14 +45,6 @@ module Gitlab
end
end
def
read_zip_file!
(
file_path
)
def
read_zip_file!
(
file_path
)
if
::
Feature
.
enabled?
(
:ci_new_artifact_file_reader
,
job
.
project
,
default_enabled: :yaml
)
read_with_new_artifact_file_reader
(
file_path
)
else
read_with_legacy_artifact_file_reader
(
file_path
)
end
end
def
read_with_new_artifact_file_reader
(
file_path
)
job
.
artifacts_file
.
use_open_file
do
|
file
|
job
.
artifacts_file
.
use_open_file
do
|
file
|
zip_file
=
Zip
::
File
.
new
(
file
,
false
,
true
)
zip_file
=
Zip
::
File
.
new
(
file
,
false
,
true
)
entry
=
zip_file
.
find_entry
(
file_path
)
entry
=
zip_file
.
find_entry
(
file_path
)
...
@@ -69,25 +61,6 @@ module Gitlab
...
@@ -69,25 +61,6 @@ module Gitlab
end
end
end
end
def
read_with_legacy_artifact_file_reader
(
file_path
)
job
.
artifacts_file
.
use_file
do
|
archive_path
|
Zip
::
File
.
open
(
archive_path
)
do
|
zip_file
|
entry
=
zip_file
.
find_entry
(
file_path
)
unless
entry
raise
Error
,
"Path `
#{
file_path
}
` does not exist inside the `
#{
job
.
name
}
` artifacts archive!"
end
if
entry
.
name_is_directory?
raise
Error
,
"Path `
#{
file_path
}
` was expected to be a file but it was a directory!"
end
zip_file
.
get_input_stream
(
entry
)
do
|
is
|
is
.
read
end
end
end
end
def
max_archive_size_in_mb
def
max_archive_size_in_mb
ActiveSupport
::
NumberHelper
.
number_to_human_size
(
MAX_ARCHIVE_SIZE
)
ActiveSupport
::
NumberHelper
.
number_to_human_size
(
MAX_ARCHIVE_SIZE
)
end
end
...
...
spec/lib/gitlab/ci/artifact_file_reader_spec.rb
View file @
ca8e9af3
...
@@ -18,17 +18,6 @@ RSpec.describe Gitlab::Ci::ArtifactFileReader do
...
@@ -18,17 +18,6 @@ RSpec.describe Gitlab::Ci::ArtifactFileReader do
expect
(
YAML
.
safe_load
(
subject
).
keys
).
to
contain_exactly
(
'rspec'
,
'time'
,
'custom'
)
expect
(
YAML
.
safe_load
(
subject
).
keys
).
to
contain_exactly
(
'rspec'
,
'time'
,
'custom'
)
end
end
context
'when FF ci_new_artifact_file_reader is disabled'
do
before
do
stub_feature_flags
(
ci_new_artifact_file_reader:
false
)
end
it
'returns the content at the path'
do
is_expected
.
to
be_present
expect
(
YAML
.
safe_load
(
subject
).
keys
).
to
contain_exactly
(
'rspec'
,
'time'
,
'custom'
)
end
end
context
'when path does not exist'
do
context
'when path does not exist'
do
let
(
:path
)
{
'file/does/not/exist.txt'
}
let
(
:path
)
{
'file/does/not/exist.txt'
}
let
(
:expected_error
)
do
let
(
:expected_error
)
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