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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
5d14337b
Commit
5d14337b
authored
Oct 26, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Free up `labels` as a group name
parent
414c4e3f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
5 deletions
+28
-5
config/routes/group.rb
config/routes/group.rb
+10
-4
lib/gitlab/path_regex.rb
lib/gitlab/path_regex.rb
+0
-1
spec/routing/group_routing_spec.rb
spec/routing/group_routing_spec.rb
+18
-0
No files found.
config/routes/group.rb
View file @
5d14337b
...
...
@@ -34,10 +34,6 @@ constraints(GroupUrlConstrainer.new) do
end
end
resources
:labels
,
except:
[
:show
]
do
post
:toggle_subscription
,
on: :member
end
scope
path:
'-'
do
namespace
:settings
do
resource
:ci_cd
,
only:
[
:show
],
controller:
'ci_cd'
...
...
@@ -46,6 +42,10 @@ constraints(GroupUrlConstrainer.new) do
resources
:variables
,
only:
[
:index
,
:show
,
:update
,
:create
,
:destroy
]
resources
:children
,
only:
[
:index
]
resources
:labels
,
except:
[
:show
]
do
post
:toggle_subscription
,
on: :member
end
end
end
...
...
@@ -58,4 +58,10 @@ constraints(GroupUrlConstrainer.new) do
put
'/'
,
action: :update
delete
'/'
,
action: :destroy
end
# Legacy paths should be defined last, so they would be ignored if routes with
# one of the previously reserved words exist.
scope
(
path:
'groups/*group_id'
)
do
Gitlab
::
Routing
.
redirect_legacy_paths
(
self
,
:labels
)
end
end
lib/gitlab/path_regex.rb
View file @
5d14337b
...
...
@@ -120,7 +120,6 @@ module Gitlab
group_members
hooks
issues
labels
ldap
ldap_group_links
merge_requests
...
...
spec/routing/group_routing_spec.rb
0 → 100644
View file @
5d14337b
require
'spec_helper'
describe
'group routing'
do
let!
(
:existing_group
)
{
create
(
:group
,
parent:
create
(
:group
,
path:
'gitlab-org'
),
path:
'infra'
)
}
describe
'GET #labels'
do
it
'routes to the correct controller'
do
expect
(
get
(
'/groups/gitlab-org/infra/-/labels'
))
.
to
route_to
(
group_id:
'gitlab-org/infra'
,
controller:
'groups/labels'
,
action:
'index'
)
end
it_behaves_like
'redirecting a legacy path'
,
'/groups/gitlab-org/infra/labels'
,
'/groups/gitlab-org/infra/-/labels'
do
let
(
:resource
)
{
create
(
:group
,
parent:
existing_group
,
path:
'labels'
)
}
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