Commit 9fdfbd55 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-10-31

# Conflicts:
#	app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
#	app/models/blob.rb
#	locale/gitlab.pot
#	spec/javascripts/vue_mr_widget/mock_data.js

[ci skip]
parents c52b1d48 418de3fc
import $ from 'jquery'; import $ from 'jquery';
import { slugifyWithHyphens } from './lib/utils/text_utility';
export default class Group { export default class Group {
constructor() { constructor() {
...@@ -7,17 +8,18 @@ export default class Group { ...@@ -7,17 +8,18 @@ export default class Group {
this.updateHandler = this.update.bind(this); this.updateHandler = this.update.bind(this);
this.resetHandler = this.reset.bind(this); this.resetHandler = this.reset.bind(this);
if (this.groupName.val() === '') { if (this.groupName.val() === '') {
this.groupPath.on('keyup', this.updateHandler); this.groupName.on('keyup', this.updateHandler);
this.groupName.on('keydown', this.resetHandler); this.groupPath.on('keydown', this.resetHandler);
} }
} }
update() { update() {
this.groupName.val(this.groupPath.val()); const slug = slugifyWithHyphens(this.groupName.val());
this.groupPath.val(slug);
} }
reset() { reset() {
this.groupPath.off('keyup', this.updateHandler); this.groupName.off('keyup', this.updateHandler);
this.groupName.off('keydown', this.resetHandler); this.groupPath.off('keydown', this.resetHandler);
} }
} }
<script> <script>
import { s__, sprintf } from '~/locale'; import { s__, sprintf } from '~/locale';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
import icon from '../../vue_shared/components/icon.vue'; import Icon from '../../vue_shared/components/icon.vue';
import tooltip from '../../vue_shared/directives/tooltip'; import tooltip from '../../vue_shared/directives/tooltip';
import GlCountdown from '~/vue_shared/components/gl_countdown.vue'; import GlCountdown from '~/vue_shared/components/gl_countdown.vue';
...@@ -10,7 +10,7 @@ export default { ...@@ -10,7 +10,7 @@ export default {
tooltip, tooltip,
}, },
components: { components: {
icon, Icon,
GlCountdown, GlCountdown,
}, },
props: { props: {
......
<script> <script>
import tooltip from '../../vue_shared/directives/tooltip'; import tooltip from '../../vue_shared/directives/tooltip';
import icon from '../../vue_shared/components/icon.vue'; import Icon from '../../vue_shared/components/icon.vue';
export default { export default {
directives: { directives: {
tooltip, tooltip,
}, },
components: { components: {
icon, Icon,
}, },
props: { props: {
artifacts: { artifacts: {
......
...@@ -88,25 +88,25 @@ export default { ...@@ -88,25 +88,25 @@ export default {
class="table-section section-10 js-pipeline-status pipeline-status" class="table-section section-10 js-pipeline-status pipeline-status"
role="rowheader" role="rowheader"
> >
Status {{ s__('Pipeline|Status') }}
</div> </div>
<div <div
class="table-section section-15 js-pipeline-info pipeline-info" class="table-section section-15 js-pipeline-info pipeline-info"
role="rowheader" role="rowheader"
> >
Pipeline {{ s__('Pipeline|Pipeline') }}
</div> </div>
<div <div
class="table-section section-20 js-pipeline-commit pipeline-commit" class="table-section section-20 js-pipeline-commit pipeline-commit"
role="rowheader" role="rowheader"
> >
Commit {{ s__('Pipeline|Commit') }}
</div> </div>
<div <div
class="table-section section-20 js-pipeline-stages pipeline-stages" class="table-section section-20 js-pipeline-stages pipeline-stages"
role="rowheader" role="rowheader"
> >
Stages {{ s__('Pipeline|Stages') }}
</div> </div>
</div> </div>
<pipelines-table-row-component <pipelines-table-row-component
......
...@@ -261,7 +261,7 @@ export default { ...@@ -261,7 +261,7 @@ export default {
class="table-mobile-header" class="table-mobile-header"
role="rowheader" role="rowheader"
> >
Status {{ s__('Pipeline|Status') }}
</div> </div>
<div class="table-mobile-content"> <div class="table-mobile-content">
<ci-badge <ci-badge
...@@ -279,8 +279,9 @@ export default { ...@@ -279,8 +279,9 @@ export default {
<div class="table-section section-20"> <div class="table-section section-20">
<div <div
class="table-mobile-header" class="table-mobile-header"
role="rowheader"> role="rowheader"
Commit >
{{ s__('Pipeline|Commit') }}
</div> </div>
<div class="table-mobile-content"> <div class="table-mobile-content">
<commit-component <commit-component
...@@ -298,8 +299,9 @@ export default { ...@@ -298,8 +299,9 @@ export default {
<div class="table-section section-wrap section-20 stage-cell"> <div class="table-section section-wrap section-20 stage-cell">
<div <div
class="table-mobile-header" class="table-mobile-header"
role="rowheader"> role="rowheader"
Stages >
{{ s__('Pipeline|Stages') }}
</div> </div>
<div class="table-mobile-content"> <div class="table-mobile-content">
<template v-if="pipeline.details.stages.length > 0"> <template v-if="pipeline.details.stages.length > 0">
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
class="table-mobile-header" class="table-mobile-header"
role="rowheader" role="rowheader"
> >
Duration {{ s__('Pipeline|Duration') }}
</div> </div>
<div class="table-mobile-content"> <div class="table-mobile-content">
<p <p
...@@ -87,7 +87,8 @@ export default { ...@@ -87,7 +87,8 @@ export default {
v-tooltip v-tooltip
:title="tooltipTitle(finishedTime)" :title="tooltipTitle(finishedTime)"
data-placement="top" data-placement="top"
data-container="body"> data-container="body"
>
{{ timeFormated(finishedTime) }} {{ timeFormated(finishedTime) }}
</time> </time>
</p> </p>
......
...@@ -226,7 +226,7 @@ export class SearchAutocomplete { ...@@ -226,7 +226,7 @@ export class SearchAutocomplete {
icon, icon,
text: term, text: term,
template: s__('SearchAutocomplete|in all GitLab'), template: s__('SearchAutocomplete|in all GitLab'),
url: `/search?search=${term}`, url: `${gon.relative_url_root}/search?search=${term}`,
}); });
if (template) { if (template) {
...@@ -234,7 +234,7 @@ export class SearchAutocomplete { ...@@ -234,7 +234,7 @@ export class SearchAutocomplete {
icon, icon,
text: term, text: term,
template, template,
url: `/search?search=${term}&project_id=${this.projectInputEl.val()}&group_id=${this.groupInputEl.val()}`, url: `${gon.relative_url_root}/search?search=${term}&project_id=${this.projectInputEl.val()}&group_id=${this.groupInputEl.val()}`,
}); });
} }
} }
......
...@@ -72,6 +72,7 @@ export default { ...@@ -72,6 +72,7 @@ export default {
linkEnd: '</a>', linkEnd: '</a>',
}); });
}, },
<<<<<<< HEAD
/* We typically set defaults ([]) in the store or prop declarations, but because triggered /* We typically set defaults ([]) in the store or prop declarations, but because triggered
* and triggeredBy are appended to `pipeline`, we can't set defaults in the store, and we * and triggeredBy are appended to `pipeline`, we can't set defaults in the store, and we
* need to check their length here to prevent initializing linked-pipeline-mini-lists * need to check their length here to prevent initializing linked-pipeline-mini-lists
...@@ -83,6 +84,8 @@ export default { ...@@ -83,6 +84,8 @@ export default {
const response = this.pipeline.triggered_by; const response = this.pipeline.triggered_by;
return response ? [response] : []; return response ? [response] : [];
}, },
=======
>>>>>>> upstream/master
}, },
}; };
</script> </script>
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
# Blob is a Rails-specific wrapper around Gitlab::Git::Blob, SnippetBlob and Ci::ArtifactBlob # Blob is a Rails-specific wrapper around Gitlab::Git::Blob, SnippetBlob and Ci::ArtifactBlob
class Blob < SimpleDelegator class Blob < SimpleDelegator
<<<<<<< HEAD
prepend EE::Blob prepend EE::Blob
=======
>>>>>>> upstream/master
include Presentable include Presentable
include BlobLanguageFromGitAttributes include BlobLanguageFromGitAttributes
......
- @hide_breadcrumbs = true - @hide_breadcrumbs = true
- @hide_top_links = true - @hide_top_links = true
- page_title 'New Group' - page_title _('New Group')
- header_title "Groups", dashboard_groups_path - header_title _("Groups"), dashboard_groups_path
.page-title-holder
%h1.page-title= _('New group')
.row.prepend-top-default .row.prepend-top-default
.col-lg-3.profile-settings-sidebar .col-lg-3.profile-settings-sidebar
%h4.prepend-top-0
= _('New group')
%p %p
- group_docs_path = help_page_path('user/group/index') - group_docs_path = help_page_path('user/group/index')
- group_docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: group_docs_path } - group_docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: group_docs_path }
...@@ -15,24 +15,29 @@ ...@@ -15,24 +15,29 @@
- subgroup_docs_path = help_page_path('user/group/subgroups/index') - subgroup_docs_path = help_page_path('user/group/subgroups/index')
- subgroup_docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: subgroup_docs_path } - subgroup_docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: subgroup_docs_path }
= s_('Groups can also be nested by creating %{subgroup_docs_link_start}subgroups%{subgroup_docs_link_end}.').html_safe % { subgroup_docs_link_start: subgroup_docs_link_start, subgroup_docs_link_end: '</a>'.html_safe } = s_('Groups can also be nested by creating %{subgroup_docs_link_start}subgroups%{subgroup_docs_link_end}.').html_safe % { subgroup_docs_link_start: subgroup_docs_link_start, subgroup_docs_link_end: '</a>'.html_safe }
%p
= _('Projects that belong to a group are prefixed with the group namespace. Existing projects may be moved into a group.')
.col-lg-9 .col-lg-9
= form_for @group, html: { class: 'group-form gl-show-field-errors' } do |f| = form_for @group, html: { class: 'group-form gl-show-field-errors' } do |f|
= form_errors(@group) = form_errors(@group)
= render 'shared/group_form', f: f, autofocus: true = render 'shared/group_form', f: f, autofocus: true
.form-group.row.group-description-holder .row
= f.label :avatar, "Group avatar", class: 'col-form-label col-sm-2' .form-group.group-description-holder.col-sm-12
.col-sm-10 = f.label :avatar, _("Group avatar"), class: 'label-bold'
= render 'shared/choose_group_avatar_button', f: f %div
= render 'shared/choose_group_avatar_button', f: f
= render 'shared/old_visibility_level', f: f, visibility_level: @group.visibility_level, can_change_visibility_level: can_change_group_visibility_level?(@group), form_model: @group, with_label: false
= render 'create_chat_team', f: f if Gitlab.config.mattermost.enabled .form-group.col-sm-12
%label.label-bold
= _('Visibility level')
%p
= _('Who will be able to see this group?')
= link_to _('View the documentation'), help_page_path("public_access/public_access"), target: '_blank'
= render 'shared/visibility_level', f: f, visibility_level: @group.visibility_level, can_change_visibility_level: can_change_group_visibility_level?(@group), form_model: @group, with_label: false
.form-group.row = render 'create_chat_team', f: f if Gitlab.config.mattermost.enabled
.offset-sm-2.col-sm-10
= render 'shared/group_tips'
.form-actions .form-actions
= f.submit 'Create group', class: "btn btn-success" = f.submit 'Create group', class: "btn btn-success"
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
Layout width Layout width
= f.select :layout, layout_choices, {}, class: 'form-control' = f.select :layout, layout_choices, {}, class: 'form-control'
.form-text.text-muted .form-text.text-muted
Choose between fixed (max. 1200px) and fluid (100%) application layout. Choose between fixed (max. 1280px) and fluid (100%) application layout.
.form-group .form-group
= f.label :dashboard, class: 'label-bold' do = f.label :dashboard, class: 'label-bold' do
Default dashboard Default dashboard
...@@ -56,6 +56,6 @@ ...@@ -56,6 +56,6 @@
Project overview content Project overview content
= f.select :project_view, project_view_choices, {}, class: 'form-control' = f.select :project_view, project_view_choices, {}, class: 'form-control'
.form-text.text-muted .form-text.text-muted
Choose what content you want to see on a project’s overview page Choose what content you want to see on a project’s overview page.
.form-group .form-group
= f.submit 'Save changes', class: 'btn btn-success' = f.submit 'Save changes', class: 'btn btn-success'
...@@ -2,10 +2,19 @@ ...@@ -2,10 +2,19 @@
- group_path = root_url - group_path = root_url
- group_path << parent.full_path + '/' if parent - group_path << parent.full_path + '/' if parent
.form-group.row .row
= f.label :path, class: 'col-form-label col-sm-2' do .form-group.group-name-holder.col-sm-12
Group path = f.label :name, class: 'label-bold' do
.col-sm-10 = _("Group name")
= f.text_field :name, placeholder: 'My Awesome Group', class: 'form-control input-lg',
required: true,
title: _('Please fill in a descriptive name for your group.'),
autofocus: true
.row
.form-group.col-xs-12.col-sm-8
= f.label :path, class: 'label-bold' do
= _("Group URL")
.input-group.gl-field-error-anchor .input-group.gl-field-error-anchor
.group-root-path.input-group-prepend.has-tooltip{ title: group_path, :'data-placement' => 'bottom' } .group-root-path.input-group-prepend.has-tooltip{ title: group_path, :'data-placement' => 'bottom' }
.input-group-text .input-group-text
...@@ -13,10 +22,10 @@ ...@@ -13,10 +22,10 @@
- if parent - if parent
%strong= parent.full_path + '/' %strong= parent.full_path + '/'
= f.hidden_field :parent_id = f.hidden_field :parent_id
= f.text_field :path, placeholder: 'open-source', class: 'form-control', = f.text_field :path, placeholder: 'my-awesome-group', class: 'form-control',
autofocus: local_assigns[:autofocus] || false, required: true, autofocus: local_assigns[:autofocus] || false, required: true,
pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS, pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS,
title: 'Please choose a group path with no special characters.', title: _('Please choose a group URL with no special characters.'),
"data-bind-in" => "#{'create_chat_team' if Gitlab.config.mattermost.enabled}" "data-bind-in" => "#{'create_chat_team' if Gitlab.config.mattermost.enabled}"
- if @group.persisted? - if @group.persisted?
...@@ -25,23 +34,17 @@ ...@@ -25,23 +34,17 @@
= succeed '.' do = succeed '.' do
= link_to 'Learn more', help_page_path('user/group/index', anchor: 'changing-a-groups-path'), target: '_blank' = link_to 'Learn more', help_page_path('user/group/index', anchor: 'changing-a-groups-path'), target: '_blank'
.form-group.row.group-name-holder
= f.label :name, class: 'col-form-label col-sm-2' do
Group name
.col-sm-10
= f.text_field :name, class: 'form-control',
required: true,
title: 'You can choose a descriptive name different from the path.'
- if @group.persisted? - if @group.persisted?
.form-group.row.group-name-holder .row
= f.label :id, class: 'col-form-label col-sm-2' do .form-group.group-name-holder.col-sm-8
= _("Group ID") = f.label :id, class: 'label-bold' do
.col-sm-10 = _("Group ID")
= f.text_field :id, class: 'form-control', readonly: true = f.text_field :id, class: 'form-control', readonly: true
.form-group.row.group-description-holder .row
= f.label :description, class: 'col-form-label col-sm-2' .form-group.group-description-holder.col-sm-8
.col-sm-10 = f.label :description, class: 'label-bold' do
= _("Group description")
%span (optional)
= f.text_area :description, maxlength: 250, = f.text_area :description, maxlength: 250,
class: 'form-control js-gfm-input', rows: 4 class: 'form-control js-gfm-input', rows: 4
---
title: 'Create new group: Rename form fields and update UI'
merge_request:
author:
type: other
---
title: Fix incompatibility with IE11 due to non-transpiled gitlab-ui components
merge_request: 22695
author:
type: fixed
---
title: Adds missing i18n to pipelines table
merge_request:
author:
type: other
---
title: Enable frozen string for lib/gitlab/ci
merge_request:
author: gfyoung
type: performance
---
title: Fix search "all in GitLab" not working with relative URLs
merge_request: 22644
author:
type: fixed
...@@ -8,6 +8,8 @@ en: ...@@ -8,6 +8,8 @@ en:
issue_link: issue_link:
source: Source issue source: Source issue
target: Target issue target: Target issue
group:
path: Group URL
errors: errors:
messages: messages:
label_already_exists_at_group_level: "already exists at group level for %{group}. Please choose another one." label_already_exists_at_group_level: "already exists at group level for %{group}. Please choose another one."
......
...@@ -152,14 +152,31 @@ in RC1, followed by the feature flag being removed in RC2. This in turn means ...@@ -152,14 +152,31 @@ in RC1, followed by the feature flag being removed in RC2. This in turn means
the feature will be stable by the time we publish a stable package around the the feature will be stable by the time we publish a stable package around the
22nd of the month. 22nd of the month.
## Undefined feature flags default to "on" ## Implicit feature flags
By default, the [`Project#feature_available?`][project-fa], The [`Project#feature_available?`][project-fa],
[`Namespace#feature_available?`][namespace-fa] (EE), and [`Namespace#feature_available?`][namespace-fa] (EE), and
[`License.feature_available?`][license-fa] (EE) methods will check if the [`License.feature_available?`][license-fa] (EE) methods all implicitly check for
specified feature is behind a feature flag. Unless the feature is explicitly a feature flag by the same name as the provided argument.
disabled or limited to a percentage of users, the feature flag check will
default to `true`. For example if a feature is license-gated, there's no need to add an additional
explicit feature flag check since the flag will be checked as part of the
`License.feature_available?` call. Similarly, there's no need to "clean up" a
feature flag once the feature has reached general availability.
You'd still want to use an explicit `Feature.enabled?` check if your new feature
isn't gated by a License or Plan.
[project-fa]: https://gitlab.com/gitlab-org/gitlab-ee/blob/4cc1c62918aa4c31750cb21dfb1a6c3492d71080/app/models/project_feature.rb#L63-68
[namespace-fa]: https://gitlab.com/gitlab-org/gitlab-ee/blob/4cc1c62918aa4c31750cb21dfb1a6c3492d71080/ee/app/models/ee/namespace.rb#L71-85
[license-fa]: https://gitlab.com/gitlab-org/gitlab-ee/blob/4cc1c62918aa4c31750cb21dfb1a6c3492d71080/ee/app/models/license.rb#L293-300
### Undefined feature flags default to "on"
An important side-effect of the [implicit feature
flags][#implicit-feature-flags] mentioned above is that unless the feature is
explicitly disabled or limited to a percentage of users, the feature flag check
will default to `true`.
As an example, if you were to ship the backend half of a feature behind a flag, As an example, if you were to ship the backend half of a feature behind a flag,
you'd want to explicitly disable that flag until the frontend half is also ready you'd want to explicitly disable that flag until the frontend half is also ready
...@@ -171,7 +188,3 @@ to be shipped. You can do this via ChatOps: ...@@ -171,7 +188,3 @@ to be shipped. You can do this via ChatOps:
Note that you can do this at any time, even before the merge request using the Note that you can do this at any time, even before the merge request using the
flag has been merged! flag has been merged!
[project-fa]: https://gitlab.com/gitlab-org/gitlab-ee/blob/4cc1c62918aa4c31750cb21dfb1a6c3492d71080/app/models/project_feature.rb#L63-68
[namespace-fa]: https://gitlab.com/gitlab-org/gitlab-ee/blob/4cc1c62918aa4c31750cb21dfb1a6c3492d71080/ee/app/models/ee/namespace.rb#L71-85
[license-fa]: https://gitlab.com/gitlab-org/gitlab-ee/blob/4cc1c62918aa4c31750cb21dfb1a6c3492d71080/ee/app/models/license.rb#L293-300
...@@ -9,37 +9,39 @@ You can only restore a backup to **exactly the same version and type (CE/EE)** ...@@ -9,37 +9,39 @@ You can only restore a backup to **exactly the same version and type (CE/EE)**
of GitLab on which it was created. The best way to migrate your repositories of GitLab on which it was created. The best way to migrate your repositories
from one server to another is through backup restore. from one server to another is through backup restore.
## Backup ## Requirements
GitLab provides a simple command line interface to backup your whole installation, In order to be able to backup and restore, you need two essential tools
and is flexible enough to fit your needs. installed on your system.
### Requirements ### Rsync
* rsync If you installed GitLab:
If you're using GitLab with the Omnibus package, you're all set. If you - Using the Omnibus package, you're all set.
installed GitLab from source, make sure you have rsync installed. - From source, make sure `rsync` is installed:
If you're using Ubuntu, you could run: ```sh
# Debian/Ubuntu
sudo apt-get install rsync
``` # RHEL/CentOS
sudo apt-get install -y rsync sudo yum install rsync
``` ```
* tar ### Tar
Backup and restore tasks use `tar` under the hood to create and extract Backup and restore tasks use `tar` under the hood to create and extract
archives. Ensure you have version 1.30 or above of `tar` available in your archives. Ensure you have version 1.30 or above of `tar` available in your
system. To check the version, run: system. To check the version, run:
``` ```sh
tar --version tar --version
``` ```
### Backup timestamp ## Backup timestamp
>**Note:** NOTE: **Note:**
In GitLab 9.2 the timestamp format was changed from `EPOCH_YYYY_MM_DD` to In GitLab 9.2 the timestamp format was changed from `EPOCH_YYYY_MM_DD` to
`EPOCH_YYYY_MM_DD_GitLab_version`, for example `1493107454_2018_04_25` `EPOCH_YYYY_MM_DD_GitLab_version`, for example `1493107454_2018_04_25`
would become `1493107454_2018_04_25_10.6.4-ce`. would become `1493107454_2018_04_25_10.6.4-ce`.
...@@ -54,30 +56,46 @@ available. ...@@ -54,30 +56,46 @@ available.
For example, if the backup name is `1493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar`, For example, if the backup name is `1493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar`,
then the timestamp is `1493107454_2018_04_25_10.6.4-ce`. then the timestamp is `1493107454_2018_04_25_10.6.4-ce`.
### Creating a backup of the GitLab system ## Creating a backup of the GitLab system
GitLab provides a simple command line interface to backup your whole instance.
It backs up your:
- Database
- Attachments
- Git repositories data
- CI/CD job output logs
- CI/CD job artifacts
- LFS objects
- Container Registry images
- GitLab Pages content
CAUTION: **Warning:**
GitLab does not back up any configuration files, SSL certificates, or system files.
You are highly advised to [read about storing configuration files](#storing-configuration-files).
Use this command if you've installed GitLab with the Omnibus package: Use this command if you've installed GitLab with the Omnibus package:
``` ```sh
sudo gitlab-rake gitlab:backup:create sudo gitlab-rake gitlab:backup:create
``` ```
Use this if you've installed GitLab from source: Use this if you've installed GitLab from source:
``` ```sh
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
If you are running GitLab within a Docker container, you can run the backup from the host: If you are running GitLab within a Docker container, you can run the backup from the host:
``` ```sh
docker exec -t <container name> gitlab-rake gitlab:backup:create docker exec -t <container name> gitlab-rake gitlab:backup:create
``` ```
If you are using the gitlab-omnibus helm chart on a Kubernetes cluster, you can If you are using the gitlab-omnibus helm chart on a Kubernetes cluster, you can
run the backup task on the gitlab application pod using kubectl run the backup task on the gitlab application pod using kubectl:
``` ```sh
kubectl exec -it <gitlab-gitlab pod> gitlab-rake gitlab:backup:create kubectl exec -it <gitlab-gitlab pod> gitlab-rake gitlab:backup:create
``` ```
...@@ -110,9 +128,50 @@ Deleting tmp directories...[DONE] ...@@ -110,9 +128,50 @@ Deleting tmp directories...[DONE]
Deleting old backups... [SKIPPING] Deleting old backups... [SKIPPING]
``` ```
## Storing configuration files
A backup performed by the [raketask GitLab provides](#creating-a-backup-of-the-gitlab-system)
does **not** store your configuration files. The primary reason for this is that your
database contains encrypted information for two-factor authentication, the CI/CD
'secure variables', etc. Storing encrypted information along with its key in the
same place defeats the purpose of using encryption in the first place.
CAUTION: **Warning:**
The secrets file is essential to preserve your database encryption key.
At the very **minimum**, you must backup:
For Omnibus:
- `/etc/gitlab/gitlab-secrets.json`
- `/etc/gitlab/gitlab.rb`
For installation from source:
- `/home/git/gitlab/config/secrets.yml`
- `/home/git/gitlab/config/gitlab.yml`
For [Docker installations](https://docs.gitlab.com/omnibus/docker/), you must
back up the volume where the configuration files are stored. If you have created
the GitLab container according to the documentation, it should be under
`/srv/gitlab/config`.
You may also want to back up any TLS keys and certificates, and your
[SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079).
If you use Omnibus GitLab, see some additional information
[to backup your configuration](https://docs.gitlab.com/omnibus/settings/backups.html).
In the unlikely event that the secrets file is lost, see the
[troubleshooting section](#when-the-secrets-file-is-lost).
## Backup options
The command line tool GitLab provides to backup your instance can take more options.
### Backup strategy option ### Backup strategy option
> **Note:** Introduced as an option in GitLab 8.17. > [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8728) in GitLab 8.17.
The default backup strategy is to essentially stream data from the respective The default backup strategy is to essentially stream data from the respective
data locations to the backup using the Linux command `tar` and `gzip`. This works data locations to the backup using the Linux command `tar` and `gzip`. This works
...@@ -129,8 +188,11 @@ so the problem doesn't compound, but it could be a considerable change for large ...@@ -129,8 +188,11 @@ so the problem doesn't compound, but it could be a considerable change for large
installations. This is why the `copy` strategy is not the default in 8.17. installations. This is why the `copy` strategy is not the default in 8.17.
To use the `copy` strategy instead of the default streaming strategy, specify To use the `copy` strategy instead of the default streaming strategy, specify
`STRATEGY=copy` in the Rake task command. For example, `STRATEGY=copy` in the Rake task command. For example:
`sudo gitlab-rake gitlab:backup:create STRATEGY=copy`.
```sh
sudo gitlab-rake gitlab:backup:create STRATEGY=copy
```
### Excluding specific directories from the backup ### Excluding specific directories from the backup
...@@ -151,11 +213,15 @@ Use a comma to specify several options at the same time: ...@@ -151,11 +213,15 @@ Use a comma to specify several options at the same time:
All wikis will be backed up as part of the `repositories` group. Non-existent wikis All wikis will be backed up as part of the `repositories` group. Non-existent wikis
will be skipped during a backup. will be skipped during a backup.
``` For Omnibus GitLab packages:
# use this command if you've installed GitLab with the Omnibus package
```sh
sudo gitlab-rake gitlab:backup:create SKIP=db,uploads sudo gitlab-rake gitlab:backup:create SKIP=db,uploads
```
For installations from source:
# if you've installed GitLab from source ```sh
sudo -u git -H bundle exec rake gitlab:backup:create SKIP=db,uploads RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create SKIP=db,uploads RAILS_ENV=production
``` ```
...@@ -208,7 +274,7 @@ This example can be used for a bucket in Amsterdam (AMS3). ...@@ -208,7 +274,7 @@ This example can be used for a bucket in Amsterdam (AMS3).
1. [Reconfigure GitLab] for the changes to take effect 1. [Reconfigure GitLab] for the changes to take effect
CAUTION: **Warning:** NOTE: **Note:**
If you see `400 Bad Request` by using Digital Ocean Spaces, the cause may be the If you see `400 Bad Request` by using Digital Ocean Spaces, the cause may be the
usage of backup encryption. Remove or comment the line that usage of backup encryption. Remove or comment the line that
contains `gitlab_rails['backup_encryption']` since Digital Ocean Spaces contains `gitlab_rails['backup_encryption']` since Digital Ocean Spaces
...@@ -370,33 +436,43 @@ backups will be copied to, and will be created if it does not exist. If the ...@@ -370,33 +436,43 @@ backups will be copied to, and will be created if it does not exist. If the
directory that you want to copy the tarballs to is the root of your mounted directory that you want to copy the tarballs to is the root of your mounted
directory, just use `.` instead. directory, just use `.` instead.
For omnibus packages:
```ruby For Omnibus GitLab packages:
gitlab_rails['backup_upload_connection'] = {
:provider => 'Local',
:local_root => '/mnt/backups'
}
# The directory inside the mounted folder to copy backups to 1. Edit `/etc/gitlab/gitlab.rb`:
# Use '.' to store them in the root directory
gitlab_rails['backup_upload_remote_directory'] = 'gitlab_backups' ```ruby
``` gitlab_rails['backup_upload_connection'] = {
:provider => 'Local',
:local_root => '/mnt/backups'
}
# The directory inside the mounted folder to copy backups to
# Use '.' to store them in the root directory
gitlab_rails['backup_upload_remote_directory'] = 'gitlab_backups'
```
1. [Reconfigure GitLab] for the changes to take effect.
---
For installations from source: For installations from source:
```yaml 1. Edit `home/git/gitlab/config/gitlab.yml`:
backup:
# snip ```yaml
upload: backup:
# Fog storage connection settings, see http://fog.io/storage/ . upload:
connection: # Fog storage connection settings, see http://fog.io/storage/ .
provider: Local connection:
local_root: '/mnt/backups' provider: Local
# The directory inside the mounted folder to copy backups to local_root: '/mnt/backups'
# Use '.' to store them in the root directory # The directory inside the mounted folder to copy backups to
remote_directory: 'gitlab_backups' # Use '.' to store them in the root directory
``` remote_directory: 'gitlab_backups'
```
1. [Restart GitLab] for the changes to take effect.
### Backup archive permissions ### Backup archive permissions
...@@ -405,45 +481,56 @@ will have owner/group git:git and 0600 permissions by default. ...@@ -405,45 +481,56 @@ will have owner/group git:git and 0600 permissions by default.
This is meant to avoid other system users reading GitLab's data. This is meant to avoid other system users reading GitLab's data.
If you need the backup archives to have different permissions you can use the 'archive_permissions' setting. If you need the backup archives to have different permissions you can use the 'archive_permissions' setting.
``` For Omnibus GitLab packages:
# In /etc/gitlab/gitlab.rb, for omnibus packages
gitlab_rails['backup_archive_permissions'] = 0644 # Makes the backup archives world-readable
```
``` 1. Edit `/etc/gitlab/gitlab.rb`:
# In gitlab.yml, for installations from source:
backup:
archive_permissions: 0644 # Makes the backup archives world-readable
```
### Storing configuration files ```ruby
gitlab_rails['backup_archive_permissions'] = 0644 # Makes the backup archives world-readable
```
1. [Reconfigure GitLab] for the changes to take effect.
---
For installations from source:
Please be informed that a backup does not store your configuration 1. Edit `/home/git/gitlab/config/gitlab.yml`:
files. One reason for this is that your database contains encrypted
information for two-factor authentication. Storing encrypted
information along with its key in the same place defeats the purpose
of using encryption in the first place!
If you use an Omnibus package please see the [instructions in the readme to backup your configuration](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#backup-and-restore-omnibus-gitlab-configuration). ```yaml
If you have a cookbook installation there should be a copy of your configuration in Chef. backup:
If you installed from source, please consider backing up your `config/secrets.yml` file, `gitlab.yml` file, any SSL keys and certificates, and your [SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079). archive_permissions: 0644 # Makes the backup archives world-readable
```
At the very **minimum** you should backup `/etc/gitlab/gitlab.rb` and 1. [Restart GitLab] for the changes to take effect.
`/etc/gitlab/gitlab-secrets.json` (Omnibus), or
`/home/git/gitlab/config/secrets.yml` (source) to preserve your database
encryption key.
### Configuring cron to make daily backups ### Configuring cron to make daily backups
>**Note:** NOTE: **Note:**
The following cron jobs do not [backup your GitLab configuration files](#storing-configuration-files) The following cron jobs do not [backup your GitLab configuration files](#storing-configuration-files)
or [SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079). or [SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079).
**For Omnibus installations** For Omnibus GitLab packages:
1. Edit `/etc/gitlab/gitlab.rb`:
```ruby
## Limit backup lifetime to 7 days - 604800 seconds
gitlab_rails['backup_keep_time'] = 604800
```
1. [Reconfigure GitLab] for the changes to take effect.
Note that the `backup_keep_time` configuration option only manages local
files. GitLab does not automatically prune old files stored in a third-party
object storage (e.g., AWS S3) because the user may not have permission to list
and delete files. We recommend that you configure the appropriate retention
policy for your object storage. For example, you can configure [the S3 backup
policy as described here](http://stackoverflow.com/questions/37553070/gitlab-omnibus-delete-backup-from-amazon-s3).
To schedule a cron job that backs up your repositories and GitLab metadata, use the root user: To schedule a cron job that backs up your repositories and GitLab metadata, use the root user:
``` ```sh
sudo su - sudo su -
crontab -e crontab -e
``` ```
...@@ -455,26 +542,24 @@ There, add the following line to schedule the backup for everyday at 2 AM: ...@@ -455,26 +542,24 @@ There, add the following line to schedule the backup for everyday at 2 AM:
``` ```
You may also want to set a limited lifetime for backups to prevent regular You may also want to set a limited lifetime for backups to prevent regular
backups using all your disk space. To do this add the following lines to backups using all your disk space.
`/etc/gitlab/gitlab.rb` and reconfigure:
``` ---
# limit backup lifetime to 7 days - 604800 seconds
gitlab_rails['backup_keep_time'] = 604800
```
Note that the `backup_keep_time` configuration option only manages local For installations from source:
files. GitLab does not automatically prune old files stored in a third-party
object storage (e.g., AWS S3) because the user may not have permission to list 1. Edit `home/git/gitlab/config/gitlab.yml`:
and delete files. We recommend that you configure the appropriate retention
policy for your object storage. For example, you can configure [the S3 backup
policy as described here](http://stackoverflow.com/questions/37553070/gitlab-omnibus-delete-backup-from-amazon-s3).
**For installation from source** ```yaml
backup:
## Limit backup lifetime to 7 days - 604800 seconds
keep_time: 604800
```
``` 1. [Restart GitLab] for the changes to take effect.
cd /home/git/gitlab
sudo -u git -H editor config/gitlab.yml # Enable keep_time in the backup section to automatically delete old backups
```sh
sudo -u git crontab -e # Edit the crontab for the git user sudo -u git crontab -e # Edit the crontab for the git user
``` ```
...@@ -711,5 +796,53 @@ Those objects have no influence on the database backup/restore but they give thi ...@@ -711,5 +796,53 @@ Those objects have no influence on the database backup/restore but they give thi
For more information see similar questions on postgresql issue tracker[here](http://www.postgresql.org/message-id/201110220712.30886.adrian.klaver@gmail.com) and [here](http://www.postgresql.org/message-id/2039.1177339749@sss.pgh.pa.us) as well as [stack overflow](http://stackoverflow.com/questions/4368789/error-must-be-owner-of-language-plpgsql). For more information see similar questions on postgresql issue tracker[here](http://www.postgresql.org/message-id/201110220712.30886.adrian.klaver@gmail.com) and [here](http://www.postgresql.org/message-id/2039.1177339749@sss.pgh.pa.us) as well as [stack overflow](http://stackoverflow.com/questions/4368789/error-must-be-owner-of-language-plpgsql).
### When the secrets file is lost
If you have failed to [back up the secrets file](#storing-configuration-files),
then users with 2FA enabled will not be able to log into GitLab. In that case,
you need to [disable 2FA for everyone](../security/two_factor_authentication.md#disabling-2fa-for-everyone).
In the case of CI/CD, if your project has secure variables set, you might experience
some weird behavior, like stuck jobs or 500 errors. In that case, you can try
deleting the `ci_variables` table from the database.
CAUTION: **Warning:**
Use the following commands at your own risk, and make sure you've taken a
backup beforehand.
1. Enter the Rails console:
For Omnibus GitLab packages:
```sh
sudo gitlab-rails dbconsole
```
For installations from source:
```sh
sudo -u git -H bundle exec rails dbconsole RAILS_ENV=production
```
1. Check the `ci_variables` table:
```sql
SELECT * FROM public."ci_variables";
```
Those are the variables that you need to delete.
1. Drop the table:
```sql
DELETE FROM ci_variables;
```
1. You may need to reconfigure or restart GitLab for the changes to take
effect.
You should now be able to visit your project, and the jobs will start
running again.
[reconfigure GitLab]: ../administration/restart_gitlab.md#omnibus-gitlab-reconfigure [reconfigure GitLab]: ../administration/restart_gitlab.md#omnibus-gitlab-reconfigure
[restart GitLab]: ../administration/restart_gitlab.md#installations-from-source [restart GitLab]: ../administration/restart_gitlab.md#installations-from-source
...@@ -42,7 +42,11 @@ not send any project names, usernames, or any other specific data. The ...@@ -42,7 +42,11 @@ not send any project names, usernames, or any other specific data. The
information from the usage ping is not anonymous, it is linked to the hostname information from the usage ping is not anonymous, it is linked to the hostname
of the instance. of the instance.
You can view the exact JSON payload in the administration panel. You can view the exact JSON payload in the administration panel. To view the payload:
1. Go to the **Admin area** (spanner symbol on the top bar).
1. Expand **Settings** in the left sidebar and click on **Metrics and profiling**.
1. Expand **Usage statistics** and click on the **Preview payload** button.
### Deactivate the usage ping ### Deactivate the usage ping
......
...@@ -114,6 +114,14 @@ To add an existing Kubernetes cluster to your project: ...@@ -114,6 +114,14 @@ To add an existing Kubernetes cluster to your project:
After a couple of minutes, your cluster will be ready to go. You can now proceed After a couple of minutes, your cluster will be ready to go. You can now proceed
to install some [pre-defined applications](#installing-applications). to install some [pre-defined applications](#installing-applications).
To determine the:
- API URL, run `kubectl cluster-info | grep 'Kubernetes master' | awk '/http/ {print $NF}'`.
- Token:
1. List the secrets by running: `kubectl get secrets`. Note the name of the secret you need the token for.
1. Get the token for the appropriate secret by running: `kubectl get secret <SECRET_NAME> -o jsonpath="{['data']['token']}" | base64 -D`.
- CA certificate, run `kubectl get secret <secret name> -o jsonpath="{['data']['ca\.crt']}" | base64 -D`.
## Security implications ## Security implications
CAUTION: **Important:** CAUTION: **Important:**
......
...@@ -10,31 +10,32 @@ You can find notification settings under the user profile. ...@@ -10,31 +10,32 @@ You can find notification settings under the user profile.
Notification settings are divided into three groups: Notification settings are divided into three groups:
* Global Settings - Global settings
* Group Settings - Group settings
* Project Settings - Project settings
Each of these settings have levels of notification: Each of these settings have levels of notification:
* Disabled - turns off notifications - Watch: Receive notifications for any activity.
* Participating - receive notifications from related resources - On Mention: Receive notifications when `@mentioned` in comments.
* Watch - receive notifications from projects or groups user is a member of - Participate: Receive notifications for threads you have participated in.
* Global - notifications as set at the global settings - Disabled: Turns off notifications.
* Custom - user will receive notifications when mentioned, is participant and custom selected events. - Custom: Receive notifications for custom selected events.
- Global: For groups and projects, notifications as per global settings.
#### Global Settings ### Global Settings
Global Settings are at the bottom of the hierarchy. Global settings are at the bottom of the hierarchy.
Any setting set here will be overridden by a setting at the group or a project level. Any setting set here will be overridden by a setting at the group or a project level.
Group or Project settings can use `global` notification setting which will then use Group or Project settings can use `global` notification setting which will then use
anything that is set at Global Settings. anything that is set at Global Settings.
#### Group Settings ### Group Settings
![notification settings](img/notification_group_settings.png) ![notification settings](img/notification_group_settings.png)
Group Settings are taking precedence over Global Settings but are on a level below Project or Subgroup Settings: Group settings are taking precedence over Global Settings but are on a level below Project or Subgroup settings:
``` ```
Group < Subgroup < Project Group < Subgroup < Project
...@@ -46,11 +47,11 @@ Organization like this is suitable for users that belong to different groups but ...@@ -46,11 +47,11 @@ Organization like this is suitable for users that belong to different groups but
same need for being notified for every group they are member of. same need for being notified for every group they are member of.
These settings can be configured on group page under the name of the group. It will be the dropdown with the bell icon. They can also be configured on the user profile notifications dropdown. These settings can be configured on group page under the name of the group. It will be the dropdown with the bell icon. They can also be configured on the user profile notifications dropdown.
#### Project Settings ### Project Settings
![notification settings](img/notification_project_settings.png) ![notification settings](img/notification_project_settings.png)
Project Settings are at the top level and any setting placed at this level will take precedence of any Project settings are at the top level and any setting placed at this level will take precedence of any
other setting. other setting.
This is suitable for users that have different needs for notifications per project basis. This is suitable for users that have different needs for notifications per project basis.
These settings can be configured on project page under the name of the project. It will be the dropdown with the bell icon. They can also be configured on the user profile notifications dropdown. These settings can be configured on project page under the name of the project. It will be the dropdown with the bell icon. They can also be configured on the user profile notifications dropdown.
...@@ -73,11 +74,12 @@ Below is the table of events users can be notified of: ...@@ -73,11 +74,12 @@ Below is the table of events users can be notified of:
### Issue / Merge request events ### Issue / Merge request events
In most of the below cases, the notification will be sent to: In most of the below cases, the notification will be sent to:
- Participants: - Participants:
- the author and assignee of the issue/merge request - the author and assignee of the issue/merge request
- authors of comments on the issue/merge request - authors of comments on the issue/merge request
- anyone mentioned by `@username` in the issue/merge request title or description - anyone mentioned by `@username` in the issue/merge request title or description
- anyone mentioned by `@username` in any of the comments on the issue/merge request - anyone mentioned by `@username` in any of the comments on the issue/merge request
...with notification level "Participating" or higher ...with notification level "Participating" or higher
- Watchers: users with notification level "Watch" - Watchers: users with notification level "Watch"
- Subscribers: anyone who manually subscribed to the issue/merge request - Subscribers: anyone who manually subscribed to the issue/merge request
...@@ -130,16 +132,19 @@ Notification emails include headers that provide extra content about the notific ...@@ -130,16 +132,19 @@ Notification emails include headers that provide extra content about the notific
| X-GitLab-NotificationReason | The reason for being notified. "mentioned", "assigned", etc | | X-GitLab-NotificationReason | The reason for being notified. "mentioned", "assigned", etc |
#### X-GitLab-NotificationReason #### X-GitLab-NotificationReason
This header holds the reason for the notification to have been sent out, This header holds the reason for the notification to have been sent out,
where reason can be `mentioned`, `assigned`, `own_activity`, etc. where reason can be `mentioned`, `assigned`, `own_activity`, etc.
Only one reason is sent out according to its priority: Only one reason is sent out according to its priority:
- `own_activity` - `own_activity`
- `assigned` - `assigned`
- `mentioned` - `mentioned`
The reason in this header will also be shown in the footer of the notification email. For example an email with the The reason in this header will also be shown in the footer of the notification email. For example an email with the
reason `assigned` will have this sentence in the footer: reason `assigned` will have this sentence in the footer:
`"You are receiving this email because you have been assigned an item on {configured GitLab hostname}"` `"You are receiving this email because you have been assigned an item on {configured GitLab hostname}"`
**Note: Only reasons listed above have been implemented so far** NOTE: **Note:**
Further implementation is [being discussed here](https://gitlab.com/gitlab-org/gitlab-ce/issues/42062) Only reasons listed above have been implemented so far.
Further implementation is [being discussed](https://gitlab.com/gitlab-org/gitlab-ce/issues/42062).
# frozen_string_literal: true
# ANSI color library # ANSI color library
# #
# Implementation per http://en.wikipedia.org/wiki/ANSI_escape_code # Implementation per http://en.wikipedia.org/wiki/ANSI_escape_code
...@@ -265,7 +267,7 @@ module Gitlab ...@@ -265,7 +267,7 @@ module Gitlab
def reset_state def reset_state
@offset = 0 @offset = 0
@n_open_tags = 0 @n_open_tags = 0
@out = '' @out = +''
reset reset
end end
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
require 'zlib' require 'zlib'
require 'json' require 'json'
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Charts module Charts
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
# #
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Config class Config
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class CronParser class CronParser
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci::MaskSecret module Ci::MaskSecret
class << self class << self
def mask!(value, token) def mask!(value, token)
return value unless value.present? && token.present? return value unless value.present? && token.present?
# We assume 'value' must be mutable, given
# that frozen string is enabled.
value.gsub!(token, 'x' * token.length) value.gsub!(token, 'x' * token.length)
value value
end end
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Model module Model
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
module Gitlab # rubocop:disable Naming/FileName # rubocop:disable Naming/FileName
# frozen_string_literal: true
module Gitlab
module Ci module Ci
module Pipeline module Pipeline
module Chain module Chain
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Reports module Reports
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Reports module Reports
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Reports module Reports
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Reports module Reports
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
module Reports module Reports
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class Trace class Trace
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Ci module Ci
class YamlProcessor class YamlProcessor
......
...@@ -5,6 +5,7 @@ module Gitlab ...@@ -5,6 +5,7 @@ module Gitlab
class Blob class Blob
include Gitlab::BlobHelper include Gitlab::BlobHelper
include Gitlab::EncodingHelper include Gitlab::EncodingHelper
extend Gitlab::Git::WrapsGitalyErrors
# This number is the maximum amount of data that we want to display to # This number is the maximum amount of data that we want to display to
# the user. We load as much as we can for encoding detection and LFS # the user. We load as much as we can for encoding detection and LFS
...@@ -75,7 +76,7 @@ module Gitlab ...@@ -75,7 +76,7 @@ module Gitlab
# Returns array of Gitlab::Git::Blob # Returns array of Gitlab::Git::Blob
# Does not guarantee blob data will be set # Does not guarantee blob data will be set
def batch_lfs_pointers(repository, blob_ids) def batch_lfs_pointers(repository, blob_ids)
repository.wrapped_gitaly_errors do wrapped_gitaly_errors do
repository.gitaly_blob_client.batch_lfs_pointers(blob_ids.to_a) repository.gitaly_blob_client.batch_lfs_pointers(blob_ids.to_a)
end end
end end
......
...@@ -3,6 +3,7 @@ module Gitlab ...@@ -3,6 +3,7 @@ module Gitlab
module Git module Git
class Commit class Commit
include Gitlab::EncodingHelper include Gitlab::EncodingHelper
extend Gitlab::Git::WrapsGitalyErrors
attr_accessor :raw_commit, :head attr_accessor :raw_commit, :head
...@@ -59,7 +60,7 @@ module Gitlab ...@@ -59,7 +60,7 @@ module Gitlab
# This saves us an RPC round trip. # This saves us an RPC round trip.
return nil if commit_id.include?(':') return nil if commit_id.include?(':')
commit = repo.wrapped_gitaly_errors do commit = wrapped_gitaly_errors do
repo.gitaly_commit_client.find_commit(commit_id) repo.gitaly_commit_client.find_commit(commit_id)
end end
...@@ -100,7 +101,7 @@ module Gitlab ...@@ -100,7 +101,7 @@ module Gitlab
# Commit.between(repo, '29eda46b', 'master') # Commit.between(repo, '29eda46b', 'master')
# #
def between(repo, base, head) def between(repo, base, head)
repo.wrapped_gitaly_errors do wrapped_gitaly_errors do
repo.gitaly_commit_client.between(base, head) repo.gitaly_commit_client.between(base, head)
end end
end end
...@@ -125,7 +126,7 @@ module Gitlab ...@@ -125,7 +126,7 @@ module Gitlab
# are documented here: # are documented here:
# http://www.rubydoc.info/github/libgit2/rugged/Rugged#SORT_NONE-constant) # http://www.rubydoc.info/github/libgit2/rugged/Rugged#SORT_NONE-constant)
def find_all(repo, options = {}) def find_all(repo, options = {})
repo.wrapped_gitaly_errors do wrapped_gitaly_errors do
Gitlab::GitalyClient::CommitService.new(repo).find_all_commits(options) Gitlab::GitalyClient::CommitService.new(repo).find_all_commits(options)
end end
end end
...@@ -142,7 +143,7 @@ module Gitlab ...@@ -142,7 +143,7 @@ module Gitlab
# relation to each other. The last 10 commits for a branch for example, # relation to each other. The last 10 commits for a branch for example,
# should go through .where # should go through .where
def batch_by_oid(repo, oids) def batch_by_oid(repo, oids)
repo.wrapped_gitaly_errors do wrapped_gitaly_errors do
repo.gitaly_commit_client.list_commits_by_oid(oids) repo.gitaly_commit_client.list_commits_by_oid(oids)
end end
end end
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
module Gitlab module Gitlab
module Git module Git
class CommitStats class CommitStats
include Gitlab::Git::WrapsGitalyErrors
attr_reader :id, :additions, :deletions, :total attr_reader :id, :additions, :deletions, :total
# Instantiate a CommitStats object # Instantiate a CommitStats object
...@@ -14,7 +16,7 @@ module Gitlab ...@@ -14,7 +16,7 @@ module Gitlab
@deletions = 0 @deletions = 0
@total = 0 @total = 0
repo.wrapped_gitaly_errors do wrapped_gitaly_errors do
gitaly_stats(repo, commit) gitaly_stats(repo, commit)
end end
end end
......
...@@ -2,6 +2,8 @@ module Gitlab ...@@ -2,6 +2,8 @@ module Gitlab
module Git module Git
module Conflict module Conflict
class Resolver class Resolver
include Gitlab::Git::WrapsGitalyErrors
ConflictSideMissing = Class.new(StandardError) ConflictSideMissing = Class.new(StandardError)
ResolutionError = Class.new(StandardError) ResolutionError = Class.new(StandardError)
...@@ -12,7 +14,7 @@ module Gitlab ...@@ -12,7 +14,7 @@ module Gitlab
end end
def conflicts def conflicts
@conflicts ||= @target_repository.wrapped_gitaly_errors do @conflicts ||= wrapped_gitaly_errors do
gitaly_conflicts_client(@target_repository).list_conflict_files.to_a gitaly_conflicts_client(@target_repository).list_conflict_files.to_a
end end
rescue GRPC::FailedPrecondition => e rescue GRPC::FailedPrecondition => e
...@@ -22,7 +24,7 @@ module Gitlab ...@@ -22,7 +24,7 @@ module Gitlab
end end
def resolve_conflicts(source_repository, resolution, source_branch:, target_branch:) def resolve_conflicts(source_repository, resolution, source_branch:, target_branch:)
source_repository.wrapped_gitaly_errors do wrapped_gitaly_errors do
gitaly_conflicts_client(source_repository).resolve_conflicts(@target_repository, resolution, source_branch, target_branch) gitaly_conflicts_client(source_repository).resolve_conflicts(@target_repository, resolution, source_branch, target_branch)
end end
end end
......
module Gitlab module Gitlab
module Git module Git
class RemoteMirror class RemoteMirror
include Gitlab::Git::WrapsGitalyErrors
def initialize(repository, ref_name) def initialize(repository, ref_name)
@repository = repository @repository = repository
@ref_name = ref_name @ref_name = ref_name
end end
def update(only_branches_matching: []) def update(only_branches_matching: [])
@repository.wrapped_gitaly_errors do wrapped_gitaly_errors do
@repository.gitaly_remote_client.update_remote_mirror(@ref_name, only_branches_matching) @repository.gitaly_remote_client.update_remote_mirror(@ref_name, only_branches_matching)
end end
end end
......
...@@ -6,6 +6,7 @@ module Gitlab ...@@ -6,6 +6,7 @@ module Gitlab
module Git module Git
class Repository class Repository
include Gitlab::Git::RepositoryMirroring include Gitlab::Git::RepositoryMirroring
include Gitlab::Git::WrapsGitalyErrors
include Gitlab::EncodingHelper include Gitlab::EncodingHelper
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
...@@ -845,23 +846,9 @@ module Gitlab ...@@ -845,23 +846,9 @@ module Gitlab
end end
def gitaly_migrate(method, status: Gitlab::GitalyClient::MigrationStatus::OPT_IN, &block) def gitaly_migrate(method, status: Gitlab::GitalyClient::MigrationStatus::OPT_IN, &block)
Gitlab::GitalyClient.migrate(method, status: status, &block) wrapped_gitaly_errors do
rescue GRPC::NotFound => e Gitlab::GitalyClient.migrate(method, status: status, &block)
raise NoRepository.new(e) end
rescue GRPC::InvalidArgument => e
raise ArgumentError.new(e)
rescue GRPC::BadStatus => e
raise CommandError.new(e)
end
def wrapped_gitaly_errors(&block)
yield block
rescue GRPC::NotFound => e
raise NoRepository.new(e)
rescue GRPC::InvalidArgument => e
raise ArgumentError.new(e)
rescue GRPC::BadStatus => e
raise CommandError.new(e)
end end
def clean_stale_repository_files def clean_stale_repository_files
......
...@@ -2,6 +2,7 @@ module Gitlab ...@@ -2,6 +2,7 @@ module Gitlab
module Git module Git
class Tree class Tree
include Gitlab::EncodingHelper include Gitlab::EncodingHelper
extend Gitlab::Git::WrapsGitalyErrors
attr_accessor :id, :root_id, :name, :path, :flat_path, :type, attr_accessor :id, :root_id, :name, :path, :flat_path, :type,
:mode, :commit_id, :submodule_url :mode, :commit_id, :submodule_url
...@@ -15,7 +16,7 @@ module Gitlab ...@@ -15,7 +16,7 @@ module Gitlab
def where(repository, sha, path = nil, recursive = false) def where(repository, sha, path = nil, recursive = false)
path = nil if path == '' || path == '/' path = nil if path == '' || path == '/'
repository.wrapped_gitaly_errors do wrapped_gitaly_errors do
repository.gitaly_commit_client.tree_entries(repository, sha, path, recursive) repository.gitaly_commit_client.tree_entries(repository, sha, path, recursive)
end end
end end
......
module Gitlab module Gitlab
module Git module Git
class Wiki class Wiki
include Gitlab::Git::WrapsGitalyErrors
DuplicatePageError = Class.new(StandardError) DuplicatePageError = Class.new(StandardError)
OperationError = Class.new(StandardError) OperationError = Class.new(StandardError)
...@@ -65,37 +67,37 @@ module Gitlab ...@@ -65,37 +67,37 @@ module Gitlab
end end
def write_page(name, format, content, commit_details) def write_page(name, format, content, commit_details)
@repository.wrapped_gitaly_errors do wrapped_gitaly_errors do
gitaly_write_page(name, format, content, commit_details) gitaly_write_page(name, format, content, commit_details)
end end
end end
def delete_page(page_path, commit_details) def delete_page(page_path, commit_details)
@repository.wrapped_gitaly_errors do wrapped_gitaly_errors do
gitaly_delete_page(page_path, commit_details) gitaly_delete_page(page_path, commit_details)
end end
end end
def update_page(page_path, title, format, content, commit_details) def update_page(page_path, title, format, content, commit_details)
@repository.wrapped_gitaly_errors do wrapped_gitaly_errors do
gitaly_update_page(page_path, title, format, content, commit_details) gitaly_update_page(page_path, title, format, content, commit_details)
end end
end end
def pages(limit: 0) def pages(limit: 0)
@repository.wrapped_gitaly_errors do wrapped_gitaly_errors do
gitaly_get_all_pages(limit: limit) gitaly_get_all_pages(limit: limit)
end end
end end
def page(title:, version: nil, dir: nil) def page(title:, version: nil, dir: nil)
@repository.wrapped_gitaly_errors do wrapped_gitaly_errors do
gitaly_find_page(title: title, version: version, dir: dir) gitaly_find_page(title: title, version: version, dir: dir)
end end
end end
def file(name, version) def file(name, version)
@repository.wrapped_gitaly_errors do wrapped_gitaly_errors do
gitaly_find_file(name, version) gitaly_find_file(name, version)
end end
end end
...@@ -105,7 +107,7 @@ module Gitlab ...@@ -105,7 +107,7 @@ module Gitlab
# :per_page - The number of items per page. # :per_page - The number of items per page.
# :limit - Total number of items to return. # :limit - Total number of items to return.
def page_versions(page_path, options = {}) def page_versions(page_path, options = {})
versions = @repository.wrapped_gitaly_errors do versions = wrapped_gitaly_errors do
gitaly_wiki_client.page_versions(page_path, options) gitaly_wiki_client.page_versions(page_path, options)
end end
...@@ -127,7 +129,7 @@ module Gitlab ...@@ -127,7 +129,7 @@ module Gitlab
def page_formatted_data(title:, dir: nil, version: nil) def page_formatted_data(title:, dir: nil, version: nil)
version = version&.id version = version&.id
@repository.wrapped_gitaly_errors do wrapped_gitaly_errors do
gitaly_wiki_client.get_formatted_data(title: title, dir: dir, version: version) gitaly_wiki_client.get_formatted_data(title: title, dir: dir, version: version)
end end
end end
......
module Gitlab
module Git
module WrapsGitalyErrors
def wrapped_gitaly_errors(&block)
yield block
rescue GRPC::NotFound => e
raise Gitlab::Git::Repository::NoRepository.new(e)
rescue GRPC::InvalidArgument => e
raise ArgumentError.new(e)
rescue GRPC::BadStatus => e
raise Gitlab::Git::CommandError.new(e)
end
end
end
end
...@@ -3921,12 +3921,19 @@ msgstr "" ...@@ -3921,12 +3921,19 @@ msgstr ""
msgid "Group Runners" msgid "Group Runners"
msgstr "" msgstr ""
<<<<<<< HEAD
msgid "Group SAML must be enabled to test" msgid "Group SAML must be enabled to test"
=======
msgid "Group URL"
>>>>>>> upstream/master
msgstr "" msgstr ""
msgid "Group avatar" msgid "Group avatar"
msgstr "" msgstr ""
msgid "Group description"
msgstr ""
msgid "Group description (optional)" msgid "Group description (optional)"
msgstr "" msgstr ""
...@@ -5778,15 +5785,24 @@ msgstr "" ...@@ -5778,15 +5785,24 @@ msgstr ""
msgid "Pipelines|This project is not currently set up to run pipelines." msgid "Pipelines|This project is not currently set up to run pipelines."
msgstr "" msgstr ""
msgid "Pipeline|Commit"
msgstr ""
msgid "Pipeline|Create for" msgid "Pipeline|Create for"
msgstr "" msgstr ""
msgid "Pipeline|Create pipeline" msgid "Pipeline|Create pipeline"
msgstr "" msgstr ""
msgid "Pipeline|Duration"
msgstr ""
msgid "Pipeline|Existing branch name or tag" msgid "Pipeline|Existing branch name or tag"
msgstr "" msgstr ""
msgid "Pipeline|Pipeline"
msgstr ""
msgid "Pipeline|Run Pipeline" msgid "Pipeline|Run Pipeline"
msgstr "" msgstr ""
...@@ -5796,6 +5812,12 @@ msgstr "" ...@@ -5796,6 +5812,12 @@ msgstr ""
msgid "Pipeline|Specify variable values to be used in this run. The values specified in %{settings_link} will be used by default." msgid "Pipeline|Specify variable values to be used in this run. The values specified in %{settings_link} will be used by default."
msgstr "" msgstr ""
msgid "Pipeline|Stages"
msgstr ""
msgid "Pipeline|Status"
msgstr ""
msgid "Pipeline|Stop pipeline" msgid "Pipeline|Stop pipeline"
msgstr "" msgstr ""
...@@ -5832,12 +5854,18 @@ msgstr "" ...@@ -5832,12 +5854,18 @@ msgstr ""
msgid "Please accept the Terms of Service before continuing." msgid "Please accept the Terms of Service before continuing."
msgstr "" msgstr ""
msgid "Please choose a group URL with no special characters."
msgstr ""
msgid "Please convert them to %{link_to_git}, and go through the %{link_to_import_flow} again." msgid "Please convert them to %{link_to_git}, and go through the %{link_to_import_flow} again."
msgstr "" msgstr ""
msgid "Please convert them to Git on Google Code, and go through the %{link_to_import_flow} again." msgid "Please convert them to Git on Google Code, and go through the %{link_to_import_flow} again."
msgstr "" msgstr ""
msgid "Please fill in a descriptive name for your group."
msgstr ""
msgid "Please note that this application is not provided by GitLab and you should verify its authenticity before allowing access." msgid "Please note that this application is not provided by GitLab and you should verify its authenticity before allowing access."
msgstr "" msgstr ""
...@@ -6237,6 +6265,9 @@ msgstr "" ...@@ -6237,6 +6265,9 @@ msgstr ""
msgid "Projects shared with %{group_name}" msgid "Projects shared with %{group_name}"
msgstr "" msgstr ""
msgid "Projects that belong to a group are prefixed with the group namespace. Existing projects may be moved into a group."
msgstr ""
msgid "ProjectsDropdown|Frequently visited" msgid "ProjectsDropdown|Frequently visited"
msgstr "" msgstr ""
...@@ -8598,6 +8629,9 @@ msgstr "" ...@@ -8598,6 +8629,9 @@ msgstr ""
msgid "View replaced file @ " msgid "View replaced file @ "
msgstr "" msgstr ""
msgid "View the documentation"
msgstr ""
msgid "Visibility and access controls" msgid "Visibility and access controls"
msgstr "" msgstr ""
...@@ -8664,6 +8698,9 @@ msgstr "" ...@@ -8664,6 +8698,9 @@ msgstr ""
msgid "Who can see this group?" msgid "Who can see this group?"
msgstr "" msgstr ""
msgid "Who will be able to see this group?"
msgstr ""
msgid "Wiki" msgid "Wiki"
msgstr "" msgstr ""
......
...@@ -53,13 +53,33 @@ describe 'Admin Groups' do ...@@ -53,13 +53,33 @@ describe 'Admin Groups' do
expect_selected_visibility(internal) expect_selected_visibility(internal)
end end
it 'when entered in group path, it auto filled the group name', :js do it 'when entered in group name, it auto filled the group path', :js do
visit admin_groups_path visit admin_groups_path
click_link "New group" click_link "New group"
group_path = 'gitlab' group_name = 'gitlab'
fill_in 'group_name', with: group_name
path_field = find('input#group_path')
expect(path_field.value).to eq group_name
end
it 'auto populates the group path with the group name', :js do
visit admin_groups_path
click_link "New group"
group_name = 'my gitlab project'
fill_in 'group_name', with: group_name
path_field = find('input#group_path')
expect(path_field.value).to eq 'my-gitlab-project'
end
it 'when entering in group path, group name does not change anymore', :js do
visit admin_groups_path
click_link "New group"
group_path = 'my-gitlab-project'
group_name = 'My modified gitlab project'
fill_in 'group_path', with: group_path fill_in 'group_path', with: group_path
name_field = find('input#group_name') fill_in 'group_name', with: group_name
expect(name_field.value).to eq group_path path_field = find('input#group_path')
expect(path_field.value).to eq 'my-gitlab-project'
end end
end end
......
...@@ -14,15 +14,15 @@ RSpec.describe 'Dashboard Group' do ...@@ -14,15 +14,15 @@ RSpec.describe 'Dashboard Group' do
it 'creates new group', :js do it 'creates new group', :js do
visit dashboard_groups_path visit dashboard_groups_path
find('.btn-success').click find('.btn-success').click
new_path = 'Samurai' new_name = 'Samurai'
new_description = 'Tokugawa Shogunate' new_description = 'Tokugawa Shogunate'
fill_in 'group_path', with: new_path fill_in 'group_name', with: new_name
fill_in 'group_description', with: new_description fill_in 'group_description', with: new_description
click_button 'Create group' click_button 'Create group'
expect(current_path).to eq group_path(Group.find_by(name: new_path)) expect(current_path).to eq group_path(Group.find_by(name: new_name))
expect(page).to have_content(new_path) expect(page).to have_content(new_name)
expect(page).to have_content(new_description) expect(page).to have_content(new_description)
end end
end end
...@@ -29,7 +29,7 @@ describe 'Top Plus Menu', :js do ...@@ -29,7 +29,7 @@ describe 'Top Plus Menu', :js do
click_topmenuitem("New group") click_topmenuitem("New group")
expect(page).to have_content('Group path') expect(page).to have_content('Group URL')
expect(page).to have_content('Group name') expect(page).to have_content('Group name')
end end
...@@ -79,7 +79,7 @@ describe 'Top Plus Menu', :js do ...@@ -79,7 +79,7 @@ describe 'Top Plus Menu', :js do
click_topmenuitem("New subgroup") click_topmenuitem("New subgroup")
expect(page).to have_content('Group path') expect(page).to have_content('Group URL')
expect(page).to have_content('Group name') expect(page).to have_content('Group name')
end end
......
...@@ -7,7 +7,7 @@ describe 'Group' do ...@@ -7,7 +7,7 @@ describe 'Group' do
matcher :have_namespace_error_message do matcher :have_namespace_error_message do
match do |page| match do |page|
page.has_content?("Path can contain only letters, digits, '_', '-' and '.'. Cannot start with '-' or end in '.', '.git' or '.atom'.") page.has_content?("Group URL can contain only letters, digits, '_', '-' and '.'. Cannot start with '-' or end in '.', '.git' or '.atom'.")
end end
end end
...@@ -18,7 +18,7 @@ describe 'Group' do ...@@ -18,7 +18,7 @@ describe 'Group' do
describe 'with space in group path' do describe 'with space in group path' do
it 'renders new group form with validation errors' do it 'renders new group form with validation errors' do
fill_in 'Group path', with: 'space group' fill_in 'Group URL', with: 'space group'
click_button 'Create group' click_button 'Create group'
expect(current_path).to eq(groups_path) expect(current_path).to eq(groups_path)
...@@ -28,7 +28,7 @@ describe 'Group' do ...@@ -28,7 +28,7 @@ describe 'Group' do
describe 'with .atom at end of group path' do describe 'with .atom at end of group path' do
it 'renders new group form with validation errors' do it 'renders new group form with validation errors' do
fill_in 'Group path', with: 'atom_group.atom' fill_in 'Group URL', with: 'atom_group.atom'
click_button 'Create group' click_button 'Create group'
expect(current_path).to eq(groups_path) expect(current_path).to eq(groups_path)
...@@ -38,7 +38,7 @@ describe 'Group' do ...@@ -38,7 +38,7 @@ describe 'Group' do
describe 'with .git at end of group path' do describe 'with .git at end of group path' do
it 'renders new group form with validation errors' do it 'renders new group form with validation errors' do
fill_in 'Group path', with: 'git_group.git' fill_in 'Group URL', with: 'git_group.git'
click_button 'Create group' click_button 'Create group'
expect(current_path).to eq(groups_path) expect(current_path).to eq(groups_path)
...@@ -94,7 +94,8 @@ describe 'Group' do ...@@ -94,7 +94,8 @@ describe 'Group' do
end end
it 'creates a nested group' do it 'creates a nested group' do
fill_in 'Group path', with: 'bar' fill_in 'Group name', with: 'bar'
fill_in 'Group URL', with: 'bar'
click_button 'Create group' click_button 'Create group'
expect(current_path).to eq(group_path('foo/bar')) expect(current_path).to eq(group_path('foo/bar'))
...@@ -112,7 +113,8 @@ describe 'Group' do ...@@ -112,7 +113,8 @@ describe 'Group' do
visit new_group_path(group, parent_id: group.id) visit new_group_path(group, parent_id: group.id)
fill_in 'Group path', with: 'bar' fill_in 'Group name', with: 'bar'
fill_in 'Group URL', with: 'bar'
click_button 'Create group' click_button 'Create group'
expect(current_path).to eq(group_path('foo/bar')) expect(current_path).to eq(group_path('foo/bar'))
......
...@@ -218,6 +218,7 @@ export default { ...@@ -218,6 +218,7 @@ export default {
diverged_commits_count: 0, diverged_commits_count: 0,
only_allow_merge_if_pipeline_succeeds: false, only_allow_merge_if_pipeline_succeeds: false,
commit_change_content_path: '/root/acets-app/merge_requests/22/commit_change_content', commit_change_content_path: '/root/acets-app/merge_requests/22/commit_change_content',
<<<<<<< HEAD
codeclimate: { codeclimate: {
head_path: 'head.json', head_path: 'head.json',
base_path: 'base.json', base_path: 'base.json',
...@@ -230,6 +231,9 @@ export default { ...@@ -230,6 +231,9 @@ export default {
'/help/user/project/merge_requests/index#interacting-with-security-reports-ultimate', '/help/user/project/merge_requests/index#interacting-with-security-reports-ultimate',
merge_commit_path: merge_commit_path:
'http://localhost:3000/root/acets-app/commit/53027d060246c8f47e4a9310fb332aa52f221775', 'http://localhost:3000/root/acets-app/commit/53027d060246c8f47e4a9310fb332aa52f221775',
=======
merge_commit_path: 'http://localhost:3000/root/acets-app/commit/53027d060246c8f47e4a9310fb332aa52f221775',
>>>>>>> upstream/master
troubleshooting_docs_path: 'help' troubleshooting_docs_path: 'help'
}; };
// Codeclimate // Codeclimate
......
require 'spec_helper'
describe Gitlab::Git::WrapsGitalyErrors do
subject(:wrapper) do
klazz = Class.new { include Gitlab::Git::WrapsGitalyErrors }
klazz.new
end
describe "#wrapped_gitaly_errors" do
mapping = {
GRPC::NotFound => Gitlab::Git::Repository::NoRepository,
GRPC::InvalidArgument => ArgumentError,
GRPC::BadStatus => Gitlab::Git::CommandError
}
mapping.each do |grpc_error, error|
it "wraps #{grpc_error} in a #{error}" do
expect { wrapper.wrapped_gitaly_errors { raise grpc_error.new('wrapped') } }
.to raise_error(error)
end
end
it 'does not swallow other errors' do
expect { wrapper.wrapped_gitaly_errors { raise 'raised' } }
.to raise_error(RuntimeError)
end
end
end
...@@ -177,7 +177,7 @@ describe Groups::TransferService, :postgresql do ...@@ -177,7 +177,7 @@ describe Groups::TransferService, :postgresql do
it 'should add an error on group' do it 'should add an error on group' do
transfer_service.execute(new_parent_group) transfer_service.execute(new_parent_group)
expect(transfer_service.error).to eq('Transfer failed: Validation failed: Path has already been taken') expect(transfer_service.error).to eq('Transfer failed: Validation failed: Group URL has already been taken')
end end
end end
......
...@@ -626,10 +626,10 @@ ...@@ -626,10 +626,10 @@
resolved "https://registry.yarnpkg.com/@gitlab-org/gitlab-svgs/-/gitlab-svgs-1.33.0.tgz#068566e8ee00795f6f09f58236f08e1716f9f04a" resolved "https://registry.yarnpkg.com/@gitlab-org/gitlab-svgs/-/gitlab-svgs-1.33.0.tgz#068566e8ee00795f6f09f58236f08e1716f9f04a"
integrity sha512-8ajtUHk6gQ1xosL/CO5IzHSFM/t18hx5pfzQ3cd0VuQXcyR6QKGuXTLwbYdmJDYOw1Etoo5DqDWxPEClHyZpiA== integrity sha512-8ajtUHk6gQ1xosL/CO5IzHSFM/t18hx5pfzQ3cd0VuQXcyR6QKGuXTLwbYdmJDYOw1Etoo5DqDWxPEClHyZpiA==
"@gitlab-org/gitlab-ui@^1.9.0": "@gitlab-org/gitlab-ui@^1.10.0":
version "1.9.0" version "1.10.0"
resolved "https://registry.yarnpkg.com/@gitlab-org/gitlab-ui/-/gitlab-ui-1.9.0.tgz#c47851587316f60926e8304747d1fcdd1222c779" resolved "https://registry.yarnpkg.com/@gitlab-org/gitlab-ui/-/gitlab-ui-1.10.0.tgz#3ac54ecaa25ea558324f0b382c97fcf9e3c4f0a5"
integrity sha512-OQ/mhWnbeG4pmjnCGwLsyvmHDYdLh2IRnt4Jx6G9jf96oyjEHzY1rveImfqcQ2bvx9azfuI6CU9dmDSY3aWvvQ== integrity sha512-kfoCKA+AmWZ3hf1wOS8W9mPJs/7lF+a01PK//+sw2MOLv6PlduJJmdN8drFuJ65o6cTJ1f9FMVB80R6D71XVKQ==
dependencies: dependencies:
"@gitlab-org/gitlab-svgs" "^1.23.0" "@gitlab-org/gitlab-svgs" "^1.23.0"
bootstrap-vue "^2.0.0-rc.11" bootstrap-vue "^2.0.0-rc.11"
......
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