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:
- download_gitlab_chart
- ensure_namespace
- install_tiller
- create_secret
- install_external_dns
- deploy
environment:
......
<script>
import _ from 'underscore';
import { mapActions, mapState } from 'vuex';
import { GlLink, GlButton } from '@gitlab-org/gitlab-ui';
import timeagoMixin from '~/vue_shared/mixins/timeago';
import { timeIntervalInWords } from '~/lib/utils/datetime_utility';
import Icon from '~/vue_shared/components/icon.vue';
......@@ -21,6 +22,8 @@ export default {
TriggerBlock,
StagesDropdown,
JobsContainer,
GlLink,
GlButton,
},
mixins: [timeagoMixin],
props: {
......@@ -115,7 +118,7 @@ export default {
<strong class="inline prepend-top-8">
{{ job.name }}
</strong>
<a
<gl-link
v-if="job.retry_path"
:class="retryButtonClass"
:href="job.retry_path"
......@@ -123,8 +126,8 @@ export default {
rel="nofollow"
>
{{ __('Retry') }}
</a>
<a
</gl-link>
<gl-link
v-if="job.terminal_path"
:href="job.terminal_path"
class="js-terminal-link pull-right btn btn-primary
......@@ -133,8 +136,8 @@ export default {
>
{{ __('Debug') }}
<icon name="external-link" />
</a>
<button
</gl-link>
<gl-button
:aria-label="__('Toggle Sidebar')"
type="button"
class="btn btn-blank gutter-toggle
......@@ -146,20 +149,20 @@ export default {
data-hidden="true"
class="fa fa-angle-double-right"
></i>
</button>
</gl-button>
</div>
<div
v-if="job.retry_path || job.new_issue_path"
class="block retry-link"
>
<a
<gl-link
v-if="job.new_issue_path"
:href="job.new_issue_path"
class="js-new-issue btn btn-success btn-inverted"
>
{{ __('New issue') }}
</a>
<a
</gl-link>
<gl-link
v-if="job.retry_path"
:href="job.retry_path"
class="js-retry-job btn btn-inverted-secondary"
......@@ -167,7 +170,7 @@ export default {
rel="nofollow"
>
{{ __('Retry') }}
</a>
</gl-link>
</div>
<div :class="{ block : renderBlock }">
<p
......@@ -177,9 +180,9 @@ export default {
<span class="build-light-text">
{{ __('Merge Request:') }}
</span>
<a :href="job.merge_request.path">
<gl-link :href="job.merge_request.path">
!{{ job.merge_request.iid }}
</a>
</gl-link>
</p>
<detail-row
......@@ -244,14 +247,14 @@ export default {
v-if="job.cancel_path"
class="btn-group prepend-top-5"
role="group">
<a
<gl-link
:href="job.cancel_path"
class="js-cancel-job btn btn-sm btn-default"
data-method="post"
rel="nofollow"
>
{{ __('Cancel') }}
</a>
</gl-link>
</div>
</div>
......
<script>
import { GlButton } from '@gitlab-org/gitlab-ui';
export default {
components: {
GlButton,
},
props: {
trigger: {
type: Object,
......@@ -41,15 +46,14 @@ export default {
</p>
<p v-if="hasVariables">
<button
<gl-button
v-if="!areVariablesVisible"
type="button"
class="btn btn-default group js-reveal-variables"
@click="revealVariables"
>
{{ __('Reveal Variables') }}
</button>
</gl-button>
</p>
<dl
......
......@@ -448,7 +448,7 @@ Please check your network connection and try again.`;
<div class="discussion-with-resolve-btn">
<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"
@click="showReplyForm"
>
......@@ -457,7 +457,7 @@ Please check your network connection and try again.`;
<div v-if="discussion.resolvable">
<button
type="button"
class="btn btn-default mx-sm-2"
class="btn btn-default mr-sm-2"
@click="resolveHandler()"
>
<i
......@@ -470,7 +470,7 @@ Please check your network connection and try again.`;
</div>
<div
v-if="discussion.resolvable"
class="btn-group discussion-actions"
class="btn-group discussion-actions ml-sm-2"
role="group"
>
<div
......
<script>
import { GlButton } from '@gitlab-org/gitlab-ui';
export default {
name: 'PipelinesEmptyState',
components: {
GlButton,
},
props: {
helpPagePath: {
type: String,
......@@ -41,12 +46,13 @@ export default {
</p>
<div class="text-center">
<a
<gl-button
:href="helpPagePath"
class="btn btn-primary js-get-started-pipelines"
variant="primary"
class="js-get-started-pipelines"
>
{{ s__('Pipelines|Get started with Pipelines') }}
</a>
</gl-button>
</div>
</template>
......
<script>
import { GlLink, GlButton } from '@gitlab-org/gitlab-ui';
import LoadingButton from '../../vue_shared/components/loading_button.vue';
export default {
name: 'PipelineNavControls',
components: {
LoadingButton,
GlLink,
GlButton,
},
props: {
newPipelinePath: {
......@@ -40,28 +43,29 @@ export default {
</script>
<template>
<div class="nav-controls">
<a
<gl-button
v-if="newPipelinePath"
:href="newPipelinePath"
class="btn btn-success js-run-pipeline"
variant="success"
class="js-run-pipeline"
>
{{ s__('Pipelines|Run Pipeline') }}
</a>
</gl-button>
<loading-button
v-if="resetCachePath"
:loading="isResetCacheButtonLoading"
:label="s__('Pipelines|Clear Runner Caches')"
class="btn btn-default js-clear-cache"
class="js-clear-cache"
@click="onClickResetCache"
/>
<a
<gl-button
v-if="ciLintPath"
:href="ciLintPath"
class="btn btn-default js-ci-lint"
class="js-ci-lint"
>
{{ s__('Pipelines|CI Lint') }}
</a>
</gl-button>
</div>
</template>
<script>
import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
import tooltip from '../../vue_shared/directives/tooltip';
import popover from '../../vue_shared/directives/popover';
import { GlLink, GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import popover from '~/vue_shared/directives/popover';
export default {
components: {
userAvatarLink,
UserAvatarLink,
GlLink,
},
directives: {
tooltip,
GlTooltip: GlTooltipDirective,
popover,
},
props: {
......@@ -47,11 +48,12 @@ export default {
</script>
<template>
<div class="table-section section-15 d-none d-sm-none d-md-block pipeline-tags">
<a
<gl-link
:href="pipeline.path"
class="js-pipeline-url-link">
class="js-pipeline-url-link"
>
<span class="pipeline-id">#{{ pipeline.id }}</span>
</a>
</gl-link>
<span>by</span>
<user-avatar-link
v-if="user"
......@@ -68,36 +70,41 @@ export default {
<div class="label-container">
<span
v-if="pipeline.flags.latest"
v-tooltip
v-gl-tooltip
class="js-pipeline-url-latest badge badge-success"
title="Latest pipeline for this branch">
title="Latest pipeline for this branch"
>
latest
</span>
<span
v-if="pipeline.flags.yaml_errors"
v-tooltip
v-gl-tooltip
:title="pipeline.yaml_errors"
class="js-pipeline-url-yaml badge badge-danger">
class="js-pipeline-url-yaml badge badge-danger"
>
yaml invalid
</span>
<span
v-if="pipeline.flags.failure_reason"
v-tooltip
v-gl-tooltip
:title="pipeline.failure_reason"
class="js-pipeline-url-failure badge badge-danger">
class="js-pipeline-url-failure badge badge-danger"
>
error
</span>
<a
<gl-link
v-if="pipeline.flags.auto_devops"
v-popover="popoverOptions"
tabindex="0"
class="js-pipeline-url-autodevops badge badge-info autodevops-badge"
role="button">
role="button"
>
Auto DevOps
</a>
</gl-link>
<span
v-if="pipeline.flags.stuck"
class="js-pipeline-url-stuck badge badge-warning">
class="js-pipeline-url-stuck badge badge-warning"
>
stuck
</span>
</div>
......
<script>
import { GlButton, GlTooltipDirective, GlLoadingIcon } from '@gitlab-org/gitlab-ui';
import { s__, sprintf } from '~/locale';
import GlCountdown from '~/vue_shared/components/gl_countdown.vue';
import eventHub from '../event_hub';
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 {
directives: {
tooltip,
GlTooltip: GlTooltipDirective,
},
components: {
Icon,
GlCountdown,
GlButton,
GlLoadingIcon,
},
props: {
......@@ -59,14 +59,12 @@ export default {
</script>
<template>
<div class="btn-group">
<button
v-tooltip
<gl-button
v-gl-tooltip
:disabled="isLoading"
type="button"
class="dropdown-new btn btn-default js-pipeline-dropdown-manual-actions"
title="Manual job"
data-toggle="dropdown"
data-placement="top"
aria-label="Manual job"
>
<icon
......@@ -78,17 +76,16 @@ export default {
aria-hidden="true">
</i>
<gl-loading-icon v-if="isLoading" />
</button>
</gl-button>
<ul class="dropdown-menu dropdown-menu-right">
<li
v-for="action in actions"
:key="action.path"
>
<button
<gl-button
:class="{ disabled: isActionDisabled(action) }"
:disabled="isActionDisabled(action)"
type="button"
class="js-pipeline-action-link no-btn btn"
@click="onClickAction(action)"
>
......@@ -100,7 +97,7 @@ export default {
<icon name="clock" />
<gl-countdown :end-date-string="action.scheduled_at" />
</span>
</button>
</gl-button>
</li>
</ul>
</div>
......
<script>
import tooltip from '../../vue_shared/directives/tooltip';
import Icon from '../../vue_shared/components/icon.vue';
import { GlLink, GlButton, GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import Icon from '~/vue_shared/components/icon.vue';
export default {
directives: {
tooltip,
GlTooltip: GlTooltipDirective,
},
components: {
Icon,
GlLink,
GlButton,
},
props: {
artifacts: {
......@@ -22,11 +24,10 @@ export default {
class="btn-group"
role="group"
>
<button
v-tooltip
class="dropdown-toggle btn btn-default build-artifacts js-pipeline-dropdown-download"
<gl-button
v-gl-tooltip
class="dropdown-toggle build-artifacts js-pipeline-dropdown-download"
title="Artifacts"
data-placement="top"
data-toggle="dropdown"
aria-label="Artifacts"
>
......@@ -36,18 +37,19 @@ export default {
aria-hidden="true"
>
</i>
</button>
</gl-button>
<ul class="dropdown-menu dropdown-menu-right">
<li
v-for="(artifact, i) in artifacts"
:key="i">
<a
:key="i"
>
<gl-link
:href="artifact.path"
rel="nofollow"
download
>
Download {{ artifact.name }} artifacts
</a>
</gl-link>
</li>
</ul>
</div>
......
......@@ -12,20 +12,18 @@
* css-class="btn-transparent"
* />
*/
import tooltip from '../directives/tooltip';
import { GlButton, GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import Icon from '../components/icon.vue';
export default {
name: 'ClipboardButton',
directives: {
tooltip,
GlTooltip: GlTooltipDirective,
},
components: {
GlButton,
Icon,
},
props: {
text: {
type: String,
......@@ -68,16 +66,12 @@ export default {
</script>
<template>
<button
v-tooltip
<gl-button
v-gl-tooltip="{ placement: tooltipPlacement, container: tooltipContainer }"
:class="cssClass"
:title="title"
:data-clipboard-text="clipboardText"
:data-container="tooltipContainer"
:data-placement="tooltipPlacement"
type="button"
class="btn"
>
<icon name="duplicate" />
</button>
</gl-button>
</template>
......@@ -595,7 +595,6 @@ $note-form-margin-left: 70px;
.discussion-actions {
float: right;
margin-left: 10px;
color: $gray-darkest;
@include media-breakpoint-down(xs) {
......
.pages-domain-list {
&-item {
position: relative;
display: flex;
align-items: center;
.domain-status {
......@@ -44,8 +42,9 @@
}
:first-child {
border-bottom-left-radius: $border-radius-default;
border-top-left-radius: $border-radius-default;
border-bottom-right-radius: 0;
border-top-right-radius: 0;
line-height: $gl-line-height;
}
:not(:first-child) {
......
......@@ -44,7 +44,7 @@ module Clusters
private
def install_script
["/usr/bin/kubectl apply -f #{ISTIO_CRDS} >/dev/null"]
["/usr/bin/kubectl apply -f #{ISTIO_CRDS}"]
end
end
end
......
......@@ -24,8 +24,12 @@ module Commits
start_project: @start_project,
start_branch_name: @start_branch)
rescue Gitlab::Git::Repository::CreateTreeError
error_msg = "Sorry, we cannot #{action.to_s.dasherize} this #{@commit.change_type_title(current_user)} automatically.
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."
act = action.to_s.dasherize
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
end
end
......
<<<<<<< HEAD
- 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_end = '</a>'.html_safe
=======
>>>>>>> upstream/master
%h4.prepend-top-0
= s_('ClusterIntegration|Add a Kubernetes cluster integration')
%p
= clusterable.sidebar_text
%p
= clusterable.learn_more_link
<<<<<<< HEAD
%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 }
=======
>>>>>>> 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|
= f.check_box :pages_https_only, class: 'float-left', disabled: pages_https_only_disabled?
.prepend-left-20
= f.label :pages_https_only, class: pages_https_only_label_class do
%strong Force domains with SSL certificates to use HTTPS
.form-group
.form-check
= 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
%strong Force domains with SSL certificates to use HTTPS
- unless pages_https_only_disabled?
.prepend-top-10
......
......@@ -4,9 +4,9 @@
.card
.card-header
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|
%li.pages-domain-list-item.unstyled
%li.pages-domain-list-item.list-group-item.d-flex.justify-content-between
- if verification_enabled
- tooltip, status = domain.unverified? ? [_('Unverified'), 'failed'] : [_('Verified'), 'success']
.domain-status.ci-status-icon.has-tooltip{ class: "ci-status-icon-#{status}", title: tooltip }
......@@ -16,7 +16,7 @@
= domain.url
= icon('external-link')
- if domain.subject
%p
%div
%span.badge.badge-gray Certificate: #{domain.subject}
- if domain.expired?
%span.badge.badge-danger Expired
......@@ -24,6 +24,6 @@
= 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"
- 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
#{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`.
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/custom_hooks/<hook_name>` - per project hook (this is already existing behavior)
1. `<project>.git/custom_hooks/<hook_name>.d/*` - per project hooks
......
......@@ -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 in a project.
......@@ -619,3 +660,4 @@ Example response:
[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-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
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
branch = find_branch!(params[:branch])
present user_project.repository.commit(branch.dereferenced_target), with: Entities::Commit
present user_project.repository.commit(result[:result]),
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
render_api_error!(result[:message], 400)
end
......
......@@ -6,8 +6,11 @@ require_relative 'redact_links/redactable'
module Gitlab
module BackgroundMigration
class RedactLinks
<<<<<<< HEAD
prepend EE::Gitlab::BackgroundMigration::RedactLinks
=======
>>>>>>> upstream/master
class Note < ActiveRecord::Base
include EachBatch
include ::Gitlab::BackgroundMigration::RedactLinks::Redactable
......
# frozen_string_literal: true
module Gitlab
module Conflict
class File
......
# frozen_string_literal: true
module Gitlab
module Conflict
class FileCollection
......
# frozen_string_literal: true
module Gitlab
class CrossProjectAccess
class CheckCollection
......
# frozen_string_literal: true
module Gitlab
class CrossProjectAccess
class CheckInfo
......
# frozen_string_literal: true
module Gitlab
class CrossProjectAccess
module ClassMethods
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
module BaseQuery
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class BaseStage
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class CodeEventFetcher < BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class CodeStage < BaseStage
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
module EventFetcher
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class IssueEventFetcher < BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class IssueStage < BaseStage
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
module MetricsTables
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class Permissions
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class PlanEventFetcher < BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class PlanStage < BaseStage
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class ProductionEventFetcher < IssueEventFetcher
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
module ProductionHelper
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class ProductionStage < BaseStage
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class ReviewEventFetcher < BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class ReviewStage < BaseStage
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
module Stage
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class StageSummary
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class StagingEventFetcher < BaseEventFetcher
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class StagingStage < BaseStage
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
module Summary
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
module Summary
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
module Summary
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
module Summary
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class TestEventFetcher < StagingEventFetcher
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class TestStage < BaseStage
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class Updater
......
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class UsageData
......
# frozen_string_literal: true
module Gitlab
module DataBuilder
module Build
......
# frozen_string_literal: true
module Gitlab
module DataBuilder
module Note
......
# frozen_string_literal: true
module Gitlab
module DataBuilder
module Pipeline
......
# frozen_string_literal: true
module Gitlab
module DataBuilder
module Push
......
# frozen_string_literal: true
module Gitlab
module DataBuilder
module Repository
......
# frozen_string_literal: true
module Gitlab
module DataBuilder
module WikiPage
......
# frozen_string_literal: true
module Gitlab
module Database
module ArelMethods
......
# frozen_string_literal: true
# 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.
module Gitlab
......
# frozen_string_literal: true
module Gitlab
module Database
module DateTime
......
# frozen_string_literal: true
module Gitlab
module Database
# 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
module Gitlab
module Database
......
# frozen_string_literal: true
module Gitlab
module Database
module MigrationHelpers
......
# frozen_string_literal: true
module Gitlab
module Database
module MultiThreadedMigration
......
# frozen_string_literal: true
module Gitlab
module Database
# 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
# of `Namespace` & `Project` models certain paths would become `reserved`.
#
......
# frozen_string_literal: true
module Gitlab
module Database
module RenameReservedPathsMigration
......
# frozen_string_literal: true
module Gitlab
module Database
module RenameReservedPathsMigration
......
# frozen_string_literal: true
module Gitlab
module Database
module RenameReservedPathsMigration
......
# frozen_string_literal: true
module Gitlab
module Database
module RenameReservedPathsMigration
......
# frozen_string_literal: true
module Gitlab
module Database
BINARY_TYPE =
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class BaseLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class CartfileLinker < MethodLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
module Cocoapods
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class ComposerJsonLinker < PackageJsonLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class GemfileLinker < MethodLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class GemspecLinker < MethodLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class GodepsJsonLinker < JsonLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class JsonLinker < BaseLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class MethodLinker < BaseLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class PackageJsonLinker < JsonLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class PodfileLinker < GemfileLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class PodspecJsonLinker < JsonLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class PodspecLinker < MethodLinker
......
# frozen_string_literal: true
module Gitlab
module DependencyLinker
class RequirementsTxtLinker < BaseLinker
......
# frozen_string_literal: true
module Gitlab
module Diff
class DiffRefs
......
# frozen_string_literal: true
module Gitlab
module Diff
class File
......
# frozen_string_literal: true
module Gitlab
module Diff
module FileCollection
......
# frozen_string_literal: true
module Gitlab
module Diff
module FileCollection
......
# frozen_string_literal: true
module Gitlab
module Diff
module FileCollection
......
# frozen_string_literal: true
module Gitlab
module Diff
module FileCollection
......
# frozen_string_literal: true
module Gitlab
module Diff
module Formatters
......
# frozen_string_literal: true
module Gitlab
module Diff
module Formatters
......
# frozen_string_literal: true
module Gitlab
module Diff
module Formatters
......
# frozen_string_literal: true
module Gitlab
module Diff
class Highlight
......
# frozen_string_literal: true
module Gitlab
module Diff
class ImagePoint
......
# frozen_string_literal: true
module Gitlab
module Diff
class InlineDiff
......@@ -71,7 +73,7 @@ module Gitlab
def find_changed_line_pairs(lines)
# Prefixes of all diff lines, indicating their types
# 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 = []
line_prefixes.scan(LINE_PAIRS_PATTERN) do
......
# frozen_string_literal: true
module Gitlab
module Diff
class InlineDiffMarkdownMarker < Gitlab::StringRangeMarker
......
# frozen_string_literal: true
module Gitlab
module Diff
class InlineDiffMarker < Gitlab::StringRangeMarker
......
# frozen_string_literal: true
module Gitlab
module Diff
class Line
......
# frozen_string_literal: true
# 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
# changes.
......
# frozen_string_literal: true
module Gitlab
module Diff
class ParallelDiff
......
# frozen_string_literal: true
module Gitlab
module Diff
class Parser
......
# frozen_string_literal: true
# Defines a specific location, identified by paths line numbers and image coordinates,
# within a specific diff, identified by start, head and base commit ids.
module Gitlab
......
# frozen_string_literal: true
# Finds the diff position in the new diff that corresponds to the same location
# specified by the provided position in the old diff.
module Gitlab
......
# frozen_string_literal: true
module Gitlab
class DowntimeCheck
class Message
......@@ -18,13 +20,13 @@ module Gitlab
def to_s
label = offline ? OFFLINE : ONLINE
message = "[#{label}]: #{path}"
message = ["[#{label}]: #{path}"]
if reason?
message += ":\n\n#{reason}\n\n"
message << ":\n\n#{reason}\n\n"
end
message
message.join
end
def reason?
......
# frozen_string_literal: true
module Gitlab
module Email
class AttachmentUploader
......
# frozen_string_literal: true
module Gitlab
module Email
module Hook
......
# frozen_string_literal: true
module Gitlab
module Email
module Hook
......
# frozen_string_literal: true
module Gitlab
module Email
module Hook
......
# frozen_string_literal: true
module Gitlab
module Email
module Hook
......
# frozen_string_literal: true
module Gitlab
module Email
class HTMLParser
......
# frozen_string_literal: true
module Gitlab
module Email
module Message
......@@ -116,7 +118,7 @@ module Gitlab
end
def subject
subject_text = '[Git]'
subject_text = ['[Git]']
subject_text << "[#{project.full_path}]"
subject_text << "[#{ref_name}]" if @action == :push
subject_text << ' '
......@@ -134,6 +136,8 @@ module Gitlab
subject_action[0] = subject_action[0].capitalize
subject_text << "#{subject_action} #{ref_type} #{ref_name}"
end
subject_text.join
end
end
end
......
# frozen_string_literal: true
require_dependency 'gitlab/email/handler'
# Inspired in great part by Discourse's Email::Receiver
......
# frozen_string_literal: true
# Inspired in great part by Discourse's Email::Receiver
module Gitlab
module Email
......
# frozen_string_literal: true
module Gitlab
module EtagCaching
class Middleware
......
# frozen_string_literal: true
module Gitlab
module EtagCaching
class Router
......
# frozen_string_literal: true
module Gitlab
module EtagCaching
class Store
......
......@@ -10,7 +10,7 @@ module Gitlab
def generate_script
<<~HEREDOC
set -eo pipefail
set -xeo pipefail
HEREDOC
end
......
......@@ -45,7 +45,7 @@ module Gitlab
def init_helm_command
command = %w[helm init] + init_command_flags
command.shelljoin + " >/dev/null\n"
command.shelljoin
end
def init_command_flags
......
......@@ -35,7 +35,7 @@ module Gitlab
private
def init_command
'helm init --client-only >/dev/null'
'helm init --client-only'
end
def repository_command
......@@ -43,13 +43,13 @@ module Gitlab
end
def repository_update_command
'helm repo update >/dev/null' if repository
'helm repo update' if repository
end
def install_command
command = ['helm', 'install', chart] + install_command_flags
command.shelljoin + " >/dev/null\n"
command.shelljoin
end
def preinstall_command
......
......@@ -36,7 +36,7 @@ module Gitlab
private
def init_command
'helm init --client-only >/dev/null'
'helm init --client-only'
end
def repository_command
......@@ -50,7 +50,7 @@ module Gitlab
" --namespace #{::Gitlab::Kubernetes::Helm::NAMESPACE}" \
" -f /data/helm/#{name}/config/values.yaml"
"helm upgrade #{name} #{chart}#{upgrade_flags} >/dev/null\n"
"helm upgrade #{name} #{chart}#{upgrade_flags}"
end
def optional_version_flag
......
......@@ -1861,9 +1861,12 @@ msgstr ""
msgid "ClusterIntegration|Kubernetes cluster details"
msgstr ""
<<<<<<< HEAD
msgid "ClusterIntegration|Kubernetes cluster health"
msgstr ""
=======
>>>>>>> upstream/master
msgid "ClusterIntegration|Kubernetes cluster is being created on Google Kubernetes Engine..."
msgstr ""
......
......@@ -126,6 +126,9 @@ function deploy() {
delete
cleanup
fi
create_secret
helm repo add gitlab https://charts.gitlab.io/
helm dep update .
......
......@@ -6,7 +6,7 @@ require "spec_helper"
# All those specs are moved out to this spec intentionally to keep them all in one place.
describe "User sorts things" do
include Spec::Support::Helpers::Features::SortingHelpers
include Helpers::DashboardHelper
include DashboardHelper
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.
......
......@@ -27,8 +27,6 @@ describe('clipboard button', () => {
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-placement')).toEqual('top');
expect(vm.$el.getAttribute('data-container')).toEqual(null);
});
it('should render provided classname', () => {
......
......@@ -8,7 +8,7 @@ describe Gitlab::Kubernetes::Helm::InitCommand do
let(:commands) do
<<~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
end
......@@ -22,7 +22,7 @@ describe Gitlab::Kubernetes::Helm::InitCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~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
end
end
......
......@@ -26,9 +26,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~EOS
helm init --client-only >/dev/null
helm init --client-only
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
helm repo update
#{helm_install_comand}
EOS
end
......@@ -43,7 +43,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
--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
-f /data/helm/app-name/config/values.yaml
EOS
end
end
......@@ -54,9 +54,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~EOS
helm init --client-only >/dev/null
helm init --client-only
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
helm repo update
#{helm_install_command}
EOS
end
......@@ -72,7 +72,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
--version 1.2.3
--set rbac.create\\=true,rbac.enabled\\=true
--namespace gitlab-managed-apps
-f /data/helm/app-name/config/values.yaml >/dev/null
-f /data/helm/app-name/config/values.yaml
EOS
end
end
......@@ -84,7 +84,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~EOS
helm init --client-only >/dev/null
helm init --client-only
#{helm_install_command}
EOS
end
......@@ -99,7 +99,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
--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
-f /data/helm/app-name/config/values.yaml
EOS
end
end
......@@ -111,9 +111,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~EOS
helm init --client-only >/dev/null
helm init --client-only
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
helm repo update
#{helm_install_command}
EOS
end
......@@ -122,7 +122,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
<<~EOS.strip
/bin/date
/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
end
end
......@@ -134,17 +134,16 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~EOS
helm init --client-only >/dev/null
helm init --client-only
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
helm repo update
#{helm_install_command}
EOS
end
let(:helm_install_command) do
<<~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/false
EOS
......@@ -158,9 +157,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~EOS
helm init --client-only >/dev/null
helm init --client-only
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
helm repo update
#{helm_install_command}
EOS
end
......@@ -171,7 +170,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
--name app-name
--version 1.2.3
--namespace gitlab-managed-apps
-f /data/helm/app-name/config/values.yaml >/dev/null
-f /data/helm/app-name/config/values.yaml
EOS
end
end
......@@ -183,9 +182,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~EOS
helm init --client-only >/dev/null
helm init --client-only
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
helm repo update
#{helm_install_command}
EOS
end
......@@ -199,7 +198,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
--tls-cert /data/helm/app-name/config/cert.pem
--tls-key /data/helm/app-name/config/key.pem
--namespace gitlab-managed-apps
-f /data/helm/app-name/config/values.yaml >/dev/null
-f /data/helm/app-name/config/values.yaml
EOS
end
end
......
......@@ -21,8 +21,8 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~EOS
helm init --client-only >/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 >/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
EOS
end
end
......@@ -33,8 +33,8 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~EOS
helm init --client-only >/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 >/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
EOS
end
end
......@@ -56,9 +56,9 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~EOS
helm init --client-only >/dev/null
helm init --client-only
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
end
end
......@@ -70,8 +70,8 @@ describe Gitlab::Kubernetes::Helm::UpgradeCommand do
it_behaves_like 'helm commands' do
let(:commands) do
<<~EOS
helm init --client-only >/dev/null
helm upgrade #{application.name} #{application.chart} --reset-values --install --namespace #{namespace} -f /data/helm/#{application.name}/config/values.yaml >/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
EOS
end
end
......
......@@ -1208,6 +1208,118 @@ describe API::Commits do
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
let(:commit) { project.repository.commit }
let(:commit_id) { commit.id }
......
......@@ -2,12 +2,12 @@ shared_examples 'helm commands' do
describe '#generate_script' do
let(:helm_setup) do
<<~EOS
set -eo pipefail
set -xeo pipefail
EOS
end
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
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