diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-30 15:10:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-30 15:10:51 +0300 |
commit | a10d237d37e78cbe84f72fffaeff74dc73f1e68f (patch) | |
tree | a3a820c7d67801605dcbb419d3f38513ee61044c /app/models | |
parent | afa3d4e0666ea2cddcf995fadac75c35a75c9b64 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/packages/package.rb | 6 | ||||
-rw-r--r-- | app/models/project.rb | 4 | ||||
-rw-r--r-- | app/models/service.rb | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/app/models/packages/package.rb b/app/models/packages/package.rb index 17b5a202922..08e9f06a6a1 100644 --- a/app/models/packages/package.rb +++ b/app/models/packages/package.rb @@ -5,6 +5,8 @@ class Packages::Package < ApplicationRecord include UsageStatistics include Gitlab::Utils::StrongMemoize + DISPLAYABLE_STATUSES = [:default, :error].freeze + belongs_to :project belongs_to :creator, class_name: 'User' @@ -70,7 +72,7 @@ class Packages::Package < ApplicationRecord composer: 6, generic: 7, golang: 8, debian: 9, rubygems: 10 } - enum status: { default: 0, hidden: 1, processing: 2 } + enum status: { default: 0, hidden: 1, processing: 2, error: 3 } scope :with_name, ->(name) { where(name: name) } scope :with_name_like, ->(name) { where(arel_table[:name].matches(name)) } @@ -80,7 +82,7 @@ class Packages::Package < ApplicationRecord scope :without_version_like, -> (version) { where.not(arel_table[:version].matches(version)) } scope :with_package_type, ->(package_type) { where(package_type: package_type) } scope :with_status, ->(status) { where(status: status) } - scope :displayable, -> { with_status(:default) } + scope :displayable, -> { with_status(DISPLAYABLE_STATUSES) } scope :including_build_info, -> { includes(pipelines: :user) } scope :including_project_route, -> { includes(project: { namespace: :route }) } scope :including_tags, -> { includes(:tags) } diff --git a/app/models/project.rb b/app/models/project.rb index b21d9818953..30741e117bf 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1370,9 +1370,9 @@ class Project < ApplicationRecord end def disabled_services - return %w(datadog) unless Feature.enabled?(:datadog_ci_integration, self) + return %w[datadog hipchat] unless Feature.enabled?(:datadog_ci_integration, self) - [] + %w[hipchat] end def find_or_initialize_service(name) diff --git a/app/models/service.rb b/app/models/service.rb index b0bad81d584..ff69327ab61 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -12,7 +12,7 @@ class Service < ApplicationRecord SERVICE_NAMES = %w[ asana assembla bamboo bugzilla buildkite campfire confluence custom_issue_tracker datadog discord - drone_ci emails_on_push ewm external_wiki flowdock hangouts_chat hipchat irker jira + drone_ci emails_on_push ewm external_wiki flowdock hangouts_chat irker jira mattermost mattermost_slash_commands microsoft_teams packagist pipelines_email pivotaltracker prometheus pushover redmine slack slack_slash_commands teamcity unify_circuit webex_teams youtrack ].freeze |