BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d22fe96b
Commit
d22fe96b
authored
Jul 18, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Take ee words into account
We need to reserve these words in EE to support the upgrade path from CE to EE.
parent
bf114b31
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
15 deletions
+29
-15
bvl-free-unused-names.yml
changelogs/unreleased/bvl-free-unused-names.yml
+5
-0
path_regex_spec.rb
spec/lib/gitlab/path_regex_spec.rb
+24
-15
No files found.
changelogs/unreleased/bvl-free-unused-names.yml
0 → 100644
View file @
d22fe96b
---
title
:
Free up some top level words, reject top level groups named like files in the
public folder
merge_request
:
12932
author
:
spec/lib/gitlab/path_regex_spec.rb
View file @
d22fe96b
...
...
@@ -36,10 +36,12 @@ describe Gitlab::PathRegex, lib: true do
described_class
::
PROJECT_WILDCARD_ROUTES
.
include?
(
path
.
split
(
'/'
).
first
)
end
def
failure_message
(
constant_name
,
migration_helper
,
missing_words
:,
additional_words:
[])
def
failure_message
(
constant_name
,
migration_helper
,
missing_words:
[]
,
additional_words:
[])
missing_words
=
Array
(
missing_words
)
additional_words
=
Array
(
additional_words
)
message
=
<<-
MSG
message
=
""
if
missing_words
.
any?
message
+=
<<-
MISSING
Found new routes that could cause conflicts with existing namespaced routes
for groups or projects.
...
...
@@ -52,16 +54,15 @@ describe Gitlab::PathRegex, lib: true do
Make sure to make a note of the renamed records in the release blog post.
MSG
MISSING
end
if
additional_words
.
any?
additional_message
=
<<-
ADDITIONAL
message
+
=
<<-
ADDITIONAL
Why are <
#{
additional_words
.
join
(
', '
)
}
> in `
#{
constant_name
}
`?
If they are really required, update these specs to reflect that.
ADDITIONAL
message
=
[
message
,
additional_message
].
join
end
message
...
...
@@ -85,14 +86,11 @@ describe Gitlab::PathRegex, lib: true do
route
.
split
(
'/'
)[
1
]
end
.
compact
.
uniq
words
+=
files_in_public
words
+
additional_top_level_words
words
+
ee_top_level_words
+
files_in_public
end
let
(
:additional_top_level_words
)
do
# Required to keep the uploads safe, remove after
# https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12917 gets merged
[
'system'
]
let
(
:ee_top_level_words
)
do
[
'unsubscribes'
]
end
let
(
:files_in_public
)
do
...
...
@@ -145,7 +143,16 @@ describe Gitlab::PathRegex, lib: true do
let
(
:paths_after_group_id
)
do
group_routes
.
map
do
|
route
|
route
.
gsub
(
STARTING_WITH_GROUP
,
''
).
split
(
'/'
).
first
end
.
uniq
end
.
uniq
+
ee_paths_after_group_id
end
let
(
:ee_paths_after_group_id
)
do
%w(analytics
ldap
ldap_group_links
notification_setting
audit_events
pipeline_quota hooks)
end
describe
'TOP_LEVEL_ROUTES'
do
...
...
@@ -166,11 +173,13 @@ describe Gitlab::PathRegex, lib: true do
it
"don't contain a second wildcard"
do
failure_block
=
lambda
do
missing_words
=
paths_after_group_id
-
described_class
::
GROUP_ROUTES
failure_message
(
'GROUP_ROUTES'
,
'rename_child_paths'
,
missing_words:
missing_words
)
additional_words
=
described_class
::
GROUP_ROUTES
-
paths_after_group_id
failure_message
(
'GROUP_ROUTES'
,
'rename_child_paths'
,
missing_words:
missing_words
,
additional_words:
additional_words
)
end
expect
(
described_class
::
GROUP_ROUTES
)
.
to
include
(
*
paths_after_group_id
),
failure_block
.
to
contain_exactly
(
*
paths_after_group_id
),
failure_block
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