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
59e02c76
Commit
59e02c76
authored
Mar 27, 2020
by
Fabio Pitino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ArtifactsFinder under Ci namespace
Renamed to Ci::JobArtifactsFinder
parent
71b3f9f3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
26 deletions
+28
-26
app/controllers/projects/artifacts_controller.rb
app/controllers/projects/artifacts_controller.rb
+1
-1
app/finders/artifacts_finder.rb
app/finders/artifacts_finder.rb
+0
-24
app/finders/ci/job_artifacts_finder.rb
app/finders/ci/job_artifacts_finder.rb
+26
-0
spec/finders/ci/job_artifacts_finder_spec.rb
spec/finders/ci/job_artifacts_finder_spec.rb
+1
-1
No files found.
app/controllers/projects/artifacts_controller.rb
View file @
59e02c76
...
...
@@ -22,7 +22,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
# issues: https://gitlab.com/gitlab-org/gitlab/issues/32281
return
head
:no_content
unless
Feature
.
enabled?
(
:artifacts_management_page
,
@project
)
finder
=
ArtifactsFinder
.
new
(
@project
,
artifacts_params
)
finder
=
Ci
::
Job
ArtifactsFinder
.
new
(
@project
,
artifacts_params
)
all_artifacts
=
finder
.
execute
@artifacts
=
all_artifacts
.
page
(
params
[
:page
]).
per
(
MAX_PER_PAGE
)
...
...
app/finders/artifacts_finder.rb
deleted
100644 → 0
View file @
71b3f9f3
# frozen_string_literal: true
class
ArtifactsFinder
def
initialize
(
project
,
params
=
{})
@project
=
project
@params
=
params
end
def
execute
artifacts
=
@project
.
job_artifacts
sort
(
artifacts
)
end
private
def
sort_key
@params
[
:sort
]
||
'created_desc'
end
def
sort
(
artifacts
)
artifacts
.
order_by
(
sort_key
)
end
end
app/finders/ci/job_artifacts_finder.rb
0 → 100644
View file @
59e02c76
# frozen_string_literal: true
module
Ci
class
JobArtifactsFinder
def
initialize
(
project
,
params
=
{})
@project
=
project
@params
=
params
end
def
execute
artifacts
=
@project
.
job_artifacts
sort
(
artifacts
)
end
private
def
sort_key
@params
[
:sort
]
||
'created_desc'
end
def
sort
(
artifacts
)
artifacts
.
order_by
(
sort_key
)
end
end
end
spec/finders/artifacts_finder_spec.rb
→
spec/finders/
ci/job_
artifacts_finder_spec.rb
View file @
59e02c76
...
...
@@ -2,7 +2,7 @@
require
'spec_helper'
describe
ArtifactsFinder
do
describe
Ci
::
Job
ArtifactsFinder
do
let
(
:project
)
{
create
(
:project
)
}
describe
'#execute'
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