diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /app/models/namespace.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) | |
download | gitlab-ce-05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2.tar.gz |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index d7d53956656..cf638f9b16c 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -11,17 +11,12 @@ class Namespace < ApplicationRecord include FeatureGate include FromUnion include Gitlab::Utils::StrongMemoize - include IgnorableColumns include Namespaces::Traversal::Recursive include Namespaces::Traversal::Linear include EachBatch include BlocksUnsafeSerialization include Ci::NamespaceSettings - # Temporary column used for back-filling project namespaces. - # Remove it once the back-filling of all project namespaces is done. - ignore_column :tmp_project_id, remove_with: '14.7', remove_after: '2022-01-22' - # Tells ActiveRecord not to store the full class name, in order to save some space # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69794 self.store_full_sti_class = false @@ -33,9 +28,11 @@ class Namespace < ApplicationRecord NUMBER_OF_ANCESTORS_ALLOWED = 20 SR_DISABLED_AND_UNOVERRIDABLE = 'disabled_and_unoverridable' + # DISABLED_WITH_OVERRIDE is deprecated in favour of DISABLED_AND_OVERRIDABLE. SR_DISABLED_WITH_OVERRIDE = 'disabled_with_override' + SR_DISABLED_AND_OVERRIDABLE = 'disabled_and_overridable' SR_ENABLED = 'enabled' - SHARED_RUNNERS_SETTINGS = [SR_DISABLED_AND_UNOVERRIDABLE, SR_DISABLED_WITH_OVERRIDE, SR_ENABLED].freeze + SHARED_RUNNERS_SETTINGS = [SR_DISABLED_AND_UNOVERRIDABLE, SR_DISABLED_WITH_OVERRIDE, SR_DISABLED_AND_OVERRIDABLE, SR_ENABLED].freeze URL_MAX_LENGTH = 255 PATH_TRAILING_VIOLATIONS = %w[.git .atom .].freeze @@ -87,6 +84,7 @@ class Namespace < ApplicationRecord has_many :timelog_categories, class_name: 'TimeTracking::TimelogCategory' has_many :achievements, class_name: 'Achievements::Achievement' + has_many :namespace_commit_emails, class_name: 'Users::NamespaceCommitEmail' validates :owner, presence: true, if: ->(n) { n.owner_required? } validates :name, @@ -134,6 +132,10 @@ class Namespace < ApplicationRecord to: :namespace_settings delegate :runner_registration_enabled, :runner_registration_enabled?, :runner_registration_enabled=, to: :namespace_settings + delegate :allow_runner_registration_token, + :allow_runner_registration_token?, + :allow_runner_registration_token=, + to: :namespace_settings delegate :maven_package_requests_forwarding, :pypi_package_requests_forwarding, :npm_package_requests_forwarding, @@ -556,7 +558,7 @@ class Namespace < ApplicationRecord if shared_runners_enabled SR_ENABLED elsif allow_descendants_override_disabled_shared_runners - SR_DISABLED_WITH_OVERRIDE + SR_DISABLED_AND_OVERRIDABLE else SR_DISABLED_AND_UNOVERRIDABLE end @@ -566,10 +568,10 @@ class Namespace < ApplicationRecord case other_setting when SR_ENABLED false - when SR_DISABLED_WITH_OVERRIDE + when SR_DISABLED_WITH_OVERRIDE, SR_DISABLED_AND_OVERRIDABLE shared_runners_setting == SR_ENABLED when SR_DISABLED_AND_UNOVERRIDABLE - shared_runners_setting == SR_ENABLED || shared_runners_setting == SR_DISABLED_WITH_OVERRIDE + shared_runners_setting == SR_ENABLED || shared_runners_setting == SR_DISABLED_AND_OVERRIDABLE || shared_runners_setting == SR_DISABLED_WITH_OVERRIDE else raise ArgumentError end |