Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9aa12e3b
Commit
9aa12e3b
authored
Mar 14, 2022
by
Abdul Wadood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove restrict_special_characters_in_project_path feature flag
Changelog: other
parent
011f0a42
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
49 deletions
+4
-49
app/models/project.rb
app/models/project.rb
+4
-9
config/feature_flags/development/restrict_special_characters_in_project_path.yml
...velopment/restrict_special_characters_in_project_path.yml
+0
-8
spec/models/project_spec.rb
spec/models/project_spec.rb
+0
-32
No files found.
app/models/project.rb
View file @
9aa12e3b
...
@@ -497,7 +497,10 @@ class Project < ApplicationRecord
...
@@ -497,7 +497,10 @@ class Project < ApplicationRecord
presence:
true
,
presence:
true
,
project_path:
true
,
project_path:
true
,
length:
{
maximum:
255
}
length:
{
maximum:
255
}
validate
:container_registry_project_path_validation
validates
:path
,
format:
{
with:
Gitlab
::
Regex
.
oci_repository_path_regex
,
message:
Gitlab
::
Regex
.
oci_repository_path_regex_message
},
if: :path_changed?
validates
:project_feature
,
presence:
true
validates
:project_feature
,
presence:
true
...
@@ -888,14 +891,6 @@ class Project < ApplicationRecord
...
@@ -888,14 +891,6 @@ class Project < ApplicationRecord
super
super
end
end
def
container_registry_project_path_validation
if
Feature
.
enabled?
(
:restrict_special_characters_in_project_path
,
self
,
default_enabled: :yaml
)
&&
path_changed?
&&
!
path
.
match?
(
Gitlab
::
Regex
.
oci_repository_path_regex
)
errors
.
add
(
:path
,
Gitlab
::
Regex
.
oci_repository_path_regex_message
)
end
end
def
parent_loaded?
def
parent_loaded?
association
(
:namespace
).
loaded?
association
(
:namespace
).
loaded?
end
end
...
...
config/feature_flags/development/restrict_special_characters_in_project_path.yml
deleted
100644 → 0
View file @
011f0a42
---
name
:
restrict_special_characters_in_project_path
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80055
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/353054
milestone
:
'
14.8'
type
:
development
group
:
group::workspace
default_enabled
:
false
spec/models/project_spec.rb
View file @
9aa12e3b
...
@@ -630,38 +630,6 @@ RSpec.describe Project, factory_default: :keep do
...
@@ -630,38 +630,6 @@ RSpec.describe Project, factory_default: :keep do
expect
(
project
).
not_to
be_valid
expect
(
project
).
not_to
be_valid
end
end
context
'restrict_special_characters_in_project_path feature flag is disabled'
do
before
do
stub_feature_flags
(
restrict_special_characters_in_project_path:
false
)
end
it
"allows a path ending in '
#{
special_character
}
'"
do
project
=
build
(
:project
,
path:
"foo
#{
special_character
}
"
)
expect
(
project
).
to
be_valid
end
end
end
context
'restrict_special_characters_in_project_path feature flag is disabled'
do
before
do
stub_feature_flags
(
restrict_special_characters_in_project_path:
false
)
end
%w[. _]
.
each
do
|
special_character
|
it
"allows a path starting with '
#{
special_character
}
'"
do
project
=
build
(
:project
,
path:
"
#{
special_character
}
foo"
)
expect
(
project
).
to
be_valid
end
end
it
"rejects a path starting with '-'"
do
project
=
build
(
:project
,
path:
"-foo"
)
expect
(
project
).
not_to
be_valid
end
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment