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
3d456450
Commit
3d456450
authored
Sep 28, 2020
by
ggelatti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds debian package type
- adds debian pkg type - adds specs for type - Update graphql docs
parent
24b3ceda
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
28 deletions
+45
-28
app/graphql/types/package_type_enum.rb
app/graphql/types/package_type_enum.rb
+1
-1
app/models/packages/event.rb
app/models/packages/event.rb
+1
-1
app/models/packages/package.rb
app/models/packages/package.rb
+1
-1
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+13
-8
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+14
-8
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+9
-8
spec/factories/packages.rb
spec/factories/packages.rb
+4
-0
spec/graphql/types/package_type_enum_spec.rb
spec/graphql/types/package_type_enum_spec.rb
+1
-1
spec/support/shared_examples/services/packages_shared_examples.rb
...port/shared_examples/services/packages_shared_examples.rb
+1
-0
No files found.
app/graphql/types/package_type_enum.rb
View file @
3d456450
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Types
module
Types
class
PackageTypeEnum
<
BaseEnum
class
PackageTypeEnum
<
BaseEnum
::
Packages
::
Package
.
package_types
.
keys
.
each
do
|
package_type
|
::
Packages
::
Package
.
package_types
.
keys
.
each
do
|
package_type
|
value
package_type
.
to_s
.
upcase
,
"Packages from the
#{
package_type
}
package manager"
,
value:
package_type
.
to_s
value
package_type
.
to_s
.
upcase
,
"Packages from the
#{
package_type
.
capitalize
}
package manager"
,
value:
package_type
.
to_s
end
end
end
end
end
end
app/models/packages/event.rb
View file @
3d456450
...
@@ -4,7 +4,7 @@ class Packages::Event < ApplicationRecord
...
@@ -4,7 +4,7 @@ class Packages::Event < ApplicationRecord
belongs_to
:package
,
optional:
true
belongs_to
:package
,
optional:
true
# FIXME: Remove debian: 9 from here when it's added to the types in package.rb model
# FIXME: Remove debian: 9 from here when it's added to the types in package.rb model
EVENT_SCOPES
=
::
Packages
::
Package
.
package_types
.
merge
(
debian:
9
,
container:
1000
,
tag:
1001
).
freeze
EVENT_SCOPES
=
::
Packages
::
Package
.
package_types
.
merge
(
container:
1000
,
tag:
1001
).
freeze
enum
event_scope:
EVENT_SCOPES
enum
event_scope:
EVENT_SCOPES
...
...
app/models/packages/package.rb
View file @
3d456450
...
@@ -47,7 +47,7 @@ class Packages::Package < ApplicationRecord
...
@@ -47,7 +47,7 @@ class Packages::Package < ApplicationRecord
format:
{
with:
Gitlab
::
Regex
.
generic_package_version_regex
},
format:
{
with:
Gitlab
::
Regex
.
generic_package_version_regex
},
if: :generic?
if: :generic?
enum
package_type:
{
maven:
1
,
npm:
2
,
conan:
3
,
nuget:
4
,
pypi:
5
,
composer:
6
,
generic:
7
,
golang:
8
}
enum
package_type:
{
maven:
1
,
npm:
2
,
conan:
3
,
nuget:
4
,
pypi:
5
,
composer:
6
,
generic:
7
,
golang:
8
,
debian:
9
}
scope
:with_name
,
->
(
name
)
{
where
(
name:
name
)
}
scope
:with_name
,
->
(
name
)
{
where
(
name:
name
)
}
scope
:with_name_like
,
->
(
name
)
{
where
(
arel_table
[
:name
].
matches
(
name
))
}
scope
:with_name_like
,
->
(
name
)
{
where
(
arel_table
[
:name
].
matches
(
name
))
}
...
...
doc/api/graphql/reference/gitlab_schema.graphql
View file @
3d456450
...
@@ -12288,42 +12288,47 @@ type PackageFileRegistryEdge {
...
@@ -12288,42 +12288,47 @@ type PackageFileRegistryEdge {
enum
PackageTypeEnum
{
enum
PackageTypeEnum
{
"""
"""
Packages
from
the
c
omposer
package
manager
Packages
from
the
C
omposer
package
manager
"""
"""
COMPOSER
COMPOSER
"""
"""
Packages
from
the
c
onan
package
manager
Packages
from
the
C
onan
package
manager
"""
"""
CONAN
CONAN
"""
"""
Packages
from
the
generic
package
manager
Packages
from
the
Debian
package
manager
"""
DEBIAN
"""
Packages
from
the
Generic
package
manager
"""
"""
GENERIC
GENERIC
"""
"""
Packages
from
the
g
olang
package
manager
Packages
from
the
G
olang
package
manager
"""
"""
GOLANG
GOLANG
"""
"""
Packages
from
the
m
aven
package
manager
Packages
from
the
M
aven
package
manager
"""
"""
MAVEN
MAVEN
"""
"""
Packages
from
the
n
pm
package
manager
Packages
from
the
N
pm
package
manager
"""
"""
NPM
NPM
"""
"""
Packages
from
the
n
uget
package
manager
Packages
from
the
N
uget
package
manager
"""
"""
NUGET
NUGET
"""
"""
Packages
from
the
p
ypi
package
manager
Packages
from
the
P
ypi
package
manager
"""
"""
PYPI
PYPI
}
}
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
3d456450
...
@@ -36389,49 +36389,55 @@
...
@@ -36389,49 +36389,55 @@
"enumValues": [
"enumValues": [
{
{
"name": "MAVEN",
"name": "MAVEN",
"description": "Packages from the
m
aven package manager",
"description": "Packages from the
M
aven package manager",
"isDeprecated": false,
"isDeprecated": false,
"deprecationReason": null
"deprecationReason": null
},
},
{
{
"name": "NPM",
"name": "NPM",
"description": "Packages from the
n
pm package manager",
"description": "Packages from the
N
pm package manager",
"isDeprecated": false,
"isDeprecated": false,
"deprecationReason": null
"deprecationReason": null
},
},
{
{
"name": "CONAN",
"name": "CONAN",
"description": "Packages from the
c
onan package manager",
"description": "Packages from the
C
onan package manager",
"isDeprecated": false,
"isDeprecated": false,
"deprecationReason": null
"deprecationReason": null
},
},
{
{
"name": "NUGET",
"name": "NUGET",
"description": "Packages from the
n
uget package manager",
"description": "Packages from the
N
uget package manager",
"isDeprecated": false,
"isDeprecated": false,
"deprecationReason": null
"deprecationReason": null
},
},
{
{
"name": "PYPI",
"name": "PYPI",
"description": "Packages from the
p
ypi package manager",
"description": "Packages from the
P
ypi package manager",
"isDeprecated": false,
"isDeprecated": false,
"deprecationReason": null
"deprecationReason": null
},
},
{
{
"name": "COMPOSER",
"name": "COMPOSER",
"description": "Packages from the
c
omposer package manager",
"description": "Packages from the
C
omposer package manager",
"isDeprecated": false,
"isDeprecated": false,
"deprecationReason": null
"deprecationReason": null
},
},
{
{
"name": "GENERIC",
"name": "GENERIC",
"description": "Packages from the
g
eneric package manager",
"description": "Packages from the
G
eneric package manager",
"isDeprecated": false,
"isDeprecated": false,
"deprecationReason": null
"deprecationReason": null
},
},
{
{
"name": "GOLANG",
"name": "GOLANG",
"description": "Packages from the golang package manager",
"description": "Packages from the Golang package manager",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "DEBIAN",
"description": "Packages from the Debian package manager",
"isDeprecated": false,
"isDeprecated": false,
"deprecationReason": null
"deprecationReason": null
}
}
doc/api/graphql/reference/index.md
View file @
3d456450
...
@@ -3431,14 +3431,15 @@ Values for sorting projects.
...
@@ -3431,14 +3431,15 @@ Values for sorting projects.
| Value | Description |
| Value | Description |
| ----- | ----------- |
| ----- | ----------- |
|
`COMPOSER`
| Packages from the composer package manager |
|
`COMPOSER`
| Packages from the Composer package manager |
|
`CONAN`
| Packages from the conan package manager |
|
`CONAN`
| Packages from the Conan package manager |
|
`GENERIC`
| Packages from the generic package manager |
|
`DEBIAN`
| Packages from the Debian package manager |
|
`GOLANG`
| Packages from the golang package manager |
|
`GENERIC`
| Packages from the Generic package manager |
|
`MAVEN`
| Packages from the maven package manager |
|
`GOLANG`
| Packages from the Golang package manager |
|
`NPM`
| Packages from the npm package manager |
|
`MAVEN`
| Packages from the Maven package manager |
|
`NUGET`
| Packages from the nuget package manager |
|
`NPM`
| Packages from the Npm package manager |
|
`PYPI`
| Packages from the pypi package manager |
|
`NUGET`
| Packages from the Nuget package manager |
|
`PYPI`
| Packages from the Pypi package manager |
### PipelineConfigSourceEnum
### PipelineConfigSourceEnum
...
...
spec/factories/packages.rb
View file @
3d456450
...
@@ -21,6 +21,10 @@ FactoryBot.define do
...
@@ -21,6 +21,10 @@ FactoryBot.define do
end
end
end
end
factory
:debian_package
do
package_type
{
:debian
}
end
factory
:npm_package
do
factory
:npm_package
do
sequence
(
:name
)
{
|
n
|
"@
#{
project
.
root_namespace
.
path
}
/package-
#{
n
}
"
}
sequence
(
:name
)
{
|
n
|
"@
#{
project
.
root_namespace
.
path
}
/package-
#{
n
}
"
}
version
{
'1.0.0'
}
version
{
'1.0.0'
}
...
...
spec/graphql/types/package_type_enum_spec.rb
View file @
3d456450
...
@@ -4,6 +4,6 @@ require 'spec_helper'
...
@@ -4,6 +4,6 @@ require 'spec_helper'
RSpec
.
describe
GitlabSchema
.
types
[
'PackageTypeEnum'
]
do
RSpec
.
describe
GitlabSchema
.
types
[
'PackageTypeEnum'
]
do
it
'exposes all package types'
do
it
'exposes all package types'
do
expect
(
described_class
.
values
.
keys
).
to
contain_exactly
(
*
%w[MAVEN NPM CONAN NUGET PYPI COMPOSER GENERIC GOLANG]
)
expect
(
described_class
.
values
.
keys
).
to
contain_exactly
(
*
%w[MAVEN NPM CONAN NUGET PYPI COMPOSER GENERIC GOLANG
DEBIAN
]
)
end
end
end
end
spec/support/shared_examples/services/packages_shared_examples.rb
View file @
3d456450
...
@@ -171,6 +171,7 @@ RSpec.shared_examples 'filters on each package_type' do |is_project: false|
...
@@ -171,6 +171,7 @@ RSpec.shared_examples 'filters on each package_type' do |is_project: false|
let_it_be
(
:package6
)
{
create
(
:composer_package
,
project:
project
)
}
let_it_be
(
:package6
)
{
create
(
:composer_package
,
project:
project
)
}
let_it_be
(
:package7
)
{
create
(
:generic_package
,
project:
project
)
}
let_it_be
(
:package7
)
{
create
(
:generic_package
,
project:
project
)
}
let_it_be
(
:package8
)
{
create
(
:golang_package
,
project:
project
)
}
let_it_be
(
:package8
)
{
create
(
:golang_package
,
project:
project
)
}
let_it_be
(
:package9
)
{
create
(
:debian_package
,
project:
project
)
}
Packages
::
Package
.
package_types
.
keys
.
each
do
|
package_type
|
Packages
::
Package
.
package_types
.
keys
.
each
do
|
package_type
|
context
"for package type
#{
package_type
}
"
do
context
"for package type
#{
package_type
}
"
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