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
a076f26c
Commit
a076f26c
authored
Mar 23, 2020
by
Nick Kipling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add has_version check to package finders
Updated project and group finders Updated tests for each
parent
b67ee058
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
1 deletion
+14
-1
ee/app/finders/packages/group_packages_finder.rb
ee/app/finders/packages/group_packages_finder.rb
+1
-0
ee/app/finders/packages/packages_finder.rb
ee/app/finders/packages/packages_finder.rb
+1
-1
ee/spec/finders/packages/group_packages_finder_spec.rb
ee/spec/finders/packages/group_packages_finder_spec.rb
+6
-0
ee/spec/finders/packages/packages_finder_spec.rb
ee/spec/finders/packages/packages_finder_spec.rb
+6
-0
No files found.
ee/app/finders/packages/group_packages_finder.rb
View file @
a076f26c
...
...
@@ -22,6 +22,7 @@ module Packages
packages
=
::
Packages
::
Package
.
for_projects
(
group_projects_visible_to_current_user
)
.
processed
.
has_version
.
sort_by_attribute
(
"
#{
params
[
:order_by
]
}
_
#{
params
[
:sort
]
}
"
)
return
packages
unless
package_type
...
...
ee/app/finders/packages/packages_finder.rb
View file @
a076f26c
...
...
@@ -13,7 +13,7 @@ module Packages
end
def
execute
packages
=
project
.
packages
.
processed
packages
=
project
.
packages
.
processed
.
has_version
packages
=
filter_by_package_type
(
packages
)
packages
=
filter_by_package_name
(
packages
)
packages
=
order_packages
(
packages
)
...
...
ee/spec/finders/packages/group_packages_finder_spec.rb
View file @
a076f26c
...
...
@@ -52,6 +52,12 @@ describe Packages::GroupPackagesFinder do
it
{
is_expected
.
to
match_array
([
package1
,
package2
])
}
end
context
'does not include packages without version number'
do
let!
(
:package_without_version
)
{
create
(
:maven_package
,
project:
project
,
version:
nil
)
}
it
{
is_expected
.
not_to
include
(
package_without_version
)
}
end
end
context
'group has package of all types'
do
...
...
ee/spec/finders/packages/packages_finder_spec.rb
View file @
a076f26c
...
...
@@ -80,5 +80,11 @@ describe ::Packages::PackagesFinder do
it
{
is_expected
.
to
match_array
([
conan_package
,
maven_package
])
}
end
context
'does not include packages without version number'
do
let_it_be
(
:package_without_version
)
{
create
(
:maven_package
,
project:
project
,
version:
nil
)
}
it
{
is_expected
.
not_to
include
(
package_without_version
)
}
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