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
928c135b
Commit
928c135b
authored
Nov 13, 2020
by
fjsanpedro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include only Gitlab-org owned groups in sitemap
parent
4a6bbc73
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
ee/changelogs/unreleased/fj-include-only-owned-groups-in-sitemap.yml
...gs/unreleased/fj-include-only-owned-groups-in-sitemap.yml
+5
-0
ee/lib/gitlab/sitemaps/generator.rb
ee/lib/gitlab/sitemaps/generator.rb
+1
-1
ee/spec/lib/gitlab/sitemaps/generator_spec.rb
ee/spec/lib/gitlab/sitemaps/generator_spec.rb
+4
-0
No files found.
ee/changelogs/unreleased/fj-include-only-owned-groups-in-sitemap.yml
0 → 100644
View file @
928c135b
---
title
:
Include only Gitlab-org owned groups in sitemap
merge_request
:
47608
author
:
type
:
changed
ee/lib/gitlab/sitemaps/generator.rb
View file @
928c135b
...
...
@@ -56,7 +56,7 @@ module Gitlab
current_user:
nil
,
group:
gitlab_org_group
,
params:
{
non_archived:
true
},
options:
{
include_subgroups:
true
}
options:
{
include_subgroups:
true
,
only_owned:
true
}
).
execute
.
include_project_feature
.
inc_routes
end
end
...
...
ee/spec/lib/gitlab/sitemaps/generator_spec.rb
View file @
928c135b
...
...
@@ -40,8 +40,11 @@ RSpec.describe Gitlab::Sitemaps::Generator do
let_it_be
(
:public_subgroup_internal_project
)
{
create
(
:project
,
:internal
,
namespace:
public_subgroup
)
}
let_it_be
(
:internal_subgroup_private_project
)
{
create
(
:project
,
:private
,
namespace:
internal_subgroup
)
}
let_it_be
(
:internal_subgroup_internal_project
)
{
create
(
:project
,
:internal
,
namespace:
internal_subgroup
)
}
let_it_be
(
:other_project
)
{
create
(
:project
,
:public
)
}
it
'includes default explore routes and gitlab-org group routes'
do
create
(
:project_group_link
,
project:
other_project
,
group:
gitlab_org_group
)
content
=
subject
.
render
expect
(
content
).
to
include
(
'/explore/projects'
)
...
...
@@ -55,6 +58,7 @@ RSpec.describe Gitlab::Sitemaps::Generator do
expect
(
content
).
not_to
include
(
internal_gitlab_org_project
.
full_path
)
expect
(
content
).
not_to
include
(
private_gitlab_org_project
.
full_path
)
expect
(
content
).
not_to
include
(
internal_subgroup
.
full_path
)
expect
(
content
).
not_to
include
(
other_project
.
full_path
)
expect
(
content
).
not_to
include
(
public_subgroup_internal_project
.
full_path
)
expect
(
content
).
not_to
include
(
internal_subgroup_private_project
.
full_path
)
expect
(
content
).
not_to
include
(
internal_subgroup_internal_project
.
full_path
)
...
...
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