Commit b6824473 authored by Stan Hu's avatar Stan Hu

Merge branch 'master' into ce-to-ee-2018-09-28

parents e54b3c2b 95082a21
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
.settings-content .settings-content
= render partial: 'repository_mirrors_form' = render partial: 'repository_mirrors_form'
%section.settings.as-repository-storage.no-animate#js-repository-storage-settings{ class: ('expanded' if expanded_by_default?) } %section.qa-repository-storage.settings.as-repository-storage.no-animate#js-repository-storage-settings{ class: ('expanded' if expanded_by_default?) }
.settings-header .settings-header
%h4 %h4
= _('Repository storage') = _('Repository storage')
......
...@@ -4,71 +4,180 @@ description: 'Learn how to use GitLab Pages to deploy a static website at no add ...@@ -4,71 +4,180 @@ description: 'Learn how to use GitLab Pages to deploy a static website at no add
# GitLab Pages # GitLab Pages
With GitLab Pages it's easy to publish your project website. GitLab Pages is a hosting service for static websites, at no additional cost. **GitLab Pages is a feature that allows you to publish static websites
directly from a repository in GitLab.**
## Getting Started
You can use it either for personal or business websites, such as
[Create a project from scratch](getting_started_part_two.md#create-a-project-from-scratch) portfolios, documentation, manifestos, and business presentations,
to get you started quickly, or, and attribute any license to your content.
alternatively, start from an existing project as follows:
<table class="borderless-table center fixed-table">
1. [Fork](../../../gitlab-basics/fork-project.md#how-to-fork-a-project) an [example project](https://gitlab.com/pages): <tr>
<td style="width: 22%"><img src="img/icons/cogs.png" alt="SSGs" class="image-noshadow half-width"></td>
<td style="width: 4%">
<strong>
<i class="fa fa-angle-double-right" aria-hidden="true"></i>
</strong>
</td>
<td style="width: 22%"><img src="img/icons/monitor.png" alt="Websites" class="image-noshadow half-width"></td>
<td style="width: 4%">
<strong>
<i class="fa fa-angle-double-right" aria-hidden="true"></i>
</strong>
</td>
<td style="width: 22%"><img src="img/icons/free.png" alt="Pages is free" class="image-noshadow half-width"></td>
<td style="width: 4%">
<strong>
<i class="fa fa-angle-double-right" aria-hidden="true"></i>
</strong>
</td>
<td style="width: 22%"><img src="img/icons/lock.png" alt="Secure your website" class="image-noshadow half-width"></td>
</tr>
<tr>
<td><em>Use any static website generator or plain HTML</em></td>
<td></td>
<td><em>Create websites for your projects, groups, or user account</em></td>
<td></td>
<td><em>Host on GitLab.com for free, or on your own GitLab instance</em></td>
<td></td>
<td><em>Connect your custom domain(s) and TLS certificates</em></td>
</tr>
</table>
Pages is available for free for all GitLab.com users as well as for self-managed
instances (GitLab Core, Starter, Premium, and Ultimate).
## Overview
<div class="row">
<div class="col-md-9">
<p style="margin-top: 18px;">
To publish a website with Pages, you can use any Static Site Generator (SSG),
such as Jekyll, Hugo, Middleman, Harp, Hexo, and Brunch, just to name a few. You can also
publish any website written directly in plain HTML, CSS, and JavaScript.</p>
<p>Pages does <strong>not</strong> support dynamic server-side processing, for instance, as <code>.php</code> and <code>.asp</code> requires. See this article to learn more about
<a href="https://about.gitlab.com/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/">static websites vs dynamic websites</a>.</p>
</div>
<div class="col-md-3"><img src="img/ssgs_pages.png" alt="Examples of SSGs supported by Pages" class="image-noshadow middle display-block"></div>
</div>
### Availability
If you're using GitLab.com, your website will be publicly available to the internet.
If you're using self-managed instances (Core, Starter, Premium, or Ultimate),
your websites will be published on your own server, according to the
[Pages admin settings](../../../administration/pages/index.md) chosen by your sysdamin,
who can opt for making them public or internal to your server.
### How it works
To use GitLab Pages, first you need to create a project in GitLab to upload your website's
files to. These projects can be either public, internal, or private, at your own choice.
GitLab will always deploy your website from a very specific folder called `public` in your
repository. Note that when you create a new project in GitLab, a [repository](../repository/index.md)
becomes available automatically.
To deploy your site, GitLab will use its built-in tool called [GitLab CI/CD](../../../ci/README.md),
that will build your site and publish it to the GitLab Pages server. The sequence of
scripts that GitLab CI/CD runs to accomplish this task is created from a file named
`.gitlab-ci.yml`, which you can [create and modify](getting_started_part_four.md) at will.
You can either use GitLab's [default domain for GitLab Pages websites](getting_started_part_one.md#gitlab-pages-domain),
`*.gitlab.io`, or your own domain (`example.com`). In that case, you'll
need admin access to your domain's registrar (or control panel) to set it up with Pages.
Optionally, when adding your own domain, you can add an SSL/TLS certificate to secure your
site under the HTTPS protocol.
## Getting started
To get started with GitLab Pages, you can either [create a project from scratch](getting_started_part_two.md#create-a-project-from-scratch)
or quickly start from copying an existing example project, as follows:
1. Choose an [example project](https://gitlab.com/pages) to [fork](../../../gitlab-basics/fork-project.md#how-to-fork-a-project):
by forking a project, you create a copy of the codebase you're forking from to start from a template instead of starting from scratch. by forking a project, you create a copy of the codebase you're forking from to start from a template instead of starting from scratch.
2. Change a file to trigger a GitLab CI/CD pipeline: GitLab CI/CD will build and deploy your site to GitLab Pages. 1. From the left sidebar, navigate to your project's **CI/CD > Pipelines** and click
3. Visit your project's **Settings > Pages** to see your **website link**, and click on it. Bam! Your website is live! :) **Run pipeline** so that GitLab CI/CD will build and deploy your site to the server.
1. Once the pipeline has finished successfully, find the link to visit your website from your
_Further steps (optional):_ project's **Settings > Pages**.
4. Remove the [fork relationship](getting_started_part_two.md#fork-a-project-to-get-started-from) <table class="borderless-table center fixed-table middle width-80">
<tr>
<td style="width: 30%"><img src="img/icons/fork.png" alt="Fork" class="image-noshadow half-width"></td>
<td style="width: 10%">
<strong>
<i class="fa fa-angle-double-right" aria-hidden="true"></i>
</strong>
</td>
<td style="width: 30%"><img src="img/icons/terminal.png" alt="Deploy" class="image-noshadow half-width"></td>
<td style="width: 10%">
<strong>
<i class="fa fa-angle-double-right" aria-hidden="true"></i>
</strong>
</td>
<td style="width: 30%"><img src="img/icons/click.png" alt="Visit" class="image-noshadow half-width"></td>
</tr>
<tr>
<td><em>Fork an example project</em></td>
<td></td>
<td><em>Deploy your website</em></td>
<td></td>
<td><em>Visit your website's URL</em></td>
</tr>
</table>
Your website is then visible on your domain, and you can modify your files
as you wish. For every modification pushed to your repository, GitLab CI/CD will run
a new pipeline to publish your changes to the server.
You can also take some optional further steps:
- Remove the [fork relationship](getting_started_part_two.md#fork-a-project-to-get-started-from)
(_You don't need the relationship unless you intent to contribute back to the example project you forked from_). (_You don't need the relationship unless you intent to contribute back to the example project you forked from_).
5. Make it a [user/group website](getting_started_part_one.md#user-and-group-websites) - Make it a [user/group website](getting_started_part_one.md#user-and-group-websites)
**Watch a video with the steps above: https://www.youtube.com/watch?v=TWqh9MtT4Bg** **<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> Watch a [video tutorial](https://www.youtube.com/watch?v=TWqh9MtT4Bg) with all the steps above!**
_Advanced options:_ _Advanced options:_
- [Use a custom domain](getting_started_part_three.md#adding-your-custom-domain-to-gitlab-pages) - [Use a custom domain](getting_started_part_three.md#adding-your-custom-domain-to-gitlab-pages)
- Apply [SSL/TLS certification](getting_started_part_three.md#ssl-tls-certificates) to your custom domain - Apply [SSL/TLS certification](getting_started_part_three.md#ssl-tls-certificates) to your custom domain
## How Does It Work?
With GitLab Pages you can create [static websites](getting_started_part_one.md#what-you-need-to-know-before-getting-started)
for your GitLab projects, groups, or user accounts.
It supports plain static content, such as HTML, and **all** [static site generators (SSGs)](https://about.gitlab.com/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/), such as Jekyll, Middleman, Hexo, Hugo, and Pelican.
Connect as many custom domains as you like and bring your own TLS certificate
to secure them.
Your files live in a project [repository](../repository/index.md) on GitLab.
[GitLab CI](../../../ci/README.md) picks up those files and makes them available at, typically,
`https://<username>.gitlab.io/<projectname>`. Please read through the docs on
[GitLab Pages domains](getting_started_part_one.md#gitlab-pages-domain) for more info.
## Explore GitLab Pages ## Explore GitLab Pages
Read the following tutorials to know more about: To learn more about GitLab Pages, read the following tutorials:
- [Static websites and GitLab Pages domains](getting_started_part_one.md): Understand what is a static website, and how GitLab Pages default domains work - [Static websites and GitLab Pages domains](getting_started_part_one.md): Understand what is a static website, and how GitLab Pages default domains work
- [Projects for GitLab Pages and URL structure](getting_started_part_two.md): Forking projects and creating new ones from scratch, understanding URLs structure and baseurls - [Projects for GitLab Pages and URL structure](getting_started_part_two.md): Forking projects and creating new ones from scratch, understanding URLs structure and baseurls
- [GitLab Pages custom domains and SSL/TLS Certificates](getting_started_part_three.md): How to add custom domains and subdomains to your website, configure DNS records, and SSL/TLS certificates - [GitLab Pages custom domains and SSL/TLS Certificates](getting_started_part_three.md): How to add custom domains and subdomains to your website, configure DNS records and SSL/TLS certificates
- [Creating and Tweaking GitLab CI/CD for GitLab Pages](getting_started_part_four.md): Understand how to create your own `.gitlab-ci.yml` for your site - [Creating and Tweaking GitLab CI/CD for GitLab Pages](getting_started_part_four.md): Understand how to create your own `.gitlab-ci.yml` for your site
- [Technical aspects, custom 404 pages, limitations](introduction.md) - [Technical aspects, custom 404 pages, limitations](introduction.md)
- [Hosting on GitLab.com with GitLab Pages](https://about.gitlab.com/2016/04/07/gitlab-pages-setup/) (outdated)
_Blog posts series about Static Site Generators (SSGs):_ ### GitLab Pages with Static Site Generators (SSGs)
To understand more about SSGs, their advantages, and how to get the most from them
with Pages, read through this series:
- [SSGs part 1: Static vs dynamic websites](https://about.gitlab.com/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/) - [SSGs part 1: Static vs dynamic websites](https://about.gitlab.com/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/)
- [SSGs part 2: Modern static site generators](https://about.gitlab.com/2016/06/10/ssg-overview-gitlab-pages-part-2/) - [SSGs part 2: Modern static site generators](https://about.gitlab.com/2016/06/10/ssg-overview-gitlab-pages-part-2/)
- [SSGs part 3: Build any SSG site with GitLab Pages](https://about.gitlab.com/2016/06/17/ssg-overview-gitlab-pages-part-3-examples-ci/) - [SSGs part 3: Build any SSG site with GitLab Pages](https://about.gitlab.com/2016/06/17/ssg-overview-gitlab-pages-part-3-examples-ci/)
_Blog posts for securing GitLab Pages custom domains with SSL/TLS certificates:_ ### GitLab Pages with SSL/TLS certificates
If you're using GitLab Pages default domain (`.gitlab.io`), your website will be
automatically secure and available under HTTPS. If you're using your own domain, you can
optionally secure it with with SSL/TLS certificates. You can read the following
tutorials to learn how to use these third-party certificates with GitLab Pages:
- [CloudFlare](https://about.gitlab.com/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/) - [CloudFlare](https://about.gitlab.com/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/)
- [Let's Encrypt](https://about.gitlab.com/2016/04/11/tutorial-securing-your-gitlab-pages-with-tls-and-letsencrypt/) (outdated) - [Let's Encrypt](https://about.gitlab.com/2016/04/11/tutorial-securing-your-gitlab-pages-with-tls-and-letsencrypt/) (mind that although this article is out-of-date, it can still be useful to guide you through the basic steps)
## Advanced use ## Advanced use
There are quite some great examples of GitLab Pages websites built for some
specific reasons. These examples can teach you some advanced techniques
to use and adapt to your own needs:
- [Posting to your GitLab Pages blog from iOS](https://about.gitlab.com/2016/08/19/posting-to-your-gitlab-pages-blog-from-ios/) - [Posting to your GitLab Pages blog from iOS](https://about.gitlab.com/2016/08/19/posting-to-your-gitlab-pages-blog-from-ios/)
- [GitLab CI: Run jobs sequentially, in parallel, or build a custom pipeline](https://about.gitlab.com/2016/07/29/the-basics-of-gitlab-ci/) - [GitLab CI: Run jobs sequentially, in parallel, or build a custom pipeline](https://about.gitlab.com/2016/07/29/the-basics-of-gitlab-ci/)
- [GitLab CI: Deployment & environments](https://about.gitlab.com/2016/08/26/ci-deployment-and-environments/) - [GitLab CI: Deployment & environments](https://about.gitlab.com/2016/08/26/ci-deployment-and-environments/)
...@@ -80,10 +189,9 @@ _Blog posts for securing GitLab Pages custom domains with SSL/TLS certificates:_ ...@@ -80,10 +189,9 @@ _Blog posts for securing GitLab Pages custom domains with SSL/TLS certificates:_
Enable and configure GitLab Pages on your own instance (GitLab Community Edition and Enterprise Editions) with Enable and configure GitLab Pages on your own instance (GitLab Community Edition and Enterprise Editions) with
the [admin guide](../../../administration/pages/index.md). the [admin guide](../../../administration/pages/index.md).
**Watch the video: https://www.youtube.com/watch?v=dD8c7WNcc6s** **<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> Watch a [video tutorial](https://www.youtube.com/watch?v=dD8c7WNcc6s) for getting started with GitLab Pages admin!**
## More information about GitLab Pages ## More information about GitLab Pages
- For an overview, visit the [feature webpage](https://about.gitlab.com/features/pages/)
- Announcement (2016-12-24): ["We're bringing GitLab Pages to CE"](https://about.gitlab.com/2016/12/24/were-bringing-gitlab-pages-to-community-edition/) - Announcement (2016-12-24): ["We're bringing GitLab Pages to CE"](https://about.gitlab.com/2016/12/24/were-bringing-gitlab-pages-to-community-edition/)
- Announcement (2017-03-06): ["We are changing the IP of GitLab Pages on GitLab.com"](https://about.gitlab.com/2017/03/06/we-are-changing-the-ip-of-gitlab-pages-on-gitlab-com/) - Announcement (2017-03-06): ["We are changing the IP of GitLab Pages on GitLab.com"](https://about.gitlab.com/2017/03/06/we-are-changing-the-ip-of-gitlab-pages-on-gitlab-com/)
# GitLab quick actions # GitLab quick actions
Quick actions are textual shortcuts for common actions on issues, merge requests Quick actions are textual shortcuts for common actions on issues, epics, merge requests,
or commits that are usually done by clicking buttons or dropdowns in GitLab's UI. and commits that are usually done by clicking buttons or dropdowns in GitLab's UI.
You can enter these commands while creating a new issue or merge request, and You can enter these commands while creating a new issue or merge request, or
in comments. Each command should be on a separate line in order to be properly in comments of issues, epics, merge requests, and commits. Each command should be
detected and executed. The commands are removed from the issue, merge request or on a separate line in order to be properly detected and executed. Once executed,
comment body before it is saved and will not be visible to anyone else. the commands are removed from the text body and not visible to anyone else.
Below is a list of all of the available commands and descriptions about what they Below is a list of all of the available commands, where they apply, and descriptions
do. about what they do.
| Command | Action | docs-quick-actions-table
|:---------------------------|:-------------|
| `/close` | Close the issue, merge request or epic |
| `/reopen` | Reopen the issue, merge request or epic |
| `/merge` | Merge (when pipeline succeeds) | | Command | Action | Issue | Epic | Merge request | Commit |
| `/title <New title>` | Change title | |:---------------------------|:-----------------------|:------|:-----|:--------------|:-------|
| `/assign @user1 @user2 ` | Add assignee(s) | | `/close` | Close | ✓ | ✓ | ✓ | |
| `/reassign @user1 @user2 ` | Change assignee(s) | | `/reopen` | Reopen | ✓ | ✓ | ✓ | |
| `/unassign @user1 @user2` | Remove all or specific assignee(s) | | `/merge` | Merge (when pipeline succeeds) | | | ✓ | |
| `/milestone %milestone` | Set milestone | | `/title <New title>` | Change title | | ✓ | ✓ | ✓ | |
| `/remove_milestone` | Remove milestone | | `/assign @username` | Assign | ✓ | | ✓ | |
| `/label ~foo ~"bar baz"` | Add label(s) | | `/unassign` | Remove assignee | ✓ | | ✓ | |
| `/unlabel ~foo ~"bar baz"` | Remove all or specific label(s) | | `/milestone %milestone` | Set milestone | ✓ | | ✓ | |
| `/relabel ~foo ~"bar baz"` | Replace all label(s) | | `/remove_milestone` | Remove milestone | ✓ | | ✓ | |
| `/todo` | Add a todo | | `/label ~foo ~"bar baz"` | Add label(s) | ✓ | | ✓ | |
| `/done` | Mark todo as done | | `/unlabel ~foo ~"bar baz"` | Remove all or specific label(s)| ✓ | | ✓ | |
| `/subscribe` | Subscribe | | `/relabel ~foo ~"bar baz"` | Replace all label(s) | ✓ | | ✓ | |
| `/unsubscribe` | Unsubscribe | | `/todo` | Add a todo | ✓ | ✓ | ✓ | |
| <code>/due &lt;in 2 days &#124; this Friday &#124; December 31st&gt;</code> | Set due date | | `/done` | Mark todo as done | ✓ | ✓ | ✓ | |
| `/remove_due_date` | Remove due date | | `/subscribe` | Subscribe | ✓ | ✓ | ✓ | |
| `/wip` | Toggle the Work In Progress status | | `/unsubscribe` | Unsubscribe | ✓ | ✓ | ✓ | |
| <code>/estimate &lt;1w 3d 2h 14m&gt;</code> | Set time estimate | | <code>/due &lt;in 2 days &#124; this Friday &#124; December 31st&gt;</code> | Set due date | ✓ | | | |
| `/remove_estimate` | Remove estimated time | | `/remove_due_date` | Remove due date | ✓ | | | |
| <code>/spend &lt;time(1h 30m &#124; -1h 5m)&gt; &lt;date(YYYY-MM-DD)&gt;</code> | Add or subtract spent time; optionally, specify the date that time was spent on | | `/wip` | Toggle the Work In Progress status | | | ✓ | |
| `/remove_time_spent` | Remove time spent | | <code>/estimate &lt;1w 3d 2h 14m&gt;</code> | Set time estimate | ✓ | | ✓ | |
| `/target_branch <Branch Name>` | Set target branch for current merge request | | `/remove_estimate` | Remove estimated time | ✓ | | ✓ | |
| `/award :emoji:` | Toggle award for :emoji: | | <code>/spend &lt;time(1h 30m &#124; -1h 5m)&gt; &lt;date(YYYY-MM-DD)&gt;</code> | Add or subtract spent time; optionally, specify the date that time was spent on | ✓ | | | ✓ |
| `/weight <0-999999999>` | Set the weight of the issue | | `/remove_time_spent` | Remove time spent | ✓ | | ✓ | |
| `/clear_weight` | Clears the issue weight | | `/target_branch <Branch Name>` | Set target branch for current merge request | | | ✓ | |
| `/board_move ~column` | Move issue to column on the board | | `/award :emoji:` | Toggle award for :emoji: | ✓ | ✓ | ✓ | |
| `/duplicate #issue` | Closes this issue and marks it as a duplicate of another issue | | `/weight <0-999999999>` | Set the weight of the issue | ✓ | | | |
| `/move path/to/project` | Moves issue to another project | | `/clear_weight` | Clears the issue weight | ✓ | | | |
| `/tag v1.2.3 <message>` | Tags a commit with a given tag name and optional message | | `/board_move ~column` | Move issue to column on the board | ✓ | | | |
| `/tableflip` | Append the comment with `(╯°□°)╯︵ ┻━┻` | | `/duplicate #issue` | Closes this issue and marks it as a duplicate of another issue | ✓ | | | |
| `/shrug` | Append the comment with `¯\_(ツ)_/¯` | | `/move path/to/project` | Moves issue to another project | ✓ | | | |
| <code>/copy_metadata #issue &#124; !merge_request</code> | Copy labels and milestone from other issue or merge request | | `/tag v1.2.3 <message>` | Tags a commit with a given tag name and optional message | | | | ✓ |
| `/confidential` | Makes the issue confidential | | `/tableflip` | Append the comment with `(╯°□°)╯︵ ┻━┻` | ✓ | ✓ | ✓ | ✓ |
| `/epic <group&epic | Epic URL>` | Adds an issue to an epic | | `/shrug` | Append the comment with `¯\_(ツ)_/¯` | ✓ | ✓ | ✓ | ✓ |
| `/remove_epic` | Removes an issue from an epic | | <code>/copy_metadata #issue &#124; !merge_request</code> | Copy labels and milestone from other issue or merge request | ✓ | | ✓ | |
| `/lock` | Lock the discussion | | `/confidential` | Makes the issue confidential | ✓ | | | |
| `/unlock` | Unlock the discussion | | `/epic <group&epic OR Epic URL>` | Adds an issue to an epic | | ✓ | | |
| `/remove_epic` | Removes an issue from an epic | | ✓ | | |
| `/lock` | Lock the discussion | ✓ | | | ✓ |
| `/unlock` | Unlock the discussion | ✓ | | | ✓|
Note: In GitLab Starter every issue can have more than one assignee, so commands `/assign`, `/unassign` and `/reassign` Note: In GitLab Starter every issue can have more than one assignee, so commands `/assign`, `/unassign` and `/reassign`
support multiple assignees. support multiple assignees.
...@@ -16,7 +16,7 @@ module EE ...@@ -16,7 +16,7 @@ module EE
private private
def log_geo_event def log_geo_event
::Geo::JobArtifactDeletedEventStore.new(self).create ::Geo::JobArtifactDeletedEventStore.new(self).create!
end end
end end
end end
...@@ -16,7 +16,7 @@ module EE ...@@ -16,7 +16,7 @@ module EE
private private
def log_geo_event def log_geo_event
::Geo::LfsObjectDeletedEventStore.new(self).create ::Geo::LfsObjectDeletedEventStore.new(self).create!
end end
end end
end end
...@@ -57,7 +57,7 @@ module EE ...@@ -57,7 +57,7 @@ module EE
project, project,
old_path: project.path, old_path: project.path,
old_path_with_namespace: old_path_with_namespace_for(project) old_path_with_namespace: old_path_with_namespace_for(project)
).create ).create!
end end
end end
......
...@@ -602,7 +602,7 @@ module EE ...@@ -602,7 +602,7 @@ module EE
self, self,
old_path: path_before, old_path: path_before,
old_path_with_namespace: full_path_before old_path_with_namespace: full_path_before
).create ).create!
end end
end end
end end
...@@ -15,7 +15,7 @@ module EE ...@@ -15,7 +15,7 @@ module EE
private private
def log_geo_event def log_geo_event
::Geo::UploadDeletedEventStore.new(self).create ::Geo::UploadDeletedEventStore.new(self).create!
end end
end end
end end
...@@ -38,7 +38,7 @@ module EE ...@@ -38,7 +38,7 @@ module EE
private private
def log_geo_event(project) def log_geo_event(project)
::Geo::RepositoryCreatedEventStore.new(project).create ::Geo::RepositoryCreatedEventStore.new(project).create!
end end
override :after_create_actions override :after_create_actions
......
...@@ -36,7 +36,7 @@ module EE ...@@ -36,7 +36,7 @@ module EE
project, project,
repo_path: repo_path, repo_path: repo_path,
wiki_path: wiki_path wiki_path: wiki_path
).create ).create!
end end
# Removes physical repository in a Geo replicated secondary node # Removes physical repository in a Geo replicated secondary node
......
...@@ -11,7 +11,7 @@ module EE ...@@ -11,7 +11,7 @@ module EE
project, project,
old_attachments_path: old_disk_path, old_attachments_path: old_disk_path,
new_attachments_path: new_disk_path new_attachments_path: new_disk_path
).create ).create!
end end
end end
end end
......
...@@ -12,7 +12,7 @@ module EE ...@@ -12,7 +12,7 @@ module EE
old_storage_version: old_storage_version, old_storage_version: old_storage_version,
old_disk_path: old_disk_path, old_disk_path: old_disk_path,
old_wiki_disk_path: old_wiki_disk_path old_wiki_disk_path: old_wiki_disk_path
).create ).create!
end end
end end
end end
......
...@@ -15,7 +15,7 @@ module EE ...@@ -15,7 +15,7 @@ module EE
project, project,
old_path: project.path, old_path: project.path,
old_path_with_namespace: @old_path # rubocop:disable Gitlab/ModuleWithInstanceVariables old_path_with_namespace: @old_path # rubocop:disable Gitlab/ModuleWithInstanceVariables
).create ).create!
end end
end end
end end
......
...@@ -30,7 +30,7 @@ module Geo ...@@ -30,7 +30,7 @@ module Geo
@params = params @params = params
end end
def create def create!
return unless Gitlab::Geo.primary? return unless Gitlab::Geo.primary?
return unless Gitlab::Geo.secondary_nodes.any? # no need to create an event if no one is listening return unless Gitlab::Geo.secondary_nodes.any? # no need to create an event if no one is listening
......
module Geo module Geo
class JobArtifactDeletedEventStore < EventStore class JobArtifactDeletedEventStore < EventStore
extend ::Gitlab::Utils::Override
self.event_type = :job_artifact_deleted_event self.event_type = :job_artifact_deleted_event
attr_reader :job_artifact attr_reader :job_artifact
...@@ -8,7 +10,8 @@ module Geo ...@@ -8,7 +10,8 @@ module Geo
@job_artifact = job_artifact @job_artifact = job_artifact
end end
def create override :create!
def create!
return unless job_artifact.local_store? return unless job_artifact.local_store?
super super
......
module Geo module Geo
class LfsObjectDeletedEventStore < EventStore class LfsObjectDeletedEventStore < EventStore
extend ::Gitlab::Utils::Override
self.event_type = :lfs_object_deleted_event self.event_type = :lfs_object_deleted_event
attr_reader :lfs_object attr_reader :lfs_object
...@@ -8,7 +10,8 @@ module Geo ...@@ -8,7 +10,8 @@ module Geo
@lfs_object = lfs_object @lfs_object = lfs_object
end end
def create override :create!
def create!
return unless lfs_object.local_store? return unless lfs_object.local_store?
super super
......
...@@ -15,7 +15,7 @@ module Geo ...@@ -15,7 +15,7 @@ module Geo
def execute def execute
return false unless geo_node.update(params) return false unless geo_node.update(params)
Geo::RepositoriesChangedEventStore.new(geo_node).create if selective_sync_changed? Geo::RepositoriesChangedEventStore.new(geo_node).create! if selective_sync_changed?
true true
end end
......
...@@ -30,7 +30,7 @@ module Geo ...@@ -30,7 +30,7 @@ module Geo
def create_repository_updated_event! def create_repository_updated_event!
Geo::RepositoryUpdatedEventStore.new( Geo::RepositoryUpdatedEventStore.new(
project, refs: refs, changes: changes, source: source project, refs: refs, changes: changes, source: source
).create ).create!
end end
def reset_repository_checksum! def reset_repository_checksum!
......
module Geo module Geo
class UploadDeletedEventStore < EventStore class UploadDeletedEventStore < EventStore
extend ::Gitlab::Utils::Override
self.event_type = :upload_deleted_event self.event_type = :upload_deleted_event
attr_reader :upload attr_reader :upload
...@@ -8,7 +10,8 @@ module Geo ...@@ -8,7 +10,8 @@ module Geo
@upload = upload @upload = upload
end end
def create override :create!
def create!
return unless upload.local? return unless upload.local?
super super
......
...@@ -27,7 +27,7 @@ describe Geo::HashedStorageAttachmentsEventStore do ...@@ -27,7 +27,7 @@ describe Geo::HashedStorageAttachmentsEventStore do
end end
it 'tracks project attributes' do it 'tracks project attributes' do
subject.create subject.create!
expect(Geo::HashedStorageAttachmentsEvent.last).to have_attributes( expect(Geo::HashedStorageAttachmentsEvent.last).to have_attributes(
old_attachments_path: old_attachments_path, old_attachments_path: old_attachments_path,
......
...@@ -26,7 +26,7 @@ describe Geo::HashedStorageMigratedEventStore do ...@@ -26,7 +26,7 @@ describe Geo::HashedStorageMigratedEventStore do
end end
it 'tracks project attributes' do it 'tracks project attributes' do
subject.create subject.create!
expect(Geo::HashedStorageMigratedEvent.last).to have_attributes( expect(Geo::HashedStorageMigratedEvent.last).to have_attributes(
repository_storage_name: project.repository_storage, repository_storage_name: project.repository_storage,
......
...@@ -22,11 +22,11 @@ describe Geo::JobArtifactDeletedEventStore do ...@@ -22,11 +22,11 @@ describe Geo::JobArtifactDeletedEventStore do
it 'does not create an event when LFS object is not on a local store' do it 'does not create an event when LFS object is not on a local store' do
allow(job_artifact).to receive(:local_store?).and_return(false) allow(job_artifact).to receive(:local_store?).and_return(false)
expect { subject.create }.not_to change(Geo::JobArtifactDeletedEvent, :count) expect { subject.create! }.not_to change(Geo::JobArtifactDeletedEvent, :count)
end end
it 'tracks LFS object attributes' do it 'tracks LFS object attributes' do
subject.create subject.create!
expect(Geo::JobArtifactDeletedEvent.last).to have_attributes( expect(Geo::JobArtifactDeletedEvent.last).to have_attributes(
job_artifact_id: job_artifact.id, job_artifact_id: job_artifact.id,
...@@ -49,7 +49,7 @@ describe Geo::JobArtifactDeletedEventStore do ...@@ -49,7 +49,7 @@ describe Geo::JobArtifactDeletedEventStore do
expect(Gitlab::Geo::Logger).to receive(:error) expect(Gitlab::Geo::Logger).to receive(:error)
.with(expected_message).and_call_original .with(expected_message).and_call_original
subject.create subject.create!
end end
end end
end end
......
...@@ -22,11 +22,11 @@ describe Geo::LfsObjectDeletedEventStore do ...@@ -22,11 +22,11 @@ describe Geo::LfsObjectDeletedEventStore do
it 'does not create an event when LFS object is not on a local store' do it 'does not create an event when LFS object is not on a local store' do
allow(lfs_object).to receive(:local_store?).and_return(false) allow(lfs_object).to receive(:local_store?).and_return(false)
expect { subject.create }.not_to change(Geo::LfsObjectDeletedEvent, :count) expect { subject.create! }.not_to change(Geo::LfsObjectDeletedEvent, :count)
end end
it 'tracks LFS object attributes' do it 'tracks LFS object attributes' do
subject.create subject.create!
expect(Geo::LfsObjectDeletedEvent.last).to have_attributes( expect(Geo::LfsObjectDeletedEvent.last).to have_attributes(
lfs_object_id: lfs_object.id, lfs_object_id: lfs_object.id,
...@@ -50,7 +50,7 @@ describe Geo::LfsObjectDeletedEventStore do ...@@ -50,7 +50,7 @@ describe Geo::LfsObjectDeletedEventStore do
expect(Gitlab::Geo::Logger).to receive(:error) expect(Gitlab::Geo::Logger).to receive(:error)
.with(expected_message).and_call_original .with(expected_message).and_call_original
subject.create subject.create!
end end
end end
end end
......
...@@ -19,7 +19,7 @@ describe Geo::RepositoryCreatedEventStore do ...@@ -19,7 +19,7 @@ describe Geo::RepositoryCreatedEventStore do
end end
it 'tracks information for the created project' do it 'tracks information for the created project' do
subject.create subject.create!
expect(Geo::RepositoryCreatedEvent.last).to have_attributes( expect(Geo::RepositoryCreatedEvent.last).to have_attributes(
project_id: project.id, project_id: project.id,
...@@ -33,7 +33,7 @@ describe Geo::RepositoryCreatedEventStore do ...@@ -33,7 +33,7 @@ describe Geo::RepositoryCreatedEventStore do
it 'does not set a wiki path if the wiki is disabled' do it 'does not set a wiki path if the wiki is disabled' do
project.update!(wiki_enabled: false) project.update!(wiki_enabled: false)
subject.create subject.create!
expect(Geo::RepositoryCreatedEvent.last.wiki_path).to be_nil expect(Geo::RepositoryCreatedEvent.last.wiki_path).to be_nil
end end
......
...@@ -25,7 +25,7 @@ describe Geo::RepositoryDeletedEventStore do ...@@ -25,7 +25,7 @@ describe Geo::RepositoryDeletedEventStore do
end end
it 'tracks information for the deleted project' do it 'tracks information for the deleted project' do
subject.create subject.create!
expect(Geo::RepositoryDeletedEvent.last).to have_attributes( expect(Geo::RepositoryDeletedEvent.last).to have_attributes(
project_id: project_id, project_id: project_id,
......
...@@ -22,7 +22,7 @@ describe Geo::RepositoryRenamedEventStore do ...@@ -22,7 +22,7 @@ describe Geo::RepositoryRenamedEventStore do
end end
it 'tracks old and new paths for project repositories' do it 'tracks old and new paths for project repositories' do
subject.create subject.create!
expect(Geo::RepositoryRenamedEvent.last).to have_attributes( expect(Geo::RepositoryRenamedEvent.last).to have_attributes(
repository_storage_name: project.repository_storage, repository_storage_name: project.repository_storage,
......
...@@ -30,7 +30,7 @@ describe Geo::RepositoryUpdatedEventStore do ...@@ -30,7 +30,7 @@ describe Geo::RepositoryUpdatedEventStore do
context 'when repository is being updated' do context 'when repository is being updated' do
it 'does not track ref name when post-receive event affect multiple refs' do it 'does not track ref name when post-receive event affect multiple refs' do
subject.create subject.create!
expect(Geo::RepositoryUpdatedEvent.last.ref).to be_nil expect(Geo::RepositoryUpdatedEvent.last.ref).to be_nil
end end
...@@ -40,19 +40,19 @@ describe Geo::RepositoryUpdatedEventStore do ...@@ -40,19 +40,19 @@ describe Geo::RepositoryUpdatedEventStore do
changes = [{ before: '123456', after: blankrev, ref: 'refs/heads/tést' }] changes = [{ before: '123456', after: blankrev, ref: 'refs/heads/tést' }]
subject = described_class.new(project, refs: refs, changes: changes) subject = described_class.new(project, refs: refs, changes: changes)
subject.create subject.create!
expect(Geo::RepositoryUpdatedEvent.last.ref).to eq 'refs/heads/tést' expect(Geo::RepositoryUpdatedEvent.last.ref).to eq 'refs/heads/tést'
end end
it 'tracks number of branches post-receive event affects' do it 'tracks number of branches post-receive event affects' do
subject.create subject.create!
expect(Geo::RepositoryUpdatedEvent.last.branches_affected).to eq 1 expect(Geo::RepositoryUpdatedEvent.last.branches_affected).to eq 1
end end
it 'tracks number of tags post-receive event affects' do it 'tracks number of tags post-receive event affects' do
subject.create subject.create!
expect(Geo::RepositoryUpdatedEvent.last.tags_affected).to eq 1 expect(Geo::RepositoryUpdatedEvent.last.tags_affected).to eq 1
end end
...@@ -65,7 +65,7 @@ describe Geo::RepositoryUpdatedEventStore do ...@@ -65,7 +65,7 @@ describe Geo::RepositoryUpdatedEventStore do
] ]
subject = described_class.new(project, refs: refs, changes: changes) subject = described_class.new(project, refs: refs, changes: changes)
subject.create subject.create!
expect(Geo::RepositoryUpdatedEvent.last.new_branch).to eq true expect(Geo::RepositoryUpdatedEvent.last.new_branch).to eq true
end end
...@@ -78,7 +78,7 @@ describe Geo::RepositoryUpdatedEventStore do ...@@ -78,7 +78,7 @@ describe Geo::RepositoryUpdatedEventStore do
] ]
subject = described_class.new(project, refs: refs, changes: changes) subject = described_class.new(project, refs: refs, changes: changes)
subject.create subject.create!
expect(Geo::RepositoryUpdatedEvent.last.remove_branch).to eq true expect(Geo::RepositoryUpdatedEvent.last.remove_branch).to eq true
end end
...@@ -88,7 +88,7 @@ describe Geo::RepositoryUpdatedEventStore do ...@@ -88,7 +88,7 @@ describe Geo::RepositoryUpdatedEventStore do
it 'does not track any information' do it 'does not track any information' do
subject = described_class.new(project, source: Geo::RepositoryUpdatedEvent::WIKI) subject = described_class.new(project, source: Geo::RepositoryUpdatedEvent::WIKI)
subject.create subject.create!
expect(Geo::RepositoryUpdatedEvent.last).to have_attributes( expect(Geo::RepositoryUpdatedEvent.last).to have_attributes(
ref: be_nil, ref: be_nil,
......
...@@ -19,7 +19,7 @@ describe Geo::ResetChecksumEventStore do ...@@ -19,7 +19,7 @@ describe Geo::ResetChecksumEventStore do
end end
it 'tracks the project that checksum must be wiped' do it 'tracks the project that checksum must be wiped' do
subject.create subject.create!
expect(Geo::ResetChecksumEvent.last).to have_attributes(project_id: project.id) expect(Geo::ResetChecksumEvent.last).to have_attributes(project_id: project.id)
end end
......
...@@ -22,11 +22,11 @@ describe Geo::UploadDeletedEventStore do ...@@ -22,11 +22,11 @@ describe Geo::UploadDeletedEventStore do
it 'does not create an event when the upload does not use local storage' do it 'does not create an event when the upload does not use local storage' do
allow(upload).to receive(:local?).and_return(false) allow(upload).to receive(:local?).and_return(false)
expect { subject.create }.not_to change(Geo::UploadDeletedEvent, :count) expect { subject.create! }.not_to change(Geo::UploadDeletedEvent, :count)
end end
it 'tracks upload attributes' do it 'tracks upload attributes' do
subject.create subject.create!
expect(Geo::UploadDeletedEvent.last).to have_attributes( expect(Geo::UploadDeletedEvent.last).to have_attributes(
upload_id: upload.id, upload_id: upload.id,
......
...@@ -7,7 +7,7 @@ shared_examples_for 'a Geo event store' do |event_class| ...@@ -7,7 +7,7 @@ shared_examples_for 'a Geo event store' do |event_class|
end end
it 'does not create an event ' do it 'does not create an event ' do
expect { subject.create }.not_to change(event_class, :count) expect { subject.create! }.not_to change(event_class, :count)
end end
end end
...@@ -19,11 +19,11 @@ shared_examples_for 'a Geo event store' do |event_class| ...@@ -19,11 +19,11 @@ shared_examples_for 'a Geo event store' do |event_class|
it 'does not create an event if there are no secondary nodes' do it 'does not create an event if there are no secondary nodes' do
allow(Gitlab::Geo).to receive(:secondary_nodes) { [] } allow(Gitlab::Geo).to receive(:secondary_nodes) { [] }
expect { subject.create }.not_to change(event_class, :count) expect { subject.create! }.not_to change(event_class, :count)
end end
it 'creates an event' do it 'creates an event' do
expect { subject.create }.to change(event_class, :count).by(1) expect { subject.create! }.to change(event_class, :count).by(1)
end end
end end
end end
...@@ -34,7 +34,7 @@ describe PostReceive do ...@@ -34,7 +34,7 @@ describe PostReceive do
described_class.new.perform(gl_repository, key_id, base64_changes) described_class.new.perform(gl_repository, key_id, base64_changes)
end end
it 'does not call Geo::RepositoryUpdatedEventStore when not running on a Geo primary node' do it 'does not call Geo::RepositoryUpdatedService when not running on a Geo primary node' do
allow(Gitlab::Geo).to receive(:primary?) { false } allow(Gitlab::Geo).to receive(:primary?) { false }
expect_any_instance_of(::Geo::RepositoryUpdatedService).not_to receive(:execute) expect_any_instance_of(::Geo::RepositoryUpdatedService).not_to receive(:execute)
...@@ -47,7 +47,7 @@ describe PostReceive do ...@@ -47,7 +47,7 @@ describe PostReceive do
describe '#process_wiki_changes' do describe '#process_wiki_changes' do
let(:gl_repository) { "wiki-#{project.id}" } let(:gl_repository) { "wiki-#{project.id}" }
it 'calls Geo::RepositoryUpdatedEventStore when running on a Geo primary node' do it 'calls Geo::RepositoryUpdatedService when running on a Geo primary node' do
allow(Gitlab::Geo).to receive(:primary?) { true } allow(Gitlab::Geo).to receive(:primary?) { true }
expect_any_instance_of(::Geo::RepositoryUpdatedService).to receive(:execute) expect_any_instance_of(::Geo::RepositoryUpdatedService).to receive(:execute)
...@@ -55,7 +55,7 @@ describe PostReceive do ...@@ -55,7 +55,7 @@ describe PostReceive do
described_class.new.perform(gl_repository, key_id, base64_changes) described_class.new.perform(gl_repository, key_id, base64_changes)
end end
it 'does not call Geo::RepositoryUpdatedEventStore when not running on a Geo primary node' do it 'does not call Geo::RepositoryUpdatedService when not running on a Geo primary node' do
allow(Gitlab::Geo).to receive(:primary?) { false } allow(Gitlab::Geo).to receive(:primary?) { false }
expect_any_instance_of(::Geo::RepositoryUpdatedService).not_to receive(:execute) expect_any_instance_of(::Geo::RepositoryUpdatedService).not_to receive(:execute)
......
...@@ -238,6 +238,7 @@ module QA ...@@ -238,6 +238,7 @@ module QA
module Settings module Settings
autoload :RepositoryStorage, 'qa/page/admin/settings/repository_storage' autoload :RepositoryStorage, 'qa/page/admin/settings/repository_storage'
autoload :Main, 'qa/page/admin/settings/main' autoload :Main, 'qa/page/admin/settings/main'
autoload :Repository, 'qa/page/admin/settings/repository'
end end
end end
......
...@@ -8,8 +8,9 @@ module QA ...@@ -8,8 +8,9 @@ module QA
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
Page::Menu::Main.act { go_to_admin_area } Page::Menu::Main.act { go_to_admin_area }
Page::Menu::Admin.act { go_to_settings } Page::Menu::Admin.act { go_to_settings }
Page::Menu::Side.act { click_repository }
Page::Admin::Settings::Main.perform do |setting| Page::Admin::Settings::Repository.perform do |setting|
setting.expand_repository_storage do |page| setting.expand_repository_storage do |page|
page.enable_hashed_storage page.enable_hashed_storage
page.save_settings page.save_settings
......
...@@ -6,13 +6,6 @@ module QA ...@@ -6,13 +6,6 @@ module QA
include QA::Page::Settings::Common include QA::Page::Settings::Common
view 'app/views/admin/application_settings/show.html.haml' do view 'app/views/admin/application_settings/show.html.haml' do
element :terms_settings
end
def expand_repository_storage(&block)
expand_section(:terms_settings) do
RepositoryStorage.perform(&block)
end
end end
end end
end end
......
# frozen_string_literal: true
module QA
module Page
module Admin
module Settings
class Repository < Page::Base
include QA::Page::Settings::Common
view 'app/views/admin/application_settings/repository.html.haml' do
element :repository_storage
end
def expand_repository_storage(&block)
expand_section(:repository_storage) do
RepositoryStorage.perform(&block)
end
end
end
end
end
end
end
...@@ -84,6 +84,12 @@ module QA ...@@ -84,6 +84,12 @@ module QA
end end
end end
def click_repository
within_sidebar do
click_link('Repository')
end
end
private private
def hover_settings def hover_settings
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment