Commit 2cd0a687 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '322101-feature-flag-rollout-of-validate_namespace_parent_type' into 'master'

Remove feature flag `validate_namespace_parent_type`

See merge request gitlab-org/gitlab!75088
parents 876e9ff6 55796372
......@@ -94,7 +94,7 @@ class Namespace < ApplicationRecord
validates :max_artifacts_size, numericality: { only_integer: true, greater_than: 0, allow_nil: true }
validate :validate_parent_type, if: -> { Feature.enabled?(:validate_namespace_parent_type, default_enabled: :yaml) }
validate :validate_parent_type
# ProjectNamespaces excluded as they are not meant to appear in the group hierarchy at the moment.
validate :nesting_level_allowed, unless: -> { project_namespace? }
......
---
name: validate_namespace_parent_type
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54094
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/322101
milestone: '13.10'
type: development
group: group::access
default_enabled: true
......@@ -805,13 +805,5 @@ the following checks when creating or updating namespaces or groups:
- Namespaces must not have parents.
- Group parents must be groups and not namespaces.
You can disable the validation if GitLab shows the following errors:
- `A user namespace cannot have a parent`.
- `A group cannot have a user namespace as its parent`.
To disable the validation,
[disable the `validate_namespace_parent_type` flag](../../administration/feature_flags.md).
In the unlikely event that you had to disable this feature flag to prevent errors,
In the unlikely event that you see these errors in your GitLab installation,
[contact Support](https://about.gitlab.com/support/) so that we can improve this validation.
......@@ -94,34 +94,6 @@ RSpec.describe Group do
expect(group).to be_valid
end
end
context 'when the feature flag `validate_namespace_parent_type` is disabled' do
before do
stub_feature_flags(validate_namespace_parent_type: false)
end
context 'when the group has no parent' do
it 'allows a group to have no parent associated with it' do
group = build(:group)
expect(group).to be_valid
end
end
context 'when the group has a parent' do
it 'allows a group to have a namespace as its parent' do
group = build(:group, parent: build(:namespace))
expect(group).to be_valid
end
it 'allows a group to have another group as its parent' do
group = build(:group, parent: build(:group))
expect(group).to be_valid
end
end
end
end
describe 'path validation' do
......
......@@ -107,34 +107,6 @@ RSpec.describe Namespace do
end
end
end
context 'when the feature flag `validate_namespace_parent_type` is disabled' do
before do
stub_feature_flags(validate_namespace_parent_type: false)
end
context 'when the namespace has no parent' do
it 'allows a namespace to have no parent associated with it' do
namespace = build(:namespace)
expect(namespace).to be_valid
end
end
context 'when the namespace has a parent' do
it 'allows a namespace to have a group as its parent' do
namespace = build(:namespace, parent: build(:group))
expect(namespace).to be_valid
end
it 'allows a namespace to have another namespace as its parent' do
namespace = build(:namespace, parent: build(:namespace))
expect(namespace).to be_valid
end
end
end
end
describe '#nesting_level_allowed' 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