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 @@
module Types
class PackageTypeEnum < BaseEnum
::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
......@@ -4,7 +4,7 @@ class Packages::Event < ApplicationRecord
belongs_to :package, optional: true
# 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
......
......@@ -47,7 +47,7 @@ class Packages::Package < ApplicationRecord
format: { with: Gitlab::Regex.generic_package_version_regex },
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_like, ->(name) { where(arel_table[:name].matches(name)) }
......
......@@ -12288,42 +12288,47 @@ type PackageFileRegistryEdge {
enum PackageTypeEnum {
"""
Packages from the composer package manager
Packages from the Composer package manager
"""
COMPOSER
"""
Packages from the conan package manager
Packages from the Conan package manager
"""
CONAN
"""
Packages from the generic package manager
Packages from the Debian package manager
"""
DEBIAN
"""
Packages from the Generic package manager
"""
GENERIC
"""
Packages from the golang package manager
Packages from the Golang package manager
"""
GOLANG
"""
Packages from the maven package manager
Packages from the Maven package manager
"""
MAVEN
"""
Packages from the npm package manager
Packages from the Npm package manager
"""
NPM
"""
Packages from the nuget package manager
Packages from the Nuget package manager
"""
NUGET
"""
Packages from the pypi package manager
Packages from the Pypi package manager
"""
PYPI
}
......
......@@ -36389,49 +36389,55 @@
"enumValues": [
{
"name": "MAVEN",
"description": "Packages from the maven package manager",
"description": "Packages from the Maven package manager",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "NPM",
"description": "Packages from the npm package manager",
"description": "Packages from the Npm package manager",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "CONAN",
"description": "Packages from the conan package manager",
"description": "Packages from the Conan package manager",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "NUGET",
"description": "Packages from the nuget package manager",
"description": "Packages from the Nuget package manager",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "PYPI",
"description": "Packages from the pypi package manager",
"description": "Packages from the Pypi package manager",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "COMPOSER",
"description": "Packages from the composer package manager",
"description": "Packages from the Composer package manager",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "GENERIC",
"description": "Packages from the generic package manager",
"description": "Packages from the Generic package manager",
"isDeprecated": false,
"deprecationReason": null
},
{
"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,
"deprecationReason": null
}
......@@ -3431,14 +3431,15 @@ Values for sorting projects.
| Value | Description |
| ----- | ----------- |
| `COMPOSER` | Packages from the composer package manager |
| `CONAN` | Packages from the conan package manager |
| `GENERIC` | Packages from the generic package manager |
| `GOLANG` | Packages from the golang package manager |
| `MAVEN` | Packages from the maven package manager |
| `NPM` | Packages from the npm package manager |
| `NUGET` | Packages from the nuget package manager |
| `PYPI` | Packages from the pypi package manager |
| `COMPOSER` | Packages from the Composer package manager |
| `CONAN` | Packages from the Conan package manager |
| `DEBIAN` | Packages from the Debian package manager |
| `GENERIC` | Packages from the Generic package manager |
| `GOLANG` | Packages from the Golang package manager |
| `MAVEN` | Packages from the Maven package manager |
| `NPM` | Packages from the Npm package manager |
| `NUGET` | Packages from the Nuget package manager |
| `PYPI` | Packages from the Pypi package manager |
### PipelineConfigSourceEnum
......
......@@ -21,6 +21,10 @@ FactoryBot.define do
end
end
factory :debian_package do
package_type { :debian }
end
factory :npm_package do
sequence(:name) { |n| "@#{project.root_namespace.path}/package-#{n}"}
version { '1.0.0' }
......
......@@ -4,6 +4,6 @@ require 'spec_helper'
RSpec.describe GitlabSchema.types['PackageTypeEnum'] 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
......@@ -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(:package7) { create(:generic_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|
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