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
90e84858
Commit
90e84858
authored
Feb 14, 2022
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable prohibition of hex branch names
Changelog: added
parent
f536b8cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
18 deletions
+0
-18
config/feature_flags/development/prohibit_hexadecimal_branch_names.yml
...e_flags/development/prohibit_hexadecimal_branch_names.yml
+0
-8
lib/gitlab/checks/branch_check.rb
lib/gitlab/checks/branch_check.rb
+0
-1
spec/lib/gitlab/checks/branch_check_spec.rb
spec/lib/gitlab/checks/branch_check_spec.rb
+0
-9
No files found.
config/feature_flags/development/prohibit_hexadecimal_branch_names.yml
deleted
100644 → 0
View file @
f536b8cd
---
name
:
prohibit_hexadecimal_branch_names
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/commit/28439ca4b1dd14f22a5a6ad14530f6bf1046f8bc
rollout_issue_url
:
milestone
:
'
12.10'
type
:
development
group
:
group::source code
default_enabled
:
true
lib/gitlab/checks/branch_check.rb
View file @
90e84858
...
...
@@ -41,7 +41,6 @@ module Gitlab
def
prohibited_branch_checks
return
if
deletion?
return
unless
Feature
.
enabled?
(
:prohibit_hexadecimal_branch_names
,
project
,
default_enabled:
true
)
if
branch_name
=~
/\A\h{40}\z/
raise
GitAccess
::
ForbiddenError
,
ERROR_MESSAGES
[
:prohibited_hex_branch_name
]
...
...
spec/lib/gitlab/checks/branch_check_spec.rb
View file @
90e84858
...
...
@@ -40,15 +40,6 @@ RSpec.describe Gitlab::Checks::BranchCheck do
expect
{
subject
.
validate!
}.
not_to
raise_error
end
end
context
"the feature flag is disabled"
do
it
"doesn't prohibit a 40-character hexadecimal branch name"
do
stub_feature_flags
(
prohibit_hexadecimal_branch_names:
false
)
allow
(
subject
).
to
receive
(
:branch_name
).
and_return
(
"267208abfe40e546f5e847444276f7d43a39503e"
)
expect
{
subject
.
validate!
}.
not_to
raise_error
end
end
end
context
'protected branches check'
do
...
...
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