Commit 3d456450 authored by ggelatti's avatar ggelatti

Adds debian package type

- adds debian pkg type
- adds specs for type
- Update graphql docs
parent 24b3ceda
...@@ -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
...@@ -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
......
...@@ -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)) }
......
...@@ -12288,42 +12288,47 @@ type PackageFileRegistryEdge { ...@@ -12288,42 +12288,47 @@ type PackageFileRegistryEdge {
enum PackageTypeEnum { enum PackageTypeEnum {
""" """
Packages from the composer package manager Packages from the Composer package manager
""" """
COMPOSER COMPOSER
""" """
Packages from the conan package manager Packages from the Conan 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 golang package manager Packages from the Golang package manager
""" """
GOLANG GOLANG
""" """
Packages from the maven package manager Packages from the Maven package manager
""" """
MAVEN MAVEN
""" """
Packages from the npm package manager Packages from the Npm package manager
""" """
NPM NPM
""" """
Packages from the nuget package manager Packages from the Nuget package manager
""" """
NUGET NUGET
""" """
Packages from the pypi package manager Packages from the Pypi package manager
""" """
PYPI PYPI
} }
......
...@@ -36389,49 +36389,55 @@ ...@@ -36389,49 +36389,55 @@
"enumValues": [ "enumValues": [
{ {
"name": "MAVEN", "name": "MAVEN",
"description": "Packages from the maven package manager", "description": "Packages from the Maven package manager",
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{ {
"name": "NPM", "name": "NPM",
"description": "Packages from the npm package manager", "description": "Packages from the Npm package manager",
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{ {
"name": "CONAN", "name": "CONAN",
"description": "Packages from the conan package manager", "description": "Packages from the Conan package manager",
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{ {
"name": "NUGET", "name": "NUGET",
"description": "Packages from the nuget package manager", "description": "Packages from the Nuget package manager",
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{ {
"name": "PYPI", "name": "PYPI",
"description": "Packages from the pypi package manager", "description": "Packages from the Pypi package manager",
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{ {
"name": "COMPOSER", "name": "COMPOSER",
"description": "Packages from the composer package manager", "description": "Packages from the Composer package manager",
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{ {
"name": "GENERIC", "name": "GENERIC",
"description": "Packages from the generic package manager", "description": "Packages from the Generic 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
} }
...@@ -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
......
...@@ -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' }
......
...@@ -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
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment