Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessio Caiazza <acaiazza@gitlab.com>2018-12-03 14:05:38 +0300
committerAlessio Caiazza <acaiazza@gitlab.com>2019-01-14 13:14:50 +0300
commit5e5419db3c141c468dd4eeb81181cad457f7d18c (patch)
tree52defd31e7c55dd3e3875018ca242c7276b51c4d
parent94d05e3c5ce59448d63ee96e3474b0cd3ef2c995 (diff)
Enable Gitlab-Pages for subgroups
GitLab Pages supports projects hosted under a subgroup, but not subgroup websites. That means that only the highest-level group supports i.e.: You created a group for your engineering department called `engineering`, a subgroup for all your documentation websites called `docs`,and a project within this subgroup is called `workflows`. Your project URL is `https://gitlab.com/engineering/docs/workflows/`. Once you enable GitLab Pages for this project, the site will live under `https://engineering.gitlab.io/docs/workflows`.
-rw-r--r--GITLAB_PAGES_VERSION2
-rw-r--r--app/models/project.rb2
-rw-r--r--changelogs/unreleased/ac-pages-subgroups.yml5
-rw-r--r--doc/user/group/subgroups/index.md8
-rw-r--r--doc/user/project/pages/getting_started_part_one.md9
-rw-r--r--doc/user/project/pages/introduction.md5
-rw-r--r--spec/controllers/projects/pages_controller_spec.rb4
-rw-r--r--spec/models/project_spec.rb2
8 files changed, 25 insertions, 12 deletions
diff --git a/GITLAB_PAGES_VERSION b/GITLAB_PAGES_VERSION
index 3a3cd8cc8b0..88c5fb891dc 100644
--- a/GITLAB_PAGES_VERSION
+++ b/GITLAB_PAGES_VERSION
@@ -1 +1 @@
-1.3.1
+1.4.0
diff --git a/app/models/project.rb b/app/models/project.rb
index 7ab2fc30c24..0c480d9ddd4 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1531,7 +1531,7 @@ class Project < ActiveRecord::Base
end
def pages_available?
- Gitlab.config.pages.enabled && !namespace.subgroup?
+ Gitlab.config.pages.enabled
end
def remove_private_deploy_keys
diff --git a/changelogs/unreleased/ac-pages-subgroups.yml b/changelogs/unreleased/ac-pages-subgroups.yml
new file mode 100644
index 00000000000..ef5a0c1872e
--- /dev/null
+++ b/changelogs/unreleased/ac-pages-subgroups.yml
@@ -0,0 +1,5 @@
+---
+title: Pages for subgroups
+merge_request: 23505
+author:
+type: added
diff --git a/doc/user/group/subgroups/index.md b/doc/user/group/subgroups/index.md
index 4d56b33f684..b6f8f55978b 100644
--- a/doc/user/group/subgroups/index.md
+++ b/doc/user/group/subgroups/index.md
@@ -164,9 +164,11 @@ and you can choose the group of people to be notified.
Here's a list of what you can't do with subgroups:
-- [GitLab Pages](../../project/pages/index.md) are not currently working for
- projects hosted under a subgroup. That means that only projects hosted under
- the first parent group will work.
+- [GitLab Pages](../../project/pages/index.md) supports projects hosted under
+ a subgroup, but not subgroup websites.
+ That means that only the highest-level group supports
+ [group websites](../../project/pages/introduction.html#user-or-group-pages),
+ although you can have project websites under a subgroup.
- It is not possible to share a project with a group that's an ancestor of
the group the project is in. That means you can only share as you walk down
the hierarchy. For example, `group/subgroup01/project` **cannot** be shared
diff --git a/doc/user/project/pages/getting_started_part_one.md b/doc/user/project/pages/getting_started_part_one.md
index 290dfa5af84..72af5338158 100644
--- a/doc/user/project/pages/getting_started_part_one.md
+++ b/doc/user/project/pages/getting_started_part_one.md
@@ -85,6 +85,12 @@ and a project within this group is called `blog`. Your project
URL is `https://gitlab.com/websites/blog/`. Once you enable
GitLab Pages for this project, the site will live under
`https://websites.gitlab.io/blog/`.
+- You created a group for your engineering department called `engineering`,
+a subgroup for all your documentation websites called `docs`,
+and a project within this subgroup is called `workflows`. Your project
+URL is `https://gitlab.com/engineering/docs/workflows/`. Once you enable
+GitLab Pages for this project, the site will live under
+`https://engineering.gitlab.io/docs/workflows`.
#### User and Group Websites
@@ -98,8 +104,7 @@ Once you enable GitLab Pages for your project,
your website will be published under `https://websites.gitlab.io`.
>**Note:**
-GitLab Pages [does **not** support subgroups](../../group/subgroups/index.md#limitations).
-You can only create the highest level group website.
+Support for subgroup project's websites was introduced in GitLab 11.8.
**General example:**
diff --git a/doc/user/project/pages/introduction.md b/doc/user/project/pages/introduction.md
index ed049e2e648..a7846b1ee18 100644
--- a/doc/user/project/pages/introduction.md
+++ b/doc/user/project/pages/introduction.md
@@ -38,6 +38,7 @@ be served on.
| Group pages | `groupname.example.io` | `http(s)://groupname.example.io` |
| Project pages owned by a user | `projectname` | `http(s)://username.example.io/projectname` |
| Project pages owned by a group | `projectname` | `http(s)://groupname.example.io/projectname`|
+| Project pages owned by a subgroup | `subgroup/projectname` | `http(s)://groupname.example.io/subgroup/projectname`|
> **Warning:**
> There are some known [limitations](#limitations) regarding namespaces served
@@ -494,8 +495,8 @@ don't redirect HTTP to HTTPS.
[rfc]: https://tools.ietf.org/html/rfc2818#section-3.1 "HTTP Over TLS RFC"
-GitLab Pages [does **not** support subgroups](../../group/subgroups/index.md#limitations).
-You can only create the highest level group website.
+GitLab Pages [does **not** support group websites for subgroups](../../group/subgroups/index.md#limitations).
+You can only create the highest-level group website.
## Redirects in GitLab Pages
diff --git a/spec/controllers/projects/pages_controller_spec.rb b/spec/controllers/projects/pages_controller_spec.rb
index 382c1b5d124..4b742a5d427 100644
--- a/spec/controllers/projects/pages_controller_spec.rb
+++ b/spec/controllers/projects/pages_controller_spec.rb
@@ -28,10 +28,10 @@ describe Projects::PagesController do
let(:group) { create(:group, :nested) }
let(:project) { create(:project, namespace: group) }
- it 'returns a 404 status code' do
+ it 'returns a 200 status code' do
get :show, params: request_params
- expect(response).to have_gitlab_http_status(404)
+ expect(response).to have_gitlab_http_status(200)
end
end
end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 397b4d7c61f..08eed9c06de 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -3087,7 +3087,7 @@ describe Project do
context 'when the project is in a subgroup' do
let(:group) { create(:group, :nested) }
- it { is_expected.to be(false) }
+ it { is_expected.to be(true) }
end
end