Commit 69bba0b3 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents b0988104 6f44eec9
......@@ -236,7 +236,7 @@
- name: postgres:11.6
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:5.0-alpine
- name: elasticsearch:7.11.1
- name: elasticsearch:7.14.2
command: ["elasticsearch", "-E", "discovery.type=single-node"]
variables:
POSTGRES_HOST_AUTH_METHOD: trust
......@@ -247,7 +247,7 @@
- name: postgres:12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:5.0-alpine
- name: elasticsearch:7.11.1
- name: elasticsearch:7.14.2
command: ["elasticsearch", "-E", "discovery.type=single-node"]
variables:
POSTGRES_HOST_AUTH_METHOD: trust
......@@ -258,7 +258,7 @@
- name: postgres:13
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:5.0-alpine
- name: elasticsearch:7.11.1
- name: elasticsearch:7.14.2
command: ["elasticsearch", "-E", "discovery.type=single-node"]
variables:
POSTGRES_HOST_AUTH_METHOD: trust
......
......@@ -11,7 +11,6 @@ import commitCIFile from '../../graphql/mutations/commit_ci_file.mutation.graphq
import updateCurrentBranchMutation from '../../graphql/mutations/update_current_branch.mutation.graphql';
import updateLastCommitBranchMutation from '../../graphql/mutations/update_last_commit_branch.mutation.graphql';
import getCurrentBranch from '../../graphql/queries/client/current_branch.graphql';
import getIsNewCiConfigFile from '../../graphql/queries/client/is_new_ci_config_file.graphql';
import getPipelineEtag from '../../graphql/queries/client/pipeline_etag.graphql';
import CommitForm from './commit_form.vue';
......@@ -41,18 +40,19 @@ export default {
required: false,
default: '',
},
isNewCiConfigFile: {
type: Boolean,
required: false,
default: false,
},
},
data() {
return {
commit: {},
isNewCiConfigFile: false,
isSaving: false,
};
},
apollo: {
isNewCiConfigFile: {
query: getIsNewCiConfigFile,
},
currentBranch: {
query: getCurrentBranch,
},
......
mutation updateAppStatus($appStatus: String) {
updateAppStatus(appStatus: $appStatus) @client
}
import produce from 'immer';
import axios from '~/lib/utils/axios_utils';
import getAppStatus from './queries/client/app_status.graphql';
import getCurrentBranchQuery from './queries/client/current_branch.graphql';
import getLastCommitBranchQuery from './queries/client/last_commit_branch.query.graphql';
......@@ -31,20 +31,22 @@ export const resolvers = {
__typename: 'CiLintContent',
}));
},
updateAppStatus: (_, { appStatus }, { cache }) => {
cache.writeQuery({
query: getAppStatus,
data: { appStatus },
});
},
updateCurrentBranch: (_, { currentBranch }, { cache }) => {
cache.writeQuery({
query: getCurrentBranchQuery,
data: produce(cache.readQuery({ query: getCurrentBranchQuery }), (draftData) => {
draftData.currentBranch = currentBranch;
}),
data: { currentBranch },
});
},
updateLastCommitBranch: (_, { lastCommitBranch }, { cache }) => {
cache.writeQuery({
query: getLastCommitBranchQuery,
data: produce(cache.readQuery({ query: getLastCommitBranchQuery }), (draftData) => {
draftData.lastCommitBranch = lastCommitBranch;
}),
data: { lastCommitBranch },
});
},
},
......
......@@ -3,8 +3,10 @@ import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import { resetServiceWorkersPublicPath } from '../lib/utils/webpack';
import { EDITOR_APP_STATUS_LOADING } from './constants';
import { CODE_SNIPPET_SOURCE_SETTINGS } from './components/code_snippet_alert/constants';
import getCurrentBranch from './graphql/queries/client/current_branch.graphql';
import getAppStatus from './graphql/queries/client/app_status.graphql';
import getLastCommitBranchQuery from './graphql/queries/client/last_commit_branch.query.graphql';
import getPipelineEtag from './graphql/queries/client/pipeline_etag.graphql';
import { resolvers } from './graphql/resolvers';
......@@ -64,6 +66,13 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
});
const { cache } = apolloProvider.clients.defaultClient;
cache.writeQuery({
query: getAppStatus,
data: {
appStatus: EDITOR_APP_STATUS_LOADING,
},
});
cache.writeQuery({
query: getCurrentBranch,
data: {
......
......@@ -17,11 +17,11 @@ import {
LOAD_FAILURE_UNKNOWN,
STARTER_TEMPLATE_NAME,
} from './constants';
import updateAppStatus from './graphql/mutations/update_app_status.mutation.graphql';
import getBlobContent from './graphql/queries/blob_content.graphql';
import getCiConfigData from './graphql/queries/ci_config.graphql';
import getAppStatus from './graphql/queries/client/app_status.graphql';
import getCurrentBranch from './graphql/queries/client/current_branch.graphql';
import getIsNewCiConfigFile from './graphql/queries/client/is_new_ci_config_file.graphql';
import getTemplate from './graphql/queries/get_starter_template.query.graphql';
import getLatestCommitShaQuery from './graphql/queries/latest_commit_sha.query.graphql';
import PipelineEditorHome from './pipeline_editor_home.vue';
......@@ -44,20 +44,20 @@ export default {
},
data() {
return {
starterTemplateName: STARTER_TEMPLATE_NAME,
ciConfigData: {},
currentCiFileContent: '',
failureType: null,
failureReasons: [],
initialCiFileContent: '',
isFetchingCommitSha: false,
isNewCiConfigFile: false,
lastCommittedContent: '',
currentCiFileContent: '',
successType: null,
showFailure: false,
showStartScreen: false,
showSuccess: false,
showFailure: false,
starterTemplate: '',
starterTemplateName: STARTER_TEMPLATE_NAME,
successType: null,
};
},
......@@ -179,9 +179,6 @@ export default {
currentBranch: {
query: getCurrentBranch,
},
isNewCiConfigFile: {
query: getIsNewCiConfigFile,
},
starterTemplate: {
query: getTemplate,
variables() {
......@@ -261,12 +258,10 @@ export default {
this.currentCiFileContent = this.lastCommittedContent;
},
setAppStatus(appStatus) {
this.$apollo.getClient().writeQuery({ query: getAppStatus, data: { appStatus } });
this.$apollo.mutate({ mutation: updateAppStatus, variables: { appStatus } });
},
setNewEmptyCiConfigFile() {
this.$apollo
.getClient()
.writeQuery({ query: getIsNewCiConfigFile, data: { isNewCiConfigFile: true } });
this.isNewCiConfigFile = true;
this.showStartScreen = false;
},
showErrorAlert({ type, reasons = [] }) {
......@@ -283,9 +278,7 @@ export default {
this.reportSuccess(type);
if (this.isNewCiConfigFile) {
this.$apollo
.getClient()
.writeQuery({ query: getIsNewCiConfigFile, data: { isNewCiConfigFile: false } });
this.isNewCiConfigFile = false;
}
// Keep track of the latest committed content to know
......
......@@ -125,6 +125,7 @@ export default {
:ref="$options.commitSectionRef"
:ci-file-content="ciFileContent"
:commit-sha="commitSha"
:is-new-ci-config-file="isNewCiConfigFile"
v-on="$listeners"
/>
<pipeline-editor-drawer />
......
......@@ -4097,6 +4097,26 @@ Input type: `SecurityPolicyProjectCreateInput`
| <a id="mutationsecuritypolicyprojectcreateerrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. |
| <a id="mutationsecuritypolicyprojectcreateproject"></a>`project` | [`Project`](#project) | Security Policy Project that was created. |
### `Mutation.securityPolicyProjectUnassign`
Unassigns the security policy project for the given project(`project_path`).
Input type: `SecurityPolicyProjectUnassignInput`
#### Arguments
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="mutationsecuritypolicyprojectunassignclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
| <a id="mutationsecuritypolicyprojectunassignprojectpath"></a>`projectPath` | [`ID!`](#id) | Full path of the project. |
#### Fields
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="mutationsecuritypolicyprojectunassignclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
| <a id="mutationsecuritypolicyprojectunassignerrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. |
### `Mutation.terraformStateDelete`
Input type: `TerraformStateDeleteInput`
......
......@@ -7,7 +7,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Insights **(ULTIMATE)**
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/725) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 12.0.
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/725) in GitLab 12.0.
Configure the Insights that matter for your groups. Explore data such as
triage hygiene, issues created or closed for a given period, average time for merge
......
......@@ -7,7 +7,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Value Stream Analytics **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196455) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.9 for groups.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196455) in GitLab 12.9 for groups.
Value Stream Analytics measures the time spent to go from an
[idea to production](https://about.gitlab.com/blog/2016/08/05/continuous-integration-delivery-and-deployment-with-gitlab/#from-idea-to-production-with-gitlab)
......@@ -99,8 +99,8 @@ sole discretion of GitLab Inc.
## How metrics are measured
> DORA API-based deployment metrics [moved](https://gitlab.com/gitlab-org/gitlab/-/issues/337256)
> to Premium in GitLab 14.3 for group-level Value Stream Analytics.
> DORA API-based deployment metrics for group-level Value Stream Analytics were
> [moved](https://gitlab.com/gitlab-org/gitlab/-/issues/337256) from GitLab Ultimate to GitLab Premium in 14.3.
The "Time" metrics near the top of the page are measured as follows:
......@@ -109,10 +109,9 @@ The "Time" metrics near the top of the page are measured as follows:
issue by [crosslinking in the commit message](../../project/issues/crosslinking_issues.md#from-commit-messages).)
- **Lead Time for Changes**: median time between when a merge request is merged and deployed to a
production environment for all merge requests deployed in the given time period.
[Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/340150) in GitLab 14.5 (**Ultimate**
tier only).
[Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/340150) in GitLab 14.5.
- **Lead Time for Changes**: median duration between merge request merge and deployment to a production environment for all MRs deployed in the given time period. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/340150) in GitLab 14.5 (**Ultimate** tier only).
- **Lead Time for Changes**: median duration between merge request merge and deployment to a production environment for all MRs deployed in the given time period. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/340150) in GitLab 14.5.
The "Recent Activity" metrics near the top of the page are measured as follows:
......@@ -417,8 +416,8 @@ To delete a custom value stream:
## Days to completion chart
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21631) in GitLab 12.6.
> - [Chart median line removed](https://gitlab.com/gitlab-org/gitlab/-/issues/235455) in GitLab 13.4.
> - [Totals replaced with averages](https://gitlab.com/gitlab-org/gitlab/-/issues/262070) in GitLab 13.12.
> - Chart median line [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/235455) in GitLab 13.4.
> - Totals [replaced](https://gitlab.com/gitlab-org/gitlab/-/issues/262070) with averages in GitLab 13.12.
This chart visually depicts the average number of days it takes for cycles to be completed.
......@@ -430,7 +429,7 @@ The chart data is limited to the last 500 items.
## Type of work - Tasks by type chart
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/32421) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.10.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/32421) in GitLab 12.10.
This chart shows a cumulative count of issues and merge requests per day.
......
......@@ -81,6 +81,7 @@ module EE
mount_mutation ::Mutations::Projects::SetComplianceFramework
mount_mutation ::Mutations::SecurityPolicy::CommitScanExecutionPolicy
mount_mutation ::Mutations::SecurityPolicy::AssignSecurityPolicyProject
mount_mutation ::Mutations::SecurityPolicy::UnassignSecurityPolicyProject
mount_mutation ::Mutations::SecurityPolicy::CreateSecurityPolicyProject
mount_mutation ::Mutations::Security::CiConfiguration::ConfigureDependencyScanning
mount_mutation ::Mutations::AuditEvents::ExternalAuditEventDestinations::Create
......
# frozen_string_literal: true
module Mutations
module SecurityPolicy
class UnassignSecurityPolicyProject < BaseMutation
include FindsProject
graphql_name 'SecurityPolicyProjectUnassign'
description 'Unassigns the security policy project for the given project(`project_path`).'
authorize :update_security_orchestration_policy_project
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Full path of the project.'
def resolve(args)
project = authorized_find!(args[:project_path])
result = unassign_project(project)
{
errors: result.success? ? [] : [result.message]
}
end
private
def unassign_project(project)
::Security::Orchestration::UnassignService
.new(project, current_user)
.execute
end
end
end
end
# frozen_string_literal: true
module Security
module Orchestration
class UnassignService < ::BaseService
def execute
return error(_('Policy project doesn\'t exist')) unless security_orchestration_policy_configuration
result = security_orchestration_policy_configuration.delete
return success if result
error(project.security_orchestration_policy_configuration.errors.full_messages.to_sentence)
end
private
delegate :security_orchestration_policy_configuration, to: :project
def success
ServiceResponse.success
end
def error(message)
ServiceResponse.error(message: message)
end
end
end
end
......@@ -62,5 +62,9 @@ FactoryBot.modify do
project.project_setting.save!
end
end
trait :with_security_orchestration_policy_configuration do
association :security_orchestration_policy_configuration, factory: :security_orchestration_policy_configuration
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Mutations::SecurityPolicy::UnassignSecurityPolicyProject do
let(:mutation) { described_class.new(object: nil, context: { current_user: current_user }, field: nil) }
describe '#resolve' do
let_it_be(:owner) { create(:user) }
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :with_security_orchestration_policy_configuration, namespace: owner.namespace) }
let_it_be(:project_without_policy_project) { create(:project, namespace: owner.namespace) }
let(:project_full_path) { project.full_path }
let(:current_user) { owner }
subject { mutation.resolve(project_path: project_full_path) }
context 'when permission is set for user' do
before do
stub_licensed_features(security_orchestration_policies: true)
end
context 'when user is an owner of the project' do
context 'when policy project is assigned to a project' do
it 'assigns the security policy project' do
result = subject
expect(result[:errors]).to be_empty
expect(project.reload.security_orchestration_policy_configuration).to be_blank
end
end
context 'when policy project is not assigned to a project' do
let(:project_full_path) { project_without_policy_project.full_path }
it 'respond with an error' do
result = subject
expect(result[:errors]).to match_array(["Policy project doesn't exist"])
end
end
end
context 'when user is not an owner' do
let(:current_user) { user }
before do
project.add_maintainer(user)
end
it 'raises exception' do
expect { subject }.to raise_error(Gitlab::Graphql::Errors::ResourceNotAvailable)
end
end
end
context 'when feature is not licensed' do
before do
stub_licensed_features(security_orchestration_policies: false)
end
it 'raises exception' do
expect { subject }.to raise_error(Gitlab::Graphql::Errors::ResourceNotAvailable)
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Security::Orchestration::UnassignService do
let_it_be(:project, reload: true) { create(:project, :with_security_orchestration_policy_configuration) }
let_it_be(:project_without_policy_project, reload: true) { create(:project) }
let(:service) { described_class.new(project, nil) }
describe '#execute' do
subject(:result) { service.execute }
context 'when policy project is assigned to a project' do
let(:service) { described_class.new(project, nil) }
it 'unassigns policy project from the project', :aggregate_failures do
expect(result).to be_success
expect(project.security_orchestration_policy_configuration).to be_destroyed
end
end
context 'when policy project is not assigned to a project' do
let(:service) { described_class.new(project_without_policy_project, nil) }
it 'respond with an error', :aggregate_failures do
expect(result).not_to be_success
expect(result.message).to eq("Policy project doesn't exist")
end
end
end
end
......@@ -13,8 +13,6 @@ class GitalyTestBuild
include GitalySetup
def run
set_bundler_config
# If we have the binaries from the cache, we can skip building them again
if File.exist?(tmp_tests_gitaly_bin_dir)
GitalySetup::LOGGER.debug "Gitaly binary already built. Skip building...\n"
......
......@@ -9,7 +9,6 @@ class GitalyTestSpawn
include GitalySetup
def run
set_bundler_config
install_gitaly_gems if ENV['CI']
check_gitaly_config!
......
......@@ -52,6 +52,7 @@ describe('Pipeline Editor | Commit section', () => {
const defaultProps = {
ciFileContent: mockCiYml,
commitSha: mockCommitSha,
isNewCiConfigFile: false,
};
const createComponent = ({ props = {}, options = {}, provide = {} } = {}) => {
......@@ -72,7 +73,6 @@ describe('Pipeline Editor | Commit section', () => {
data() {
return {
currentBranch: mockDefaultBranch,
isNewCiConfigFile: Boolean(options?.isNewCiConfigfile),
};
},
mocks: {
......@@ -115,7 +115,7 @@ describe('Pipeline Editor | Commit section', () => {
describe('when the user commits a new file', () => {
beforeEach(async () => {
createComponent({ options: { isNewCiConfigfile: true } });
createComponent({ props: { isNewCiConfigFile: true } });
await submitCommit();
});
......
......@@ -35,6 +35,17 @@ job_build:
- echo "build"
needs: ["job_test_2"]
`;
export const mockCiTemplateQueryResponse = {
data: {
project: {
ciTemplate: {
content: mockCiYml,
},
},
},
};
export const mockBlobContentQueryResponse = {
data: {
project: { repository: { blobs: { nodes: [{ rawBlob: mockCiYml }] } } },
......
......@@ -11,17 +11,21 @@ import PipelineEditorMessages from '~/pipeline_editor/components/ui/pipeline_edi
import { COMMIT_SUCCESS, COMMIT_FAILURE } from '~/pipeline_editor/constants';
import getBlobContent from '~/pipeline_editor/graphql/queries/blob_content.graphql';
import getCiConfigData from '~/pipeline_editor/graphql/queries/ci_config.graphql';
import getPipelineQuery from '~/pipeline_editor/graphql/queries/client/pipeline.graphql';
import getTemplate from '~/pipeline_editor/graphql/queries/get_starter_template.query.graphql';
import getLatestCommitShaQuery from '~/pipeline_editor/graphql/queries/latest_commit_sha.query.graphql';
import getPipelineQuery from '~/pipeline_editor/graphql/queries/client/pipeline.graphql';
import PipelineEditorApp from '~/pipeline_editor/pipeline_editor_app.vue';
import PipelineEditorHome from '~/pipeline_editor/pipeline_editor_home.vue';
import {
mockCiConfigPath,
mockCiConfigQueryResponse,
mockBlobContentQueryResponse,
mockBlobContentQueryResponseNoCiFile,
mockCiYml,
mockCiTemplateQueryResponse,
mockCommitSha,
mockCommitShaResults,
mockDefaultBranch,
......@@ -79,7 +83,7 @@ describe('Pipeline editor app component', () => {
});
};
const createComponentWithApollo = async ({ props = {}, provide = {}, stubs = {} } = {}) => {
const createComponentWithApollo = async ({ provide = {}, stubs = {} } = {}) => {
const handlers = [
[getBlobContent, mockBlobContentData],
[getCiConfigData, mockCiConfigData],
......@@ -87,7 +91,6 @@ describe('Pipeline editor app component', () => {
[getLatestCommitShaQuery, mockLatestCommitShaQuery],
[getPipelineQuery, mockPipelineQuery],
];
mockApollo = createMockApollo(handlers);
const options = {
......@@ -95,13 +98,15 @@ describe('Pipeline editor app component', () => {
data() {
return {
currentBranch: mockDefaultBranch,
lastCommitBranch: '',
appStatus: '',
};
},
mocks: {},
apolloProvider: mockApollo,
};
createComponent({ props, provide, stubs, options });
createComponent({ provide, stubs, options });
return waitForPromises();
};
......@@ -199,7 +204,7 @@ describe('Pipeline editor app component', () => {
it('shows a unkown error message', async () => {
const loadUnknownFailureText = 'The CI configuration was not loaded, please try again.';
mockBlobContentData.mockRejectedValueOnce(new Error('My error!'));
mockBlobContentData.mockRejectedValueOnce();
await createComponentWithApollo({
stubs: {
PipelineEditorMessages,
......@@ -344,6 +349,8 @@ describe('Pipeline editor app component', () => {
describe('when refetching content', () => {
beforeEach(() => {
mockBlobContentData.mockResolvedValue(mockBlobContentQueryResponse);
mockCiConfigData.mockResolvedValue(mockCiConfigQueryResponse);
mockLatestCommitShaQuery.mockResolvedValue(mockCommitShaResults);
});
......@@ -379,7 +386,10 @@ describe('Pipeline editor app component', () => {
const originalLocation = window.location.href;
beforeEach(() => {
mockBlobContentData.mockResolvedValue(mockBlobContentQueryResponse);
mockCiConfigData.mockResolvedValue(mockCiConfigQueryResponse);
mockLatestCommitShaQuery.mockResolvedValue(mockCommitShaResults);
mockGetTemplate.mockResolvedValue(mockCiTemplateQueryResponse);
setWindowLocation('?template=Android');
});
......
......@@ -9,6 +9,7 @@
require 'securerandom'
require 'socket'
require 'logger'
require 'bundler'
module GitalySetup
LOGGER = begin
......@@ -46,13 +47,26 @@ module GitalySetup
File.join(tmp_tests_gitlab_shell_dir, '.gitlab_shell_secret')
end
# Return the path of the vendored gems in <gdk>/gitaly, if exists
def gdk_gitaly_ruby_gem_path
gitaly_ruby_path = File.expand_path('../../../../gitaly/ruby/', __dir__)
bundle_config_path = File.join(gitaly_ruby_path, '.bundle')
bundle_path = Bundler::Settings.new(bundle_config_path).path
return if bundle_path.use_system_gems?
File.expand_path(bundle_path.explicit_path, gitaly_ruby_path)
end
def env
{
'HOME' => File.expand_path('tmp/tests'),
'GEM_PATH' => Gem.path.join(':'),
'BUNDLE_APP_CONFIG' => File.join(gemfile_dir, '.bundle'),
'BUNDLE_INSTALL_FLAGS' => nil,
'BUNDLE_IGNORE_CONFIG' => '1',
'BUNDLE_GEMFILE' => gemfile,
'BUNDLE_PATH' => bundle_path,
'BUNDLE_JOBS' => '4',
'BUNDLE_RETRY' => '3',
'RUBYOPT' => nil,
# Git hooks can't run during tests as the internal API is not running.
......@@ -61,17 +75,13 @@ module GitalySetup
}
end
# rubocop:disable GitlabSecurity/SystemCommandInjection
def set_bundler_config
system('bundle config set --local jobs 4', chdir: gemfile_dir)
system('bundle config set --local retry 3', chdir: gemfile_dir)
def bundle_path
if ENV['CI']
bundle_path = File.expand_path('../../../vendor/gitaly-ruby', __dir__)
system('bundle', 'config', 'set', '--local', 'path', bundle_path, chdir: gemfile_dir)
File.expand_path('../../../vendor/gitaly-ruby', __dir__)
else
gdk_gitaly_ruby_gem_path || File.expand_path(Bundler.configured_bundle_path.base_path)
end
end
# rubocop:enable GitlabSecurity/SystemCommandInjection
def config_path(service)
case service
......
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