提交 f8454d35 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/gitlab@master

上级 46c2316f
......@@ -27,7 +27,7 @@
review-docs-deploy:
extends: .review-docs
script:
- ./scripts/trigger-build-docs deploy
- ./scripts/trigger-build docs deploy
# Cleanup remote environment of gitlab-docs
review-docs-cleanup:
......@@ -36,7 +36,7 @@ review-docs-cleanup:
name: review-docs/$DOCS_GITLAB_REPO_SUFFIX-$CI_MERGE_REQUEST_IID
action: stop
script:
- ./scripts/trigger-build-docs cleanup
- ./scripts/trigger-build docs cleanup
docs lint:
extends:
......
......@@ -71,7 +71,7 @@ export default {
</template>
</blob-filepath>
<div class="file-actions d-none d-sm-flex">
<div class="gl-display-none gl-display-sm-flex">
<viewer-switcher v-if="showViewerSwitcher" v-model="viewer" />
<slot name="actions"></slot>
......
<script>
import { GlDeprecatedButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { GlButton, GlButtonGroup, GlTooltipDirective } from '@gitlab/ui';
import {
BTN_COPY_CONTENTS_TITLE,
BTN_DOWNLOAD_TITLE,
......@@ -10,9 +10,8 @@ import {
export default {
components: {
GlIcon,
GlButtonGroup,
GlDeprecatedButton,
GlButton,
},
directives: {
GlTooltip: GlTooltipDirective,
......@@ -48,7 +47,7 @@ export default {
</script>
<template>
<gl-button-group>
<gl-deprecated-button
<gl-button
v-if="!hasRenderError"
v-gl-tooltip.hover
:aria-label="$options.BTN_COPY_CONTENTS_TITLE"
......@@ -56,26 +55,29 @@ export default {
:disabled="copyDisabled"
data-clipboard-target="#blob-code-content"
data-testid="copyContentsButton"
>
<gl-icon name="copy-to-clipboard" :size="14" />
</gl-deprecated-button>
<gl-deprecated-button
icon="copy-to-clipboard"
category="primary"
variant="default"
/>
<gl-button
v-gl-tooltip.hover
:aria-label="$options.BTN_RAW_TITLE"
:title="$options.BTN_RAW_TITLE"
:href="rawPath"
target="_blank"
>
<gl-icon name="doc-code" :size="14" />
</gl-deprecated-button>
<gl-deprecated-button
icon="doc-code"
category="primary"
variant="default"
/>
<gl-button
v-gl-tooltip.hover
:aria-label="$options.BTN_DOWNLOAD_TITLE"
:title="$options.BTN_DOWNLOAD_TITLE"
:href="downloadUrl"
target="_blank"
>
<gl-icon name="download" :size="14" />
</gl-deprecated-button>
icon="download"
category="primary"
variant="default"
/>
</gl-button-group>
</template>
<script>
import { GlButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { GlButton, GlButtonGroup, GlTooltipDirective } from '@gitlab/ui';
import {
RICH_BLOB_VIEWER,
RICH_BLOB_VIEWER_TITLE,
......@@ -9,7 +9,6 @@ import {
export default {
components: {
GlIcon,
GlButtonGroup,
GlButton,
},
......@@ -52,19 +51,21 @@ export default {
:title="$options.SIMPLE_BLOB_VIEWER_TITLE"
:selected="isSimpleViewer"
:class="{ active: isSimpleViewer }"
icon="code"
category="primary"
variant="default"
@click="switchToViewer($options.SIMPLE_BLOB_VIEWER)"
>
<gl-icon name="code" :size="14" />
</gl-button>
/>
<gl-button
v-gl-tooltip.hover
:aria-label="$options.RICH_BLOB_VIEWER_TITLE"
:title="$options.RICH_BLOB_VIEWER_TITLE"
:selected="isRichViewer"
:class="{ active: isRichViewer }"
icon="document"
category="primary"
variant="default"
@click="switchToViewer($options.RICH_BLOB_VIEWER)"
>
<gl-icon name="document" :size="14" />
</gl-button>
/>
</gl-button-group>
</template>
......@@ -8,13 +8,32 @@ class BuildkiteService < CiService
ENDPOINT = "https://buildkite.com"
prop_accessor :project_url, :token
boolean_accessor :enable_ssl_verification
validates :project_url, presence: true, public_url: true, if: :activated?
validates :token, presence: true, if: :activated?
after_save :compose_service_hook, if: :activated?
def self.supported_events
%w(push merge_request tag_push)
end
# This is a stub method to work with deprecated API response
# TODO: remove enable_ssl_verification after 14.0
# https://gitlab.com/gitlab-org/gitlab/-/issues/222808
def enable_ssl_verification
true
end
# Since SSL verification will always be enabled for Buildkite,
# we no longer needs to store the boolean.
# This is a stub method to work with deprecated API param.
# TODO: remove enable_ssl_verification after 14.0
# https://gitlab.com/gitlab-org/gitlab/-/issues/222808
def enable_ssl_verification=(_value)
self.properties.delete('enable_ssl_verification') # Remove unused key
end
def webhook_url
"#{buildkite_endpoint('webhook')}/deliver/#{webhook_token}"
end
......@@ -22,7 +41,7 @@ class BuildkiteService < CiService
def compose_service_hook
hook = service_hook || build_service_hook
hook.url = webhook_url
hook.enable_ssl_verification = !!enable_ssl_verification
hook.enable_ssl_verification = true
hook.save
end
......@@ -49,7 +68,7 @@ class BuildkiteService < CiService
end
def description
'Continuous integration and deployments'
'Buildkite is a platform for running fast, secure, and scalable continuous integration pipelines on your own infrastructure'
end
def self.to_param
......@@ -60,15 +79,15 @@ class BuildkiteService < CiService
[
{ type: 'text',
name: 'token',
placeholder: 'Buildkite project GitLab token', required: true },
title: 'Integration Token',
help: 'This token will be provided when you create a Buildkite pipeline with a GitLab repository',
required: true },
{ type: 'text',
name: 'project_url',
placeholder: "#{ENDPOINT}/example/project", required: true },
{ type: 'checkbox',
name: 'enable_ssl_verification',
title: "Enable SSL verification" }
title: 'Pipeline URL',
placeholder: "#{ENDPOINT}/acme-inc/test-pipeline",
required: true }
]
end
......
---
title: "Update Buildkite Service for supported events, fields, and always verify SSL"
merge_request: 33697
author: "Juanito Fatas"
type: changed
# Set up an Audit Report with GraphQL
This page describes how you can use the GraphiQL explorer to set up an audit report
for a specific subset of users.
You can run the same query directly via a HTTP endpoint, using `cURL`. For more information, see our
guidance on getting started from the [command line](getting_started.md#command-line).
The [example users query](#set-up-the-graphiql-explorer) looks for a subset of users in
a GitLab instance either by username or
[global ID](../../development/api_graphql_styleguide.md#exposing-global-ids). The query
includes:
- [`pageInfo`](#pageinfo)
- [`nodes`](#nodes)
## pageInfo
This contains the data needed to implement pagination. GitLab uses cursor-based
[pagination](getting_started.md#pagination). For more information, see
[Pagination](https://graphql.org/learn/pagination/) in the GraphQL documentation.
## nodes
In a GraphQL query, `nodes` is used to represent a collection of [`nodes` on a graph](https://en.wikipedia.org/wiki/Vertex_(graph_theory)).
In this case, the collection of nodes is a collection of `User` objects. For each one,
we output:
- Their user's `id`.
- The `membership` fragment, which represents a Project or Group membership belonging
to that user. Outputting a fragment is denoted with the `...memberships` notation.
The GitLab GraphQL API is extensive and a large amount of data for a wide variety of entities can be output.
See the official [reference documentation](reference/index.md) for the most up-to-date information.
## Set up the GraphiQL explorer
This procedure presents a substantive example that you can copy and paste into GraphiQL
explorer. GraphiQL explorer is available for:
- GitLab.com users at [https://gitlab.com/-/graphql-explorer](https://gitlab.com/-/graphql-explorer).
- Self-managed users at `https://gitlab.example.com/-/graphql-explorer`.
1. Copy the following code excerpt:
```graphql
{
users(usernames: ["user1", "user2", "user3"]) {
pageInfo {
endCursor
startCursor
hasNextPage
}
nodes {
id
...memberships
}
}
}
fragment membership on MemberInterface {
createdAt
updatedAt
accessLevel {
integerValue
stringValue
}
createdBy {
id
}
}
fragment memberships on User {
groupMemberships {
nodes {
...membership
group {
id
name
}
}
}
projectMemberships {
nodes {
...membership
project {
id
name
}
}
}
}
```
1. Open the [GraphiQL explorer tool](https://gitlab.com/-/graphql-explorer).
1. Paste the `query` listed above into the left window of your GraphiQL explorer tool.
1. Click Play to get the result shown here:
![GraphiQL explorer search for boards](img/user_query_example_v13_2.png)
NOTE: **Note:**
[The GraphQL API returns a GlobalID, rather than a standard ID.](getting_started.md#queries-and-mutations) It also expects a GlobalID as an input rather than
a single integer.
This GraphQL query returns the groups and projects that the user has been *explicitly* made a member of.
Since the GraphiQL explorer uses the session token to authorize access to resources,
the output is limited to the projects and groups accessible to the currently signed-in user.
If you've signed in as an instance administrator, you would have access to all records, regardless of ownership.
For more information on:
- GraphQL specific entities, such as Fragments and Interfaces, see the official
[GraphQL documentation](https://graphql.org/learn/).
- Individual attributes, see the [GraphQL API Resources](reference/index.md).
......@@ -229,8 +229,8 @@ Parameters:
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `token` | string | true | Buildkite project GitLab token |
| `project_url` | string | true | `https://buildkite.com/example/project` |
| `enable_ssl_verification` | boolean | false | Enable SSL verification |
| `project_url` | string | true | Pipeline URL. For example, `https://buildkite.com/example/pipeline` |
| `enable_ssl_verification` | boolean | false | DEPRECATED: This parameter has no effect since SSL verification will always be enabled |
| `push_events` | boolean | false | Enable notifications for push events |
### Delete Buildkite service
......
......@@ -445,8 +445,8 @@ In case the review app URL returns 404, follow these steps to debug:
If you want to know the in-depth details, here's what's really happening:
1. You manually run the `review-docs-deploy` job in a merge request.
1. The job runs the [`scripts/trigger-build-docs`](https://gitlab.com/gitlab-org/gitlab/blob/master/scripts/trigger-build-docs)
script with the `deploy` flag, which in turn:
1. The job runs the [`scripts/trigger-build`](https://gitlab.com/gitlab-org/gitlab/blob/master/scripts/trigger-build)
script with the `docs deploy` flag, which in turn:
1. Takes your branch name and applies the following:
- The `docs-preview-` prefix is added.
- The product slug is used to know the project the review app originated
......
......@@ -505,14 +505,14 @@ To delete the underlying layers and images that aren't associated with any tags,
### Enable the cleanup policy
The cleanup policy is enabled for all projects by default.
Cleanup policies can be run on all projects, with these exceptions:
- For GitLab.com, the project must have been created before February, 2020.
- For GitLab.com, the project must have been created after 2020-02-22.
Support for projects created earlier
[is planned](https://gitlab.com/gitlab-org/gitlab/-/issues/196124).
- For self-managed GitLab instances, the project must have been created
before GitLab 12.7. However, an administrator can enable the cleanup policy
for all projects (even those created before 12.7) in
in GitLab 12.8 or later. However, an administrator can enable the cleanup policy
for all projects (even those created before 12.8) in
[GitLab application settings](../../../api/settings.md#change-application-settings)
by setting `container_expiration_policies_enable_historic_entries` to true.
......
......@@ -247,15 +247,15 @@ module API
required: true,
name: :project_url,
type: String,
desc: 'The buildkite project URL'
desc: 'The Buildkite pipeline URL'
},
{
required: false,
name: :enable_ssl_verification,
type: Boolean,
desc: 'Enable SSL verification for communication'
desc: 'DEPRECATED: This parameter has no effect since SSL verification will always be enabled'
}
],
],
'campfire' => [
{
required: true,
......
......@@ -29,10 +29,17 @@ module Trigger
end
class Base
def invoke!(post_comment: false, downstream_job_name: nil)
# Can be overridden
def self.access_token
ENV['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN']
end
def initialize
# gitlab-bot's token "GitLab multi-project pipeline polling"
Gitlab.private_token = access_token
Gitlab.private_token = self.class.access_token
end
def invoke!(post_comment: false, downstream_job_name: nil)
pipeline_variables = variables
puts "Triggering downstream pipeline on #{downstream_project_path}"
......@@ -74,14 +81,9 @@ module Trigger
raise NotImplementedError
end
# Must be overridden
# Can be overridden
def trigger_token
raise NotImplementedError
end
# Must be overridden
def access_token
raise NotImplementedError
ENV['CI_JOB_TOKEN']
end
# Can be overridden
......@@ -133,14 +135,6 @@ module Trigger
ENV['OMNIBUS_BRANCH'] || 'master'
end
def trigger_token
ENV['CI_JOB_TOKEN']
end
def access_token
ENV['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN']
end
def extra_variables
# Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA for omnibus checkouts due to pipeline for merged results
# and fallback to CI_COMMIT_SHA for the `detached` pipelines.
......@@ -176,10 +170,6 @@ module Trigger
ENV['BUILD_TRIGGER_TOKEN']
end
def access_token
ENV['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN']
end
def extra_variables
edition = Trigger.ee? ? 'EE' : 'CE'
......@@ -205,6 +195,108 @@ module Trigger
end
end
class Docs < Base
SUCCESS_MESSAGE = <<~MSG
=> You should now be able to preview your changes under the following URL:
%<app_url>s
=> For more information, see the documentation
=> https://docs.gitlab.com/ee/development/documentation/index.html#previewing-the-changes-live
=> If something doesn't work, drop a line in the #docs chat channel.
MSG
# Create a remote branch in gitlab-docs and immediately cancel the pipeline
# to avoid race conditions, since a triggered pipeline will also run right
# after the branch creation. This only happens the very first time a branch
# is created and will be skipped in subsequent runs. Read more in
# https://gitlab.com/gitlab-org/gitlab-docs/issues/154.
#
def deploy!
create_remote_branch!
cancel_latest_pipeline!
invoke!.wait!
display_success_message
end
#
# Remove a remote branch in gitlab-docs.
#
def cleanup!
Gitlab.delete_branch(downstream_project_path, ref)
puts "=> Remote branch '#{downstream_project_path}' deleted"
end
private
def downstream_project_path
ENV['DOCS_PROJECT_PATH'] || 'gitlab-org/gitlab-docs'
end
def ref
if ENV['CI_MERGE_REQUEST_IID'].nil?
"docs-preview-#{slug}-#{ENV['CI_COMMIT_REF_SLUG']}"
else
"docs-preview-#{slug}-#{ENV['CI_MERGE_REQUEST_IID']}"
end
end
def extra_variables
{
"BRANCH_#{slug.upcase}" => ENV['CI_COMMIT_REF_NAME']
}
end
def slug
case ENV['CI_PROJECT_PATH']
when 'gitlab-org/gitlab-foss'
'ce'
when 'gitlab-org/gitlab'
'ee'
when 'gitlab-org/gitlab-runner'
'runner'
when 'gitlab-org/omnibus-gitlab'
'omnibus'
when 'gitlab-org/charts/gitlab'
'charts'
end
end
def app_url
"http://#{ref}.#{ENV['DOCS_REVIEW_APPS_DOMAIN']}/#{slug}"
end
def create_remote_branch!
Gitlab.create_branch(downstream_project_path, ref, 'master')
puts "=> Remote branch '#{ref}' created"
end
def cancel_latest_pipeline!
pipelines = nil
# Wait until the pipeline is started
loop do
sleep 1
puts "=> Waiting for pipeline to start..."
pipelines = Gitlab.pipelines(downstream_project_path, { ref: ref })
break if pipelines.any?
end
# Get the first pipeline ID which should be the only one for the branch
pipeline_id = pipelines.first.id
# Cancel the pipeline
Gitlab.cancel_pipeline(downstream_project_path, pipeline_id)
rescue Gitlab::Error::BadRequest
puts "=> Remote branch '#{ref}' already exists!"
end
def display_success_message
format(SUCCESS_MESSAGE, app_url: app_url)
end
end
class CommitComment
def self.post!(downstream_pipeline)
Gitlab.create_commit_comment(
......@@ -282,6 +374,18 @@ when 'omnibus'
Trigger::Omnibus.new.invoke!(post_comment: true, downstream_job_name: 'Trigger:qa-test').wait!
when 'cng'
Trigger::CNG.new.invoke!.wait!
when 'docs'
docs_trigger = Trigger::Docs.new
case ARGV[1]
when 'deploy'
docs_trigger.deploy!
when 'cleanup'
docs_trigger.cleanup!
else
puts 'usage: trigger-build docs <deploy|cleanup>'
exit 1
end
else
puts "Please provide a valid option:
omnibus - Triggers a pipeline that builds the omnibus-gitlab package
......
#!/usr/bin/env ruby
require 'gitlab'
#
# Configure credentials to be used with gitlab gem
#
Gitlab.configure do |config|
config.endpoint = 'https://gitlab.com/api/v4'
config.private_token = ENV["DOCS_API_TOKEN"] # GitLab Docs bot access token with Developer access to gitlab-docs
end
#
# The remote docs project
#
GITLAB_DOCS_REPO = 'gitlab-org/gitlab-docs'.freeze
#
# This is the branch that will be created in the gitlab-docs project.
# Name it after the product we're previewing and the ID of the MR that
# kicked the review app.
#
def docs_branch
# Check if CI_MERGE_REQUEST_IID is present. This requires pipelines
# for merge requests to be enabled.
if ENV["CI_MERGE_REQUEST_IID"].nil?
"docs-preview-#{slug}-#{ENV["CI_COMMIT_REF_SLUG"]}"
else
"docs-preview-#{slug}-#{ENV["CI_MERGE_REQUEST_IID"]}"
end
end
#
# Create a remote branch in gitlab-docs and immediately cancel the pipeline
# to avoid race conditions, since a triggered pipeline will also run right
# after the branch creation. This only happens the very first time a branch
# is created and will be skipped in subsequent runs. Read more in
# https://gitlab.com/gitlab-org/gitlab-docs/issues/154.
#
def create_remote_branch
Gitlab.create_branch(GITLAB_DOCS_REPO, docs_branch, 'master')
puts "=> Remote branch '#{docs_branch}' created"
pipelines = nil
# Wait until the pipeline is started
loop do
sleep 1
puts "=> Waiting for pipeline to start..."
pipelines = Gitlab.pipelines(GITLAB_DOCS_REPO, { ref: docs_branch })
break if pipelines.any?
end
# Get the first pipeline ID which should be the only one for the branch
pipeline_id = pipelines.first.id
# Cancel the pipeline
Gitlab.cancel_pipeline(GITLAB_DOCS_REPO, pipeline_id)
rescue Gitlab::Error::BadRequest
puts "=> Remote branch '#{docs_branch}' already exists"
end
#
# Remove a remote branch in gitlab-docs
#
def remove_remote_branch
Gitlab.delete_branch(GITLAB_DOCS_REPO, docs_branch)
puts "=> Remote branch '#{docs_branch}' deleted"
end
#
# Define suffix in review app URL based on project
#
def slug
case ENV["CI_PROJECT_PATH"]
when 'gitlab-org/gitlab-foss'
'ce'
when 'gitlab-org/gitlab'
'ee'
when 'gitlab-org/gitlab-runner'
'runner'
when 'gitlab-org/omnibus-gitlab'
'omnibus'
when 'gitlab-org/charts/gitlab'
'charts'
end
end
#
# Overriding vars in https://gitlab.com/gitlab-org/gitlab-docs/blob/master/.gitlab-ci.yml
#
def param_name
"BRANCH_#{slug.upcase}"
end
#
# Trigger a pipeline in gitlab-docs
#
def trigger_pipeline
# The review app URL
app_url = "http://#{docs_branch}.#{ENV["DOCS_REVIEW_APPS_DOMAIN"]}/#{slug}"
# Create the cross project pipeline using CI_JOB_TOKEN
pipeline = Gitlab.run_trigger(GITLAB_DOCS_REPO, ENV["CI_JOB_TOKEN"], docs_branch, { param_name => ENV["CI_COMMIT_REF_NAME"] })
puts "=> Follow the status of the triggered pipeline:"
puts ""
puts pipeline.web_url
puts ""
puts "=> In a few minutes, you will be able to preview your changes under the following URL:"
puts ""
puts app_url
puts ""
puts "=> For more information, see the documentation"
puts "=> https://docs.gitlab.com/ee/development/documentation/index.html#previewing-the-changes-live"
puts ""
puts "=> If something doesn't work, drop a line in the #docs chat channel."
puts ""
end
#
# When the first argument is deploy then create the branch and trigger pipeline
# When it is 'stop', it deleted the remote branch. That way, we ensure there
# are no stale remote branches and the Review server doesn't fill.
#
case ARGV[0]
when 'deploy'
create_remote_branch
trigger_pipeline
when 'cleanup'
remove_remote_branch
else
puts "Please provide a valid option:
deploy - Creates the remote branch and triggers a pipeline
cleanup - Deletes the remote branch and stops the Review App"
end
......@@ -82,7 +82,7 @@ RSpec.describe Projects::ServicesController do
'active' => '1',
'push_events' => '1',
'token' => 'token',
'project_url' => 'http://test.com'
'project_url' => 'https://buildkite.com/organization/pipeline'
}
end
......
......@@ -9,7 +9,7 @@ exports[`Blob Header Default Actions rendering matches the snapshot 1`] = `
/>
<div
class="file-actions d-none d-sm-flex"
class="gl-display-none gl-display-sm-flex"
>
<viewer-switcher-stub
value="simple"
......
......@@ -6,7 +6,7 @@ import {
BTN_RAW_TITLE,
RICH_BLOB_VIEWER,
} from '~/blob/components/constants';
import { GlButtonGroup, GlDeprecatedButton } from '@gitlab/ui';
import { GlButtonGroup, GlButton } from '@gitlab/ui';
import { Blob } from './mock_data';
describe('Blob Header Default Actions', () => {
......@@ -26,7 +26,7 @@ describe('Blob Header Default Actions', () => {
beforeEach(() => {
createComponent();
btnGroup = wrapper.find(GlButtonGroup);
buttons = wrapper.findAll(GlDeprecatedButton);
buttons = wrapper.findAll(GlButton);
});
afterEach(() => {
......@@ -61,7 +61,7 @@ describe('Blob Header Default Actions', () => {
createComponent({
activeViewer: RICH_BLOB_VIEWER,
});
buttons = wrapper.findAll(GlDeprecatedButton);
buttons = wrapper.findAll(GlButton);
expect(buttons.at(0).attributes('disabled')).toBeTruthy();
});
......
......@@ -13,7 +13,7 @@ RSpec.describe BuildkiteService, :use_clean_rails_memory_store_caching do
project: project,
properties: {
service_hook: true,
project_url: 'https://buildkite.com/account-name/example-project',
project_url: 'https://buildkite.com/organization-name/example-pipeline',
token: 'secret-sauce-webhook-token:secret-sauce-status-token'
}
)
......@@ -45,11 +45,27 @@ RSpec.describe BuildkiteService, :use_clean_rails_memory_store_caching do
end
end
describe '.supported_events' do
it 'supports push, merge_request, and tag_push events' do
expect(service.supported_events).to eq %w(push merge_request tag_push)
end
end
describe 'commits methods' do
before do
allow(project).to receive(:default_branch).and_return('default-brancho')
end
it 'always activates SSL verification after saved' do
service.create_service_hook(enable_ssl_verification: false)
service.enable_ssl_verification = false
service.active = true
expect { service.save! }
.to change { service.service_hook.enable_ssl_verification }.from(false).to(true)
end
describe '#webhook_url' do
it 'returns the webhook url' do
expect(service.webhook_url).to eq(
......@@ -69,7 +85,7 @@ RSpec.describe BuildkiteService, :use_clean_rails_memory_store_caching do
describe '#build_page' do
it 'returns the correct build page' do
expect(service.build_page('2ab7834c', nil)).to eq(
'https://buildkite.com/account-name/example-project/builds?commit=2ab7834c'
'https://buildkite.com/organization-name/example-pipeline/builds?commit=2ab7834c'
)
end
end
......
......@@ -33,8 +33,8 @@ module StubConfiguration
allow(Gitlab.config).to receive_messages(to_settings(messages))
end
def stub_default_url_options(host: "localhost", protocol: "http")
url_options = { host: host, protocol: protocol }
def stub_default_url_options(host: "localhost", protocol: "http", script_name: nil)
url_options = { host: host, protocol: protocol, script_name: script_name }
allow(Rails.application.routes).to receive(:default_url_options).and_return(url_options)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册