summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/pages_domain.rb8
-rw-r--r--app/models/release.rb9
2 files changed, 9 insertions, 8 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb
index dd2cafd9a35..330764ebc7f 100644
--- a/app/models/pages_domain.rb
+++ b/app/models/pages_domain.rb
@@ -6,7 +6,8 @@ class PagesDomain < ApplicationRecord
SSL_RENEWAL_THRESHOLD = 30.days.freeze
enum certificate_source: { user_provided: 0, gitlab_provided: 1 }, _prefix: :certificate
- enum domain_type: { instance: 0, group: 1, project: 2 }, _prefix: :domain_type
+ enum scope: { instance: 0, group: 1, project: 2 }, _prefix: :scope
+ enum usage: { pages: 0, serverless: 1 }, _prefix: :usage
belongs_to :project
has_many :acme_orders, class_name: "PagesDomainAcmeOrder"
@@ -26,8 +27,9 @@ class PagesDomain < ApplicationRecord
validate :validate_intermediates, if: ->(domain) { domain.certificate.present? && domain.certificate_changed? }
default_value_for(:auto_ssl_enabled, allow_nil: false) { ::Gitlab::LetsEncrypt.enabled? }
- default_value_for :domain_type, allow_nil: false, value: :project
+ default_value_for :scope, allow_nil: false, value: :project
default_value_for :wildcard, allow_nil: false, value: false
+ default_value_for :usage, allow_nil: false, value: :pages
attr_encrypted :key,
mode: :per_attribute_iv_and_salt,
@@ -220,7 +222,7 @@ class PagesDomain < ApplicationRecord
# rubocop: disable CodeReuse/ServiceClass
def update_daemon
- return if domain_type_instance?
+ return if usage_serverless?
::Projects::UpdatePagesConfigurationService.new(project).execute
end
diff --git a/app/models/release.rb b/app/models/release.rb
index ecfae554fe0..2543717895f 100644
--- a/app/models/release.rb
+++ b/app/models/release.rb
@@ -34,7 +34,6 @@ class Release < ApplicationRecord
delegate :repository, to: :project
- after_commit :create_evidence!, on: :create, unless: :importing?
after_commit :notify_new_release, on: :create, unless: :importing?
MAX_NUMBER_TO_DISPLAY = 3
@@ -70,6 +69,10 @@ class Release < ApplicationRecord
released_at.present? && released_at > Time.zone.now
end
+ def historical_release?
+ released_at.present? && released_at < created_at
+ end
+
def name
self.read_attribute(:name) || tag
end
@@ -98,10 +101,6 @@ class Release < ApplicationRecord
end
end
- def create_evidence!
- CreateEvidenceWorker.perform_async(self.id)
- end
-
def notify_new_release
NewReleaseWorker.perform_async(id)
end