Commit 556a026c authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-11-09

# Conflicts:
#	app/views/clusters/clusters/_sidebar.html.haml
#	lib/gitlab/background_migration/redact_links.rb
#	locale/gitlab.pot

[ci skip]
parents 7cf18825 4aa41d07
...@@ -1135,7 +1135,6 @@ review: ...@@ -1135,7 +1135,6 @@ review:
- download_gitlab_chart - download_gitlab_chart
- ensure_namespace - ensure_namespace
- install_tiller - install_tiller
- create_secret
- install_external_dns - install_external_dns
- deploy - deploy
environment: environment:
......
<script> <script>
import _ from 'underscore'; import _ from 'underscore';
import { mapActions, mapState } from 'vuex'; import { mapActions, mapState } from 'vuex';
import { GlLink, GlButton } from '@gitlab-org/gitlab-ui';
import timeagoMixin from '~/vue_shared/mixins/timeago'; import timeagoMixin from '~/vue_shared/mixins/timeago';
import { timeIntervalInWords } from '~/lib/utils/datetime_utility'; import { timeIntervalInWords } from '~/lib/utils/datetime_utility';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
...@@ -21,6 +22,8 @@ export default { ...@@ -21,6 +22,8 @@ export default {
TriggerBlock, TriggerBlock,
StagesDropdown, StagesDropdown,
JobsContainer, JobsContainer,
GlLink,
GlButton,
}, },
mixins: [timeagoMixin], mixins: [timeagoMixin],
props: { props: {
...@@ -115,7 +118,7 @@ export default { ...@@ -115,7 +118,7 @@ export default {
<strong class="inline prepend-top-8"> <strong class="inline prepend-top-8">
{{ job.name }} {{ job.name }}
</strong> </strong>
<a <gl-link
v-if="job.retry_path" v-if="job.retry_path"
:class="retryButtonClass" :class="retryButtonClass"
:href="job.retry_path" :href="job.retry_path"
...@@ -123,8 +126,8 @@ export default { ...@@ -123,8 +126,8 @@ export default {
rel="nofollow" rel="nofollow"
> >
{{ __('Retry') }} {{ __('Retry') }}
</a> </gl-link>
<a <gl-link
v-if="job.terminal_path" v-if="job.terminal_path"
:href="job.terminal_path" :href="job.terminal_path"
class="js-terminal-link pull-right btn btn-primary class="js-terminal-link pull-right btn btn-primary
...@@ -133,8 +136,8 @@ export default { ...@@ -133,8 +136,8 @@ export default {
> >
{{ __('Debug') }} {{ __('Debug') }}
<icon name="external-link" /> <icon name="external-link" />
</a> </gl-link>
<button <gl-button
:aria-label="__('Toggle Sidebar')" :aria-label="__('Toggle Sidebar')"
type="button" type="button"
class="btn btn-blank gutter-toggle class="btn btn-blank gutter-toggle
...@@ -146,20 +149,20 @@ export default { ...@@ -146,20 +149,20 @@ export default {
data-hidden="true" data-hidden="true"
class="fa fa-angle-double-right" class="fa fa-angle-double-right"
></i> ></i>
</button> </gl-button>
</div> </div>
<div <div
v-if="job.retry_path || job.new_issue_path" v-if="job.retry_path || job.new_issue_path"
class="block retry-link" class="block retry-link"
> >
<a <gl-link
v-if="job.new_issue_path" v-if="job.new_issue_path"
:href="job.new_issue_path" :href="job.new_issue_path"
class="js-new-issue btn btn-success btn-inverted" class="js-new-issue btn btn-success btn-inverted"
> >
{{ __('New issue') }} {{ __('New issue') }}
</a> </gl-link>
<a <gl-link
v-if="job.retry_path" v-if="job.retry_path"
:href="job.retry_path" :href="job.retry_path"
class="js-retry-job btn btn-inverted-secondary" class="js-retry-job btn btn-inverted-secondary"
...@@ -167,7 +170,7 @@ export default { ...@@ -167,7 +170,7 @@ export default {
rel="nofollow" rel="nofollow"
> >
{{ __('Retry') }} {{ __('Retry') }}
</a> </gl-link>
</div> </div>
<div :class="{ block : renderBlock }"> <div :class="{ block : renderBlock }">
<p <p
...@@ -177,9 +180,9 @@ export default { ...@@ -177,9 +180,9 @@ export default {
<span class="build-light-text"> <span class="build-light-text">
{{ __('Merge Request:') }} {{ __('Merge Request:') }}
</span> </span>
<a :href="job.merge_request.path"> <gl-link :href="job.merge_request.path">
!{{ job.merge_request.iid }} !{{ job.merge_request.iid }}
</a> </gl-link>
</p> </p>
<detail-row <detail-row
...@@ -244,14 +247,14 @@ export default { ...@@ -244,14 +247,14 @@ export default {
v-if="job.cancel_path" v-if="job.cancel_path"
class="btn-group prepend-top-5" class="btn-group prepend-top-5"
role="group"> role="group">
<a <gl-link
:href="job.cancel_path" :href="job.cancel_path"
class="js-cancel-job btn btn-sm btn-default" class="js-cancel-job btn btn-sm btn-default"
data-method="post" data-method="post"
rel="nofollow" rel="nofollow"
> >
{{ __('Cancel') }} {{ __('Cancel') }}
</a> </gl-link>
</div> </div>
</div> </div>
......
<script> <script>
import { GlButton } from '@gitlab-org/gitlab-ui';
export default { export default {
components: {
GlButton,
},
props: { props: {
trigger: { trigger: {
type: Object, type: Object,
...@@ -41,15 +46,14 @@ export default { ...@@ -41,15 +46,14 @@ export default {
</p> </p>
<p v-if="hasVariables"> <p v-if="hasVariables">
<button <gl-button
v-if="!areVariablesVisible" v-if="!areVariablesVisible"
type="button" type="button"
class="btn btn-default group js-reveal-variables" class="btn btn-default group js-reveal-variables"
@click="revealVariables" @click="revealVariables"
> >
{{ __('Reveal Variables') }} {{ __('Reveal Variables') }}
</button> </gl-button>
</p> </p>
<dl <dl
......
...@@ -448,7 +448,7 @@ Please check your network connection and try again.`; ...@@ -448,7 +448,7 @@ Please check your network connection and try again.`;
<div class="discussion-with-resolve-btn"> <div class="discussion-with-resolve-btn">
<button <button
type="button" type="button"
class="js-vue-discussion-reply btn btn-text-field mr-2 qa-discussion-reply" class="js-vue-discussion-reply btn btn-text-field mr-sm-2 qa-discussion-reply"
title="Add a reply" title="Add a reply"
@click="showReplyForm" @click="showReplyForm"
> >
...@@ -457,7 +457,7 @@ Please check your network connection and try again.`; ...@@ -457,7 +457,7 @@ Please check your network connection and try again.`;
<div v-if="discussion.resolvable"> <div v-if="discussion.resolvable">
<button <button
type="button" type="button"
class="btn btn-default mx-sm-2" class="btn btn-default mr-sm-2"
@click="resolveHandler()" @click="resolveHandler()"
> >
<i <i
...@@ -470,7 +470,7 @@ Please check your network connection and try again.`; ...@@ -470,7 +470,7 @@ Please check your network connection and try again.`;
</div> </div>
<div <div
v-if="discussion.resolvable" v-if="discussion.resolvable"
class="btn-group discussion-actions" class="btn-group discussion-actions ml-sm-2"
role="group" role="group"
> >
<div <div
......
<script> <script>
import { GlButton } from '@gitlab-org/gitlab-ui';
export default { export default {
name: 'PipelinesEmptyState', name: 'PipelinesEmptyState',
components: {
GlButton,
},
props: { props: {
helpPagePath: { helpPagePath: {
type: String, type: String,
...@@ -41,12 +46,13 @@ export default { ...@@ -41,12 +46,13 @@ export default {
</p> </p>
<div class="text-center"> <div class="text-center">
<a <gl-button
:href="helpPagePath" :href="helpPagePath"
class="btn btn-primary js-get-started-pipelines" variant="primary"
class="js-get-started-pipelines"
> >
{{ s__('Pipelines|Get started with Pipelines') }} {{ s__('Pipelines|Get started with Pipelines') }}
</a> </gl-button>
</div> </div>
</template> </template>
......
<script> <script>
import { GlLink, GlButton } from '@gitlab-org/gitlab-ui';
import LoadingButton from '../../vue_shared/components/loading_button.vue'; import LoadingButton from '../../vue_shared/components/loading_button.vue';
export default { export default {
name: 'PipelineNavControls', name: 'PipelineNavControls',
components: { components: {
LoadingButton, LoadingButton,
GlLink,
GlButton,
}, },
props: { props: {
newPipelinePath: { newPipelinePath: {
...@@ -40,28 +43,29 @@ export default { ...@@ -40,28 +43,29 @@ export default {
</script> </script>
<template> <template>
<div class="nav-controls"> <div class="nav-controls">
<a <gl-button
v-if="newPipelinePath" v-if="newPipelinePath"
:href="newPipelinePath" :href="newPipelinePath"
class="btn btn-success js-run-pipeline" variant="success"
class="js-run-pipeline"
> >
{{ s__('Pipelines|Run Pipeline') }} {{ s__('Pipelines|Run Pipeline') }}
</a> </gl-button>
<loading-button <loading-button
v-if="resetCachePath" v-if="resetCachePath"
:loading="isResetCacheButtonLoading" :loading="isResetCacheButtonLoading"
:label="s__('Pipelines|Clear Runner Caches')" :label="s__('Pipelines|Clear Runner Caches')"
class="btn btn-default js-clear-cache" class="js-clear-cache"
@click="onClickResetCache" @click="onClickResetCache"
/> />
<a <gl-button
v-if="ciLintPath" v-if="ciLintPath"
:href="ciLintPath" :href="ciLintPath"
class="btn btn-default js-ci-lint" class="js-ci-lint"
> >
{{ s__('Pipelines|CI Lint') }} {{ s__('Pipelines|CI Lint') }}
</a> </gl-button>
</div> </div>
</template> </template>
<script> <script>
import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue'; import { GlLink, GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import tooltip from '../../vue_shared/directives/tooltip'; import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import popover from '../../vue_shared/directives/popover'; import popover from '~/vue_shared/directives/popover';
export default { export default {
components: { components: {
userAvatarLink, UserAvatarLink,
GlLink,
}, },
directives: { directives: {
tooltip, GlTooltip: GlTooltipDirective,
popover, popover,
}, },
props: { props: {
...@@ -47,11 +48,12 @@ export default { ...@@ -47,11 +48,12 @@ export default {
</script> </script>
<template> <template>
<div class="table-section section-15 d-none d-sm-none d-md-block pipeline-tags"> <div class="table-section section-15 d-none d-sm-none d-md-block pipeline-tags">
<a <gl-link
:href="pipeline.path" :href="pipeline.path"
class="js-pipeline-url-link"> class="js-pipeline-url-link"
>
<span class="pipeline-id">#{{ pipeline.id }}</span> <span class="pipeline-id">#{{ pipeline.id }}</span>
</a> </gl-link>
<span>by</span> <span>by</span>
<user-avatar-link <user-avatar-link
v-if="user" v-if="user"
...@@ -68,36 +70,41 @@ export default { ...@@ -68,36 +70,41 @@ export default {
<div class="label-container"> <div class="label-container">
<span <span
v-if="pipeline.flags.latest" v-if="pipeline.flags.latest"
v-tooltip v-gl-tooltip
class="js-pipeline-url-latest badge badge-success" class="js-pipeline-url-latest badge badge-success"
title="Latest pipeline for this branch"> title="Latest pipeline for this branch"
>
latest latest
</span> </span>
<span <span
v-if="pipeline.flags.yaml_errors" v-if="pipeline.flags.yaml_errors"
v-tooltip v-gl-tooltip
:title="pipeline.yaml_errors" :title="pipeline.yaml_errors"
class="js-pipeline-url-yaml badge badge-danger"> class="js-pipeline-url-yaml badge badge-danger"
>
yaml invalid yaml invalid
</span> </span>
<span <span
v-if="pipeline.flags.failure_reason" v-if="pipeline.flags.failure_reason"
v-tooltip v-gl-tooltip
:title="pipeline.failure_reason" :title="pipeline.failure_reason"
class="js-pipeline-url-failure badge badge-danger"> class="js-pipeline-url-failure badge badge-danger"
>
error error
</span> </span>
<a <gl-link
v-if="pipeline.flags.auto_devops" v-if="pipeline.flags.auto_devops"
v-popover="popoverOptions" v-popover="popoverOptions"
tabindex="0" tabindex="0"
class="js-pipeline-url-autodevops badge badge-info autodevops-badge" class="js-pipeline-url-autodevops badge badge-info autodevops-badge"
role="button"> role="button"
>
Auto DevOps Auto DevOps
</a> </gl-link>
<span <span
v-if="pipeline.flags.stuck" v-if="pipeline.flags.stuck"
class="js-pipeline-url-stuck badge badge-warning"> class="js-pipeline-url-stuck badge badge-warning"
>
stuck stuck
</span> </span>
</div> </div>
......
<script> <script>
import { GlButton, GlTooltipDirective, GlLoadingIcon } from '@gitlab-org/gitlab-ui';
import { s__, sprintf } from '~/locale'; import { s__, sprintf } from '~/locale';
import GlCountdown from '~/vue_shared/components/gl_countdown.vue';
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 GlCountdown from '~/vue_shared/components/gl_countdown.vue';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui';
export default { export default {
directives: { directives: {
tooltip, GlTooltip: GlTooltipDirective,
}, },
components: { components: {
Icon, Icon,
GlCountdown, GlCountdown,
GlButton,
GlLoadingIcon, GlLoadingIcon,
}, },
props: { props: {
...@@ -59,14 +59,12 @@ export default { ...@@ -59,14 +59,12 @@ export default {
</script> </script>
<template> <template>
<div class="btn-group"> <div class="btn-group">
<button <gl-button
v-tooltip v-gl-tooltip
:disabled="isLoading" :disabled="isLoading"
type="button"
class="dropdown-new btn btn-default js-pipeline-dropdown-manual-actions" class="dropdown-new btn btn-default js-pipeline-dropdown-manual-actions"
title="Manual job" title="Manual job"
data-toggle="dropdown" data-toggle="dropdown"
data-placement="top"
aria-label="Manual job" aria-label="Manual job"
> >
<icon <icon
...@@ -78,17 +76,16 @@ export default { ...@@ -78,17 +76,16 @@ export default {
aria-hidden="true"> aria-hidden="true">
</i> </i>
<gl-loading-icon v-if="isLoading" /> <gl-loading-icon v-if="isLoading" />
</button> </gl-button>
<ul class="dropdown-menu dropdown-menu-right"> <ul class="dropdown-menu dropdown-menu-right">
<li <li
v-for="action in actions" v-for="action in actions"
:key="action.path" :key="action.path"
> >
<button <gl-button
:class="{ disabled: isActionDisabled(action) }" :class="{ disabled: isActionDisabled(action) }"
:disabled="isActionDisabled(action)" :disabled="isActionDisabled(action)"
type="button"
class="js-pipeline-action-link no-btn btn" class="js-pipeline-action-link no-btn btn"
@click="onClickAction(action)" @click="onClickAction(action)"
> >
...@@ -100,7 +97,7 @@ export default { ...@@ -100,7 +97,7 @@ export default {
<icon name="clock" /> <icon name="clock" />
<gl-countdown :end-date-string="action.scheduled_at" /> <gl-countdown :end-date-string="action.scheduled_at" />
</span> </span>
</button> </gl-button>
</li> </li>
</ul> </ul>
</div> </div>
......
<script> <script>
import tooltip from '../../vue_shared/directives/tooltip'; import { GlLink, GlButton, GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import Icon from '../../vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
export default { export default {
directives: { directives: {
tooltip, GlTooltip: GlTooltipDirective,
}, },
components: { components: {
Icon, Icon,
GlLink,
GlButton,
}, },
props: { props: {
artifacts: { artifacts: {
...@@ -22,11 +24,10 @@ export default { ...@@ -22,11 +24,10 @@ export default {
class="btn-group" class="btn-group"
role="group" role="group"
> >
<button <gl-button
v-tooltip v-gl-tooltip
class="dropdown-toggle btn btn-default build-artifacts js-pipeline-dropdown-download" class="dropdown-toggle build-artifacts js-pipeline-dropdown-download"
title="Artifacts" title="Artifacts"
data-placement="top"
data-toggle="dropdown" data-toggle="dropdown"
aria-label="Artifacts" aria-label="Artifacts"
> >
...@@ -36,18 +37,19 @@ export default { ...@@ -36,18 +37,19 @@ export default {
aria-hidden="true" aria-hidden="true"
> >
</i> </i>
</button> </gl-button>
<ul class="dropdown-menu dropdown-menu-right"> <ul class="dropdown-menu dropdown-menu-right">
<li <li
v-for="(artifact, i) in artifacts" v-for="(artifact, i) in artifacts"
:key="i"> :key="i"
<a >
<gl-link
:href="artifact.path" :href="artifact.path"
rel="nofollow" rel="nofollow"
download download
> >
Download {{ artifact.name }} artifacts Download {{ artifact.name }} artifacts
</a> </gl-link>
</li> </li>
</ul> </ul>
</div> </div>
......
...@@ -12,20 +12,18 @@ ...@@ -12,20 +12,18 @@
* css-class="btn-transparent" * css-class="btn-transparent"
* /> * />
*/ */
import tooltip from '../directives/tooltip'; import { GlButton, GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import Icon from '../components/icon.vue'; import Icon from '../components/icon.vue';
export default { export default {
name: 'ClipboardButton', name: 'ClipboardButton',
directives: { directives: {
tooltip, GlTooltip: GlTooltipDirective,
}, },
components: { components: {
GlButton,
Icon, Icon,
}, },
props: { props: {
text: { text: {
type: String, type: String,
...@@ -68,16 +66,12 @@ export default { ...@@ -68,16 +66,12 @@ export default {
</script> </script>
<template> <template>
<button <gl-button
v-tooltip v-gl-tooltip="{ placement: tooltipPlacement, container: tooltipContainer }"
:class="cssClass" :class="cssClass"
:title="title" :title="title"
:data-clipboard-text="clipboardText" :data-clipboard-text="clipboardText"
:data-container="tooltipContainer"
:data-placement="tooltipPlacement"
type="button"
class="btn"
> >
<icon name="duplicate" /> <icon name="duplicate" />
</button> </gl-button>
</template> </template>
...@@ -595,7 +595,6 @@ $note-form-margin-left: 70px; ...@@ -595,7 +595,6 @@ $note-form-margin-left: 70px;
.discussion-actions { .discussion-actions {
float: right; float: right;
margin-left: 10px;
color: $gray-darkest; color: $gray-darkest;
@include media-breakpoint-down(xs) { @include media-breakpoint-down(xs) {
......
.pages-domain-list { .pages-domain-list {
&-item { &-item {
position: relative;
display: flex;
align-items: center; align-items: center;
.domain-status { .domain-status {
...@@ -44,8 +42,9 @@ ...@@ -44,8 +42,9 @@
} }
:first-child { :first-child {
border-bottom-left-radius: $border-radius-default; border-bottom-right-radius: 0;
border-top-left-radius: $border-radius-default; border-top-right-radius: 0;
line-height: $gl-line-height;
} }
:not(:first-child) { :not(:first-child) {
......
...@@ -44,7 +44,7 @@ module Clusters ...@@ -44,7 +44,7 @@ module Clusters
private private
def install_script def install_script
["/usr/bin/kubectl apply -f #{ISTIO_CRDS} >/dev/null"] ["/usr/bin/kubectl apply -f #{ISTIO_CRDS}"]
end end
end end
end end
......
...@@ -24,8 +24,12 @@ module Commits ...@@ -24,8 +24,12 @@ module Commits
start_project: @start_project, start_project: @start_project,
start_branch_name: @start_branch) start_branch_name: @start_branch)
rescue Gitlab::Git::Repository::CreateTreeError rescue Gitlab::Git::Repository::CreateTreeError
error_msg = "Sorry, we cannot #{action.to_s.dasherize} this #{@commit.change_type_title(current_user)} automatically. act = action.to_s.dasherize
This #{@commit.change_type_title(current_user)} may already have been #{action.to_s.dasherize}ed, or a more recent commit may have updated some of its content." type = @commit.change_type_title(current_user)
error_msg = "Sorry, we cannot #{act} this #{type} automatically. " \
"This #{type} may already have been #{act}ed, or a more recent " \
"commit may have updated some of its content."
raise ChangeError, error_msg raise ChangeError, error_msg
end end
end end
......
<<<<<<< HEAD
- autodevops_help_url = help_page_path('topics/autodevops/index.md', anchor: 'using-multiple-kubernetes-clusters-premium') - autodevops_help_url = help_page_path('topics/autodevops/index.md', anchor: 'using-multiple-kubernetes-clusters-premium')
- help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe - help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe
- help_link_end = '</a>'.html_safe - help_link_end = '</a>'.html_safe
=======
>>>>>>> upstream/master
%h4.prepend-top-0 %h4.prepend-top-0
= s_('ClusterIntegration|Add a Kubernetes cluster integration') = s_('ClusterIntegration|Add a Kubernetes cluster integration')
%p %p
= clusterable.sidebar_text = clusterable.sidebar_text
%p %p
= clusterable.learn_more_link = clusterable.learn_more_link
<<<<<<< HEAD
%p %p
= s_('ClusterIntegration|If you are setting up multiple clusters and are using Auto DevOps, %{help_link_start}read this first%{help_link_end}.').html_safe % { help_link_start: help_link_start % { url: autodevops_help_url }, help_link_end: help_link_end } = s_('ClusterIntegration|If you are setting up multiple clusters and are using Auto DevOps, %{help_link_start}read this first%{help_link_end}.').html_safe % { help_link_start: help_link_start % { url: autodevops_help_url }, help_link_end: help_link_end }
=======
>>>>>>> upstream/master
= form_for @project, url: namespace_project_pages_path(@project.namespace.becomes(Namespace), @project), html: { class: 'inline', title: pages_https_only_title } do |f| = form_for @project, url: namespace_project_pages_path(@project.namespace.becomes(Namespace), @project), html: { class: 'inline', title: pages_https_only_title } do |f|
= f.check_box :pages_https_only, class: 'float-left', disabled: pages_https_only_disabled? .form-group
.form-check
.prepend-left-20 = f.check_box :pages_https_only, class: 'form-check-input', disabled: pages_https_only_disabled?
= f.label :pages_https_only, class: pages_https_only_label_class do = f.label :pages_https_only, class: pages_https_only_label_class do
%strong Force domains with SSL certificates to use HTTPS %strong Force domains with SSL certificates to use HTTPS
- unless pages_https_only_disabled? - unless pages_https_only_disabled?
.prepend-top-10 .prepend-top-10
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
.card .card
.card-header .card-header
Domains (#{@domains.count}) Domains (#{@domains.count})
%ul.content-list.pages-domain-list{ class: ("has-verification-status" if verification_enabled) } %ul.list-group.list-group-flush.pages-domain-list{ class: ("has-verification-status" if verification_enabled) }
- @domains.each do |domain| - @domains.each do |domain|
%li.pages-domain-list-item.unstyled %li.pages-domain-list-item.list-group-item.d-flex.justify-content-between
- if verification_enabled - if verification_enabled
- tooltip, status = domain.unverified? ? [_('Unverified'), 'failed'] : [_('Verified'), 'success'] - tooltip, status = domain.unverified? ? [_('Unverified'), 'failed'] : [_('Verified'), 'success']
.domain-status.ci-status-icon.has-tooltip{ class: "ci-status-icon-#{status}", title: tooltip } .domain-status.ci-status-icon.has-tooltip{ class: "ci-status-icon-#{status}", title: tooltip }
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
= domain.url = domain.url
= icon('external-link') = icon('external-link')
- if domain.subject - if domain.subject
%p %div
%span.badge.badge-gray Certificate: #{domain.subject} %span.badge.badge-gray Certificate: #{domain.subject}
- if domain.expired? - if domain.expired?
%span.badge.badge-danger Expired %span.badge.badge-danger Expired
...@@ -24,6 +24,6 @@ ...@@ -24,6 +24,6 @@
= link_to 'Details', project_pages_domain_path(@project, domain), class: "btn btn-sm btn-grouped" = link_to 'Details', project_pages_domain_path(@project, domain), class: "btn btn-sm btn-grouped"
= link_to 'Remove', project_pages_domain_path(@project, domain), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove btn-sm btn-grouped" = link_to 'Remove', project_pages_domain_path(@project, domain), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove btn-sm btn-grouped"
- if verification_enabled && domain.unverified? - if verification_enabled && domain.unverified?
%li.warning-row %li.list-group-item.bs-callout-warning
#{domain.domain} is not verified. To learn how to verify ownership, visit your #{domain.domain} is not verified. To learn how to verify ownership, visit your
#{link_to 'domain details', project_pages_domain_path(@project, domain)}. #{link_to 'domain details', project_pages_domain_path(@project, domain)}.
---
title: Fixing regression issues on pages settings and details
merge_request: 22821
author:
type: fixed
---
title: Uses new gitlab-ui components in Jobs and Pipelines components
merge_request:
author:
type: other
---
title: Enable even more frozen string in lib/gitlab/**/*.rb
merge_request:
author: gfyoung
type: performance
---
title: Resolve possible cherry pick API race condition
merge_request:
author:
type: fixed
---
title: Add revert to commits API
merge_request: 22919
author:
type: added
...@@ -62,7 +62,7 @@ installations, this can be set in `gitlab-shell/config.yml`. ...@@ -62,7 +62,7 @@ installations, this can be set in `gitlab-shell/config.yml`.
The hooks are searched and executed in this order: The hooks are searched and executed in this order:
1. `<project>.git/hooks/` - symlink to `gitlab-shell/hooks` global dir 1. `gitlab-shell/hooks` directory as known to Gitaly
1. `<project>.git/hooks/<hook_name>` - executed by `git` itself, this is `gitlab-shell/hooks/<hook_name>` 1. `<project>.git/hooks/<hook_name>` - executed by `git` itself, this is `gitlab-shell/hooks/<hook_name>`
1. `<project>.git/custom_hooks/<hook_name>` - per project hook (this is already existing behavior) 1. `<project>.git/custom_hooks/<hook_name>` - per project hook (this is already existing behavior)
1. `<project>.git/custom_hooks/<hook_name>.d/*` - per project hooks 1. `<project>.git/custom_hooks/<hook_name>.d/*` - per project hooks
......
...@@ -288,6 +288,47 @@ Example response: ...@@ -288,6 +288,47 @@ Example response:
} }
``` ```
## Revert a commit
> [Introduced][ce-22919] in GitLab 11.6.
Reverts a commit in a given branch.
```
POST /projects/:id/repository/commits/:sha/revert
```
Parameters:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
| `sha` | string | yes | Commit SHA to revert |
| `branch` | string | yes | Target branch name |
```bash
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --form "branch=master" "https://gitlab.example.com/api/v4/projects/5/repository/commits/a738f717824ff53aebad8b090c1b79a14f2bd9e8/revert"
```
Example response:
```json
{
"id":"8b090c1b79a14f2bd9e8a738f717824ff53aebad",
"short_id": "8b090c1b",
"title":"Revert \"Feature added\"",
"created_at":"2018-11-08T15:55:26.000Z",
"parent_ids":["a738f717824ff53aebad8b090c1b79a14f2bd9e8"],
"message":"Revert \"Feature added\"\n\nThis reverts commit a738f717824ff53aebad8b090c1b79a14f2bd9e8",
"author_name":"Administrator",
"author_email":"admin@example.com",
"authored_date":"2018-11-08T15:55:26.000Z",
"committer_name":"Administrator",
"committer_email":"admin@example.com",
"committed_date":"2018-11-08T15:55:26.000Z"
}
```
## Get the diff of a commit ## Get the diff of a commit
Get the diff of a commit in a project. Get the diff of a commit in a project.
...@@ -619,3 +660,4 @@ Example response: ...@@ -619,3 +660,4 @@ Example response:
[ce-8047]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8047 [ce-8047]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8047
[ce-15026]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15026 [ce-15026]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15026
[ce-18004]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18004 [ce-18004]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18004
[ce-22919]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22919
...@@ -194,11 +194,47 @@ module API ...@@ -194,11 +194,47 @@ module API
branch_name: params[:branch] branch_name: params[:branch]
} }
result = ::Commits::CherryPickService.new(user_project, current_user, commit_params).execute result = ::Commits::CherryPickService
.new(user_project, current_user, commit_params)
.execute
if result[:status] == :success if result[:status] == :success
branch = find_branch!(params[:branch]) present user_project.repository.commit(result[:result]),
present user_project.repository.commit(branch.dereferenced_target), with: Entities::Commit with: Entities::Commit
else
render_api_error!(result[:message], 400)
end
end
desc 'Revert a commit in a branch' do
detail 'This feature was introduced in GitLab 11.6'
success Entities::Commit
end
params do
requires :sha, type: String, desc: 'Commit SHA to revert'
requires :branch, type: String, desc: 'Target branch name', allow_blank: false
end
post ':id/repository/commits/:sha/revert', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS do
authorize_push_to_branch!(params[:branch])
commit = user_project.commit(params[:sha])
not_found!('Commit') unless commit
find_branch!(params[:branch])
commit_params = {
commit: commit,
start_branch: params[:branch],
branch_name: params[:branch]
}
result = ::Commits::RevertService
.new(user_project, current_user, commit_params)
.execute
if result[:status] == :success
present user_project.repository.commit(result[:result]),
with: Entities::Commit
else else
render_api_error!(result[:message], 400) render_api_error!(result[:message], 400)
end end
......
...@@ -6,8 +6,11 @@ require_relative 'redact_links/redactable' ...@@ -6,8 +6,11 @@ require_relative 'redact_links/redactable'
module Gitlab module Gitlab
module BackgroundMigration module BackgroundMigration
class RedactLinks class RedactLinks
<<<<<<< HEAD
prepend EE::Gitlab::BackgroundMigration::RedactLinks prepend EE::Gitlab::BackgroundMigration::RedactLinks
=======
>>>>>>> upstream/master
class Note < ActiveRecord::Base class Note < ActiveRecord::Base
include EachBatch include EachBatch
include ::Gitlab::BackgroundMigration::RedactLinks::Redactable include ::Gitlab::BackgroundMigration::RedactLinks::Redactable
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Conflict module Conflict
class File class File
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Conflict module Conflict
class FileCollection class FileCollection
......
# frozen_string_literal: true
module Gitlab module Gitlab
class CrossProjectAccess class CrossProjectAccess
class CheckCollection class CheckCollection
......
# frozen_string_literal: true
module Gitlab module Gitlab
class CrossProjectAccess class CrossProjectAccess
class CheckInfo class CheckInfo
......
# frozen_string_literal: true
module Gitlab module Gitlab
class CrossProjectAccess class CrossProjectAccess
module ClassMethods module ClassMethods
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class BaseEventFetcher class BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
module BaseQuery module BaseQuery
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class BaseStage class BaseStage
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class CodeEventFetcher < BaseEventFetcher class CodeEventFetcher < BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class CodeStage < BaseStage class CodeStage < BaseStage
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
module EventFetcher module EventFetcher
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class IssueEventFetcher < BaseEventFetcher class IssueEventFetcher < BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class IssueStage < BaseStage class IssueStage < BaseStage
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
module MetricsTables module MetricsTables
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class Permissions class Permissions
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class PlanEventFetcher < BaseEventFetcher class PlanEventFetcher < BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class PlanStage < BaseStage class PlanStage < BaseStage
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class ProductionEventFetcher < IssueEventFetcher class ProductionEventFetcher < IssueEventFetcher
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
module ProductionHelper module ProductionHelper
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class ProductionStage < BaseStage class ProductionStage < BaseStage
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class ReviewEventFetcher < BaseEventFetcher class ReviewEventFetcher < BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class ReviewStage < BaseStage class ReviewStage < BaseStage
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
module Stage module Stage
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class StageSummary class StageSummary
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class StagingEventFetcher < BaseEventFetcher class StagingEventFetcher < BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class StagingStage < BaseStage class StagingStage < BaseStage
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
module Summary module Summary
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
module Summary module Summary
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
module Summary module Summary
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
module Summary module Summary
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class TestEventFetcher < StagingEventFetcher class TestEventFetcher < StagingEventFetcher
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class TestStage < BaseStage class TestStage < BaseStage
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class Updater class Updater
......
# frozen_string_literal: true
module Gitlab module Gitlab
module CycleAnalytics module CycleAnalytics
class UsageData class UsageData
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DataBuilder module DataBuilder
module Build module Build
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DataBuilder module DataBuilder
module Note module Note
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DataBuilder module DataBuilder
module Pipeline module Pipeline
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DataBuilder module DataBuilder
module Push module Push
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DataBuilder module DataBuilder
module Repository module Repository
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DataBuilder module DataBuilder
module WikiPage module WikiPage
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Database module Database
module ArelMethods module ArelMethods
......
# frozen_string_literal: true
# For large tables, PostgreSQL can take a long time to count rows due to MVCC. # For large tables, PostgreSQL can take a long time to count rows due to MVCC.
# We can optimize this by using the reltuples count as described in https://wiki.postgresql.org/wiki/Slow_Counting. # We can optimize this by using the reltuples count as described in https://wiki.postgresql.org/wiki/Slow_Counting.
module Gitlab module Gitlab
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Database module Database
module DateTime module DateTime
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Database module Database
# Model that can be used for querying permissions of a SQL user. # Model that can be used for querying permissions of a SQL user.
......
# frozen_string_literal: true
# https://www.periscopedata.com/blog/medians-in-sql.html # https://www.periscopedata.com/blog/medians-in-sql.html
module Gitlab module Gitlab
module Database module Database
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Database module Database
module MigrationHelpers module MigrationHelpers
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Database module Database
module MultiThreadedMigration module MultiThreadedMigration
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Database module Database
# Module that can be injected into a ActiveRecord::Relation to make it # Module that can be injected into a ActiveRecord::Relation to make it
......
# frozen_string_literal: true
# This module can be included in migrations to make it easier to rename paths # This module can be included in migrations to make it easier to rename paths
# of `Namespace` & `Project` models certain paths would become `reserved`. # of `Namespace` & `Project` models certain paths would become `reserved`.
# #
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Database module Database
module RenameReservedPathsMigration module RenameReservedPathsMigration
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Database module Database
module RenameReservedPathsMigration module RenameReservedPathsMigration
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Database module Database
module RenameReservedPathsMigration module RenameReservedPathsMigration
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Database module Database
module RenameReservedPathsMigration module RenameReservedPathsMigration
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Database module Database
BINARY_TYPE = BINARY_TYPE =
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class BaseLinker class BaseLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class CartfileLinker < MethodLinker class CartfileLinker < MethodLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
module Cocoapods module Cocoapods
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class ComposerJsonLinker < PackageJsonLinker class ComposerJsonLinker < PackageJsonLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class GemfileLinker < MethodLinker class GemfileLinker < MethodLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class GemspecLinker < MethodLinker class GemspecLinker < MethodLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class GodepsJsonLinker < JsonLinker class GodepsJsonLinker < JsonLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class JsonLinker < BaseLinker class JsonLinker < BaseLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class MethodLinker < BaseLinker class MethodLinker < BaseLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class PackageJsonLinker < JsonLinker class PackageJsonLinker < JsonLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class PodfileLinker < GemfileLinker class PodfileLinker < GemfileLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class PodspecJsonLinker < JsonLinker class PodspecJsonLinker < JsonLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class PodspecLinker < MethodLinker class PodspecLinker < MethodLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module DependencyLinker module DependencyLinker
class RequirementsTxtLinker < BaseLinker class RequirementsTxtLinker < BaseLinker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
class DiffRefs class DiffRefs
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
class File class File
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
module FileCollection module FileCollection
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
module FileCollection module FileCollection
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
module FileCollection module FileCollection
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
module FileCollection module FileCollection
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
module Formatters module Formatters
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
module Formatters module Formatters
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
module Formatters module Formatters
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
class Highlight class Highlight
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
class ImagePoint class ImagePoint
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
class InlineDiff class InlineDiff
...@@ -71,7 +73,7 @@ module Gitlab ...@@ -71,7 +73,7 @@ module Gitlab
def find_changed_line_pairs(lines) def find_changed_line_pairs(lines)
# Prefixes of all diff lines, indicating their types # Prefixes of all diff lines, indicating their types
# For example: `" - + -+ ---+++ --+ -++"` # For example: `" - + -+ ---+++ --+ -++"`
line_prefixes = lines.each_with_object("") { |line, s| s << (line[0] || ' ') }.gsub(/[^ +-]/, ' ') line_prefixes = lines.each_with_object(+"") { |line, s| s << (line[0] || ' ') }.gsub(/[^ +-]/, ' ')
changed_line_pairs = [] changed_line_pairs = []
line_prefixes.scan(LINE_PAIRS_PATTERN) do line_prefixes.scan(LINE_PAIRS_PATTERN) do
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
class InlineDiffMarkdownMarker < Gitlab::StringRangeMarker class InlineDiffMarkdownMarker < Gitlab::StringRangeMarker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
class InlineDiffMarker < Gitlab::StringRangeMarker class InlineDiffMarker < Gitlab::StringRangeMarker
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
class Line class Line
......
# frozen_string_literal: true
# When provided a diff for a specific file, maps old line numbers to new line # When provided a diff for a specific file, maps old line numbers to new line
# numbers and back, to find out where a specific line in a file was moved by the # numbers and back, to find out where a specific line in a file was moved by the
# changes. # changes.
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
class ParallelDiff class ParallelDiff
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Diff module Diff
class Parser class Parser
......
# frozen_string_literal: true
# Defines a specific location, identified by paths line numbers and image coordinates, # Defines a specific location, identified by paths line numbers and image coordinates,
# within a specific diff, identified by start, head and base commit ids. # within a specific diff, identified by start, head and base commit ids.
module Gitlab module Gitlab
......
# frozen_string_literal: true
# Finds the diff position in the new diff that corresponds to the same location # Finds the diff position in the new diff that corresponds to the same location
# specified by the provided position in the old diff. # specified by the provided position in the old diff.
module Gitlab module Gitlab
......
# frozen_string_literal: true
module Gitlab module Gitlab
class DowntimeCheck class DowntimeCheck
class Message class Message
...@@ -18,13 +20,13 @@ module Gitlab ...@@ -18,13 +20,13 @@ module Gitlab
def to_s def to_s
label = offline ? OFFLINE : ONLINE label = offline ? OFFLINE : ONLINE
message = "[#{label}]: #{path}" message = ["[#{label}]: #{path}"]
if reason? if reason?
message += ":\n\n#{reason}\n\n" message << ":\n\n#{reason}\n\n"
end end
message message.join
end end
def reason? def reason?
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Email module Email
class AttachmentUploader class AttachmentUploader
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Email module Email
module Hook module Hook
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Email module Email
module Hook module Hook
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Email module Email
module Hook module Hook
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Email module Email
module Hook module Hook
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Email module Email
class HTMLParser class HTMLParser
......
# frozen_string_literal: true
module Gitlab module Gitlab
module Email module Email
module Message module Message
...@@ -116,7 +118,7 @@ module Gitlab ...@@ -116,7 +118,7 @@ module Gitlab
end end
def subject def subject
subject_text = '[Git]' subject_text = ['[Git]']
subject_text << "[#{project.full_path}]" subject_text << "[#{project.full_path}]"
subject_text << "[#{ref_name}]" if @action == :push subject_text << "[#{ref_name}]" if @action == :push
subject_text << ' ' subject_text << ' '
...@@ -134,6 +136,8 @@ module Gitlab ...@@ -134,6 +136,8 @@ module Gitlab
subject_action[0] = subject_action[0].capitalize subject_action[0] = subject_action[0].capitalize
subject_text << "#{subject_action} #{ref_type} #{ref_name}" subject_text << "#{subject_action} #{ref_type} #{ref_name}"
end end
subject_text.join
end end
end end
end end
......
# frozen_string_literal: true
require_dependency 'gitlab/email/handler' require_dependency 'gitlab/email/handler'
# Inspired in great part by Discourse's Email::Receiver # Inspired in great part by Discourse's Email::Receiver
......
# frozen_string_literal: true
# Inspired in great part by Discourse's Email::Receiver # Inspired in great part by Discourse's Email::Receiver
module Gitlab module Gitlab
module Email module Email
......
# frozen_string_literal: true
module Gitlab module Gitlab
module EtagCaching module EtagCaching
class Middleware class Middleware
......
# frozen_string_literal: true
module Gitlab module Gitlab
module EtagCaching module EtagCaching
class Router class Router
......
# frozen_string_literal: true
module Gitlab module Gitlab
module EtagCaching module EtagCaching
class Store class Store
......
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
def generate_script def generate_script
<<~HEREDOC <<~HEREDOC
set -eo pipefail set -xeo pipefail
HEREDOC HEREDOC
end end
......
...@@ -45,7 +45,7 @@ module Gitlab ...@@ -45,7 +45,7 @@ module Gitlab
def init_helm_command def init_helm_command
command = %w[helm init] + init_command_flags command = %w[helm init] + init_command_flags
command.shelljoin + " >/dev/null\n" command.shelljoin
end end
def init_command_flags def init_command_flags
......
...@@ -35,7 +35,7 @@ module Gitlab ...@@ -35,7 +35,7 @@ module Gitlab
private private
def init_command def init_command
'helm init --client-only >/dev/null' 'helm init --client-only'
end end
def repository_command def repository_command
...@@ -43,13 +43,13 @@ module Gitlab ...@@ -43,13 +43,13 @@ module Gitlab
end end
def repository_update_command def repository_update_command
'helm repo update >/dev/null' if repository 'helm repo update' if repository
end end
def install_command def install_command
command = ['helm', 'install', chart] + install_command_flags command = ['helm', 'install', chart] + install_command_flags
command.shelljoin + " >/dev/null\n" command.shelljoin
end end
def preinstall_command def preinstall_command
......
...@@ -36,7 +36,7 @@ module Gitlab ...@@ -36,7 +36,7 @@ module Gitlab
private private
def init_command def init_command
'helm init --client-only >/dev/null' 'helm init --client-only'
end end
def repository_command def repository_command
...@@ -50,7 +50,7 @@ module Gitlab ...@@ -50,7 +50,7 @@ module Gitlab
" --namespace #{::Gitlab::Kubernetes::Helm::NAMESPACE}" \ " --namespace #{::Gitlab::Kubernetes::Helm::NAMESPACE}" \
" -f /data/helm/#{name}/config/values.yaml" " -f /data/helm/#{name}/config/values.yaml"
"helm upgrade #{name} #{chart}#{upgrade_flags} >/dev/null\n" "helm upgrade #{name} #{chart}#{upgrade_flags}"
end end
def optional_version_flag def optional_version_flag
......
...@@ -1861,9 +1861,12 @@ msgstr "" ...@@ -1861,9 +1861,12 @@ msgstr ""
msgid "ClusterIntegration|Kubernetes cluster details" msgid "ClusterIntegration|Kubernetes cluster details"
msgstr "" msgstr ""
<<<<<<< HEAD
msgid "ClusterIntegration|Kubernetes cluster health" msgid "ClusterIntegration|Kubernetes cluster health"
msgstr "" msgstr ""
=======
>>>>>>> upstream/master
msgid "ClusterIntegration|Kubernetes cluster is being created on Google Kubernetes Engine..." msgid "ClusterIntegration|Kubernetes cluster is being created on Google Kubernetes Engine..."
msgstr "" msgstr ""
......
...@@ -126,6 +126,9 @@ function deploy() { ...@@ -126,6 +126,9 @@ function deploy() {
delete delete
cleanup cleanup
fi fi
create_secret
helm repo add gitlab https://charts.gitlab.io/ helm repo add gitlab https://charts.gitlab.io/
helm dep update . helm dep update .
......
...@@ -6,7 +6,7 @@ require "spec_helper" ...@@ -6,7 +6,7 @@ require "spec_helper"
# All those specs are moved out to this spec intentionally to keep them all in one place. # All those specs are moved out to this spec intentionally to keep them all in one place.
describe "User sorts things" do describe "User sorts things" do
include Spec::Support::Helpers::Features::SortingHelpers include Spec::Support::Helpers::Features::SortingHelpers
include Helpers::DashboardHelper include DashboardHelper
set(:project) { create(:project_empty_repo, :public) } set(:project) { create(:project_empty_repo, :public) }
set(:current_user) { create(:user) } # Using `current_user` instead of just `user` because of the hardoced call in `assigned_mrs_dashboard_path` which is used below. set(:current_user) { create(:user) } # Using `current_user` instead of just `user` because of the hardoced call in `assigned_mrs_dashboard_path` which is used below.
......
...@@ -27,8 +27,6 @@ describe('clipboard button', () => { ...@@ -27,8 +27,6 @@ describe('clipboard button', () => {
it('should have a tooltip with default values', () => { it('should have a tooltip with default values', () => {
expect(vm.$el.getAttribute('data-original-title')).toEqual('Copy this value into Clipboard!'); expect(vm.$el.getAttribute('data-original-title')).toEqual('Copy this value into Clipboard!');
expect(vm.$el.getAttribute('data-placement')).toEqual('top');
expect(vm.$el.getAttribute('data-container')).toEqual(null);
}); });
it('should render provided classname', () => { it('should render provided classname', () => {
......
...@@ -8,7 +8,7 @@ describe Gitlab::Kubernetes::Helm::InitCommand do ...@@ -8,7 +8,7 @@ describe Gitlab::Kubernetes::Helm::InitCommand do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --tiller-tls --tiller-tls-verify --tls-ca-cert /data/helm/helm/config/ca.pem --tiller-tls-cert /data/helm/helm/config/cert.pem --tiller-tls-key /data/helm/helm/config/key.pem >/dev/null helm init --tiller-tls --tiller-tls-verify --tls-ca-cert /data/helm/helm/config/ca.pem --tiller-tls-cert /data/helm/helm/config/cert.pem --tiller-tls-key /data/helm/helm/config/key.pem
EOS EOS
end end
...@@ -22,7 +22,7 @@ describe Gitlab::Kubernetes::Helm::InitCommand do ...@@ -22,7 +22,7 @@ describe Gitlab::Kubernetes::Helm::InitCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --tiller-tls --tiller-tls-verify --tls-ca-cert /data/helm/helm/config/ca.pem --tiller-tls-cert /data/helm/helm/config/cert.pem --tiller-tls-key /data/helm/helm/config/key.pem --service-account tiller >/dev/null helm init --tiller-tls --tiller-tls-verify --tls-ca-cert /data/helm/helm/config/ca.pem --tiller-tls-cert /data/helm/helm/config/cert.pem --tiller-tls-key /data/helm/helm/config/key.pem --service-account tiller
EOS EOS
end end
end end
......
...@@ -26,9 +26,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -26,9 +26,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --client-only >/dev/null helm init --client-only
helm repo add app-name https://repository.example.com helm repo add app-name https://repository.example.com
helm repo update >/dev/null helm repo update
#{helm_install_comand} #{helm_install_comand}
EOS EOS
end end
...@@ -43,7 +43,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -43,7 +43,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
--tls-key /data/helm/app-name/config/key.pem --tls-key /data/helm/app-name/config/key.pem
--version 1.2.3 --version 1.2.3
--namespace gitlab-managed-apps --namespace gitlab-managed-apps
-f /data/helm/app-name/config/values.yaml >/dev/null -f /data/helm/app-name/config/values.yaml
EOS EOS
end end
end end
...@@ -54,9 +54,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -54,9 +54,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --client-only >/dev/null helm init --client-only
helm repo add app-name https://repository.example.com helm repo add app-name https://repository.example.com
helm repo update >/dev/null helm repo update
#{helm_install_command} #{helm_install_command}
EOS EOS
end end
...@@ -72,7 +72,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -72,7 +72,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
--version 1.2.3 --version 1.2.3
--set rbac.create\\=true,rbac.enabled\\=true --set rbac.create\\=true,rbac.enabled\\=true
--namespace gitlab-managed-apps --namespace gitlab-managed-apps
-f /data/helm/app-name/config/values.yaml >/dev/null -f /data/helm/app-name/config/values.yaml
EOS EOS
end end
end end
...@@ -84,7 +84,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -84,7 +84,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --client-only >/dev/null helm init --client-only
#{helm_install_command} #{helm_install_command}
EOS EOS
end end
...@@ -99,7 +99,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -99,7 +99,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
--tls-key /data/helm/app-name/config/key.pem --tls-key /data/helm/app-name/config/key.pem
--version 1.2.3 --version 1.2.3
--namespace gitlab-managed-apps --namespace gitlab-managed-apps
-f /data/helm/app-name/config/values.yaml >/dev/null -f /data/helm/app-name/config/values.yaml
EOS EOS
end end
end end
...@@ -111,9 +111,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -111,9 +111,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --client-only >/dev/null helm init --client-only
helm repo add app-name https://repository.example.com helm repo add app-name https://repository.example.com
helm repo update >/dev/null helm repo update
#{helm_install_command} #{helm_install_command}
EOS EOS
end end
...@@ -122,7 +122,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -122,7 +122,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
<<~EOS.strip <<~EOS.strip
/bin/date /bin/date
/bin/true /bin/true
helm install chart-name --name app-name --tls --tls-ca-cert /data/helm/app-name/config/ca.pem --tls-cert /data/helm/app-name/config/cert.pem --tls-key /data/helm/app-name/config/key.pem --version 1.2.3 --namespace gitlab-managed-apps -f /data/helm/app-name/config/values.yaml >/dev/null helm install chart-name --name app-name --tls --tls-ca-cert /data/helm/app-name/config/ca.pem --tls-cert /data/helm/app-name/config/cert.pem --tls-key /data/helm/app-name/config/key.pem --version 1.2.3 --namespace gitlab-managed-apps -f /data/helm/app-name/config/values.yaml
EOS EOS
end end
end end
...@@ -134,17 +134,16 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -134,17 +134,16 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --client-only >/dev/null helm init --client-only
helm repo add app-name https://repository.example.com helm repo add app-name https://repository.example.com
helm repo update >/dev/null helm repo update
#{helm_install_command} #{helm_install_command}
EOS EOS
end end
let(:helm_install_command) do let(:helm_install_command) do
<<~EOS.strip <<~EOS.strip
helm install chart-name --name app-name --tls --tls-ca-cert /data/helm/app-name/config/ca.pem --tls-cert /data/helm/app-name/config/cert.pem --tls-key /data/helm/app-name/config/key.pem --version 1.2.3 --namespace gitlab-managed-apps -f /data/helm/app-name/config/values.yaml >/dev/null helm install chart-name --name app-name --tls --tls-ca-cert /data/helm/app-name/config/ca.pem --tls-cert /data/helm/app-name/config/cert.pem --tls-key /data/helm/app-name/config/key.pem --version 1.2.3 --namespace gitlab-managed-apps -f /data/helm/app-name/config/values.yaml
/bin/date /bin/date
/bin/false /bin/false
EOS EOS
...@@ -158,9 +157,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -158,9 +157,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --client-only >/dev/null helm init --client-only
helm repo add app-name https://repository.example.com helm repo add app-name https://repository.example.com
helm repo update >/dev/null helm repo update
#{helm_install_command} #{helm_install_command}
EOS EOS
end end
...@@ -171,7 +170,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -171,7 +170,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
--name app-name --name app-name
--version 1.2.3 --version 1.2.3
--namespace gitlab-managed-apps --namespace gitlab-managed-apps
-f /data/helm/app-name/config/values.yaml >/dev/null -f /data/helm/app-name/config/values.yaml
EOS EOS
end end
end end
...@@ -183,9 +182,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -183,9 +182,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --client-only >/dev/null helm init --client-only
helm repo add app-name https://repository.example.com helm repo add app-name https://repository.example.com
helm repo update >/dev/null helm repo update
#{helm_install_command} #{helm_install_command}
EOS EOS
end end
...@@ -199,7 +198,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do ...@@ -199,7 +198,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
--tls-cert /data/helm/app-name/config/cert.pem --tls-cert /data/helm/app-name/config/cert.pem
--tls-key /data/helm/app-name/config/key.pem --tls-key /data/helm/app-name/config/key.pem
--namespace gitlab-managed-apps --namespace gitlab-managed-apps
-f /data/helm/app-name/config/values.yaml >/dev/null -f /data/helm/app-name/config/values.yaml
EOS EOS
end end
end end
......
...@@ -21,8 +21,8 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do ...@@ -21,8 +21,8 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --client-only >/dev/null helm init --client-only
helm upgrade #{application.name} #{application.chart} --tls --tls-ca-cert /data/helm/#{application.name}/config/ca.pem --tls-cert /data/helm/#{application.name}/config/cert.pem --tls-key /data/helm/#{application.name}/config/key.pem --reset-values --install --namespace #{namespace} -f /data/helm/#{application.name}/config/values.yaml >/dev/null helm upgrade #{application.name} #{application.chart} --tls --tls-ca-cert /data/helm/#{application.name}/config/ca.pem --tls-cert /data/helm/#{application.name}/config/cert.pem --tls-key /data/helm/#{application.name}/config/key.pem --reset-values --install --namespace #{namespace} -f /data/helm/#{application.name}/config/values.yaml
EOS EOS
end end
end end
...@@ -33,8 +33,8 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do ...@@ -33,8 +33,8 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --client-only >/dev/null helm init --client-only
helm upgrade #{application.name} #{application.chart} --tls --tls-ca-cert /data/helm/#{application.name}/config/ca.pem --tls-cert /data/helm/#{application.name}/config/cert.pem --tls-key /data/helm/#{application.name}/config/key.pem --reset-values --install --namespace #{namespace} -f /data/helm/#{application.name}/config/values.yaml >/dev/null helm upgrade #{application.name} #{application.chart} --tls --tls-ca-cert /data/helm/#{application.name}/config/ca.pem --tls-cert /data/helm/#{application.name}/config/cert.pem --tls-key /data/helm/#{application.name}/config/key.pem --reset-values --install --namespace #{namespace} -f /data/helm/#{application.name}/config/values.yaml
EOS EOS
end end
end end
...@@ -56,9 +56,9 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do ...@@ -56,9 +56,9 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --client-only >/dev/null helm init --client-only
helm repo add #{application.name} #{application.repository} helm repo add #{application.name} #{application.repository}
helm upgrade #{application.name} #{application.chart} --tls --tls-ca-cert /data/helm/#{application.name}/config/ca.pem --tls-cert /data/helm/#{application.name}/config/cert.pem --tls-key /data/helm/#{application.name}/config/key.pem --reset-values --install --namespace #{namespace} -f /data/helm/#{application.name}/config/values.yaml >/dev/null helm upgrade #{application.name} #{application.chart} --tls --tls-ca-cert /data/helm/#{application.name}/config/ca.pem --tls-cert /data/helm/#{application.name}/config/cert.pem --tls-key /data/helm/#{application.name}/config/key.pem --reset-values --install --namespace #{namespace} -f /data/helm/#{application.name}/config/values.yaml
EOS EOS
end end
end end
...@@ -70,8 +70,8 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do ...@@ -70,8 +70,8 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do
it_behaves_like 'helm commands' do it_behaves_like 'helm commands' do
let(:commands) do let(:commands) do
<<~EOS <<~EOS
helm init --client-only >/dev/null helm init --client-only
helm upgrade #{application.name} #{application.chart} --reset-values --install --namespace #{namespace} -f /data/helm/#{application.name}/config/values.yaml >/dev/null helm upgrade #{application.name} #{application.chart} --reset-values --install --namespace #{namespace} -f /data/helm/#{application.name}/config/values.yaml
EOS EOS
end end
end end
......
...@@ -1208,6 +1208,118 @@ describe API::Commits do ...@@ -1208,6 +1208,118 @@ describe API::Commits do
end end
end end
describe 'POST :id/repository/commits/:sha/revert' do
let(:commit_id) { 'b83d6e391c22777fca1ed3012fce84f633d7fed0' }
let(:commit) { project.commit(commit_id) }
let(:branch) { 'master' }
let(:route) { "/projects/#{project_id}/repository/commits/#{commit_id}/revert" }
shared_examples_for 'ref revert' do
context 'when ref exists' do
it 'reverts the ref commit' do
post api(route, current_user), branch: branch
expect(response).to have_gitlab_http_status(201)
expect(response).to match_response_schema('public_api/v4/commit/basic')
expect(json_response['message']).to eq(commit.revert_message(user))
expect(json_response['author_name']).to eq(user.name)
expect(json_response['committer_name']).to eq(user.name)
expect(json_response['parent_ids']).to contain_exactly(commit_id)
end
end
context 'when repository is disabled' do
include_context 'disabled repository'
it_behaves_like '403 response' do
let(:request) { post api(route, current_user), branch: branch }
end
end
end
context 'when unauthenticated', 'and project is public' do
let(:project) { create(:project, :public, :repository) }
it_behaves_like '403 response' do
let(:request) { post api(route), branch: branch }
end
end
context 'when unauthenticated', 'and project is private' do
it_behaves_like '404 response' do
let(:request) { post api(route), branch: branch }
let(:message) { '404 Project Not Found' }
end
end
context 'when authenticated', 'as an owner' do
let(:current_user) { user }
it_behaves_like 'ref revert'
context 'when ref does not exist' do
let(:commit_id) { 'unknown' }
it_behaves_like '404 response' do
let(:request) { post api(route, current_user), branch: branch }
let(:message) { '404 Commit Not Found' }
end
end
context 'when branch is missing' do
it_behaves_like '400 response' do
let(:request) { post api(route, current_user) }
end
end
context 'when branch is empty' do
['', ' '].each do |branch|
it_behaves_like '400 response' do
let(:request) { post api(route, current_user), branch: branch }
end
end
end
context 'when branch does not exist' do
it_behaves_like '404 response' do
let(:request) { post api(route, current_user), branch: 'foo' }
let(:message) { '404 Branch Not Found' }
end
end
context 'when ref contains a dot' do
let(:commit_id) { branch_with_dot.name }
let(:commit) { project.repository.commit(commit_id) }
it_behaves_like '400 response' do
let(:request) { post api(route, current_user) }
end
end
end
context 'when authenticated', 'as a developer' do
let(:current_user) { user }
before do
project.add_developer(user)
end
context 'when branch is protected' do
before do
create(:protected_branch, project: project, name: 'feature')
end
it 'returns 400 if you are not allowed to push to the target branch' do
post api(route, current_user), branch: 'feature'
expect(response).to have_gitlab_http_status(:forbidden)
expect(json_response['message']).to match(/You are not allowed to push into this branch/)
end
end
end
end
describe 'POST /projects/:id/repository/commits/:sha/comments' do describe 'POST /projects/:id/repository/commits/:sha/comments' do
let(:commit) { project.repository.commit } let(:commit) { project.repository.commit }
let(:commit_id) { commit.id } let(:commit_id) { commit.id }
......
...@@ -2,12 +2,12 @@ shared_examples 'helm commands' do ...@@ -2,12 +2,12 @@ shared_examples 'helm commands' do
describe '#generate_script' do describe '#generate_script' do
let(:helm_setup) do let(:helm_setup) do
<<~EOS <<~EOS
set -eo pipefail set -xeo pipefail
EOS EOS
end end
it 'should return appropriate command' do it 'should return appropriate command' do
expect(subject.generate_script).to eq(helm_setup + commands) expect(subject.generate_script.strip).to eq((helm_setup + commands).strip)
end end
end end
end end
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