Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-10-20 18:10:58 +00:00
parent 3a3e4bcbd1
commit dc0548daad
37 changed files with 180 additions and 780 deletions

View File

@ -1338,6 +1338,7 @@ lib/gitlab/checks/**
/**/javascripts/token_access/ @gitlab-org/ci-cd/verify/frontend
/**/javascripts/admin/application_settings/runner_token_expiration/ @gitlab-org/ci-cd/verify/frontend
/**/javascripts/usage_quotas/pipelines/ @gitlab-org/ci-cd/verify/frontend @sheldonled @aalakkad @kpalchyk
/**/javascripts/editor/schema/ci.json @gitlab-org/ci-cd/verify/frontend
## Verify:Runner Fleet Backend

View File

@ -153,6 +153,12 @@ Style/FrozenStringLiteralComment:
Style/SpecialGlobalVars:
EnforcedStyle: use_builtin_english_names
Style/SignalException:
Exclude:
# Danger defines its own `fail` method
- '**/*/Dangerfile'
- 'tooling/danger/**/*.rb'
RSpec/FilePath:
Exclude:
- 'qa/**/*'

View File

@ -826,7 +826,6 @@ RSpec/BeforeAllRoleAssignment:
- 'spec/controllers/projects/work_items_controller_spec.rb'
- 'spec/controllers/projects_controller_spec.rb'
- 'spec/controllers/repositories/lfs_storage_controller_spec.rb'
- 'spec/experiments/ios_specific_templates_experiment_spec.rb'
- 'spec/features/admin/admin_projects_spec.rb'
- 'spec/features/admin/users/user_spec.rb'
- 'spec/features/admin/users/users_spec.rb'

View File

@ -1063,7 +1063,6 @@ RSpec/ContextWording:
- 'spec/docs_screenshots/container_registry_docs.rb'
- 'spec/docs_screenshots/wiki_docs.rb'
- 'spec/experiments/application_experiment_spec.rb'
- 'spec/experiments/ios_specific_templates_experiment_spec.rb'
- 'spec/features/admin/admin_appearance_spec.rb'
- 'spec/features/admin/admin_disables_git_access_protocol_spec.rb'
- 'spec/features/admin/admin_hook_logs_spec.rb'

View File

@ -1771,7 +1771,6 @@ RSpec/FeatureCategory:
- 'spec/docs_screenshots/container_registry_docs.rb'
- 'spec/docs_screenshots/wiki_docs.rb'
- 'spec/experiments/in_product_guidance_environments_webide_experiment_spec.rb'
- 'spec/experiments/ios_specific_templates_experiment_spec.rb'
- 'spec/features/admin/dashboard_spec.rb'
- 'spec/features/groups/integrations/group_integrations_spec.rb'
- 'spec/features/milestones/user_views_milestones_spec.rb'

View File

@ -1,12 +1,12 @@
## Contributor License Agreement and Developer Certificate of Origin
Contributions to this repository are subject to the [Developer Certificate of Origin](https://docs.gitlab.com/ee/legal/developer_certificate_of_origin.html#developer-certificate-of-origin-version-11), or the [Individual](https://docs.gitlab.com/ee/legal/individual_contributor_license_agreement.html) or [Corporate](https://docs.gitlab.com/ee/legal/corporate_contributor_license_agreement.html) Contributor License Agreement, depending on where the contribution is made and on whose behalf:
Contributions to this repository are subject to the [Developer Certificate of Origin](doc/legal/developer_certificate_of_origin.md#developer-certificate-of-origin-version-11), or the [Individual](doc/legal/individual_contributor_license_agreement.md) or [Corporate](doc/legal/corporate_contributor_license_agreement.md) Contributor License Agreement, depending on where the contribution is made and on whose behalf:
- By submitting code contributions as an individual to the [`/ee` subdirectory](/ee) of this repository, you agree to the [Individual Contributor License Agreement](https://docs.gitlab.com/ee/legal/individual_contributor_license_agreement.html).
- By submitting code contributions as an individual to the [`/ee` subdirectory](/ee) of this repository, you agree to the [Individual Contributor License Agreement](doc/legal/individual_contributor_license_agreement.md).
- By submitting code contributions on behalf of a corporation to the [`/ee` subdirectory](/ee) of this repository, you agree to the [Corporate Contributor License Agreement](https://docs.gitlab.com/ee/legal/corporate_contributor_license_agreement.html).
- By submitting code contributions on behalf of a corporation to the [`/ee` subdirectory](/ee) of this repository, you agree to the [Corporate Contributor License Agreement](doc/legal/corporate_contributor_license_agreement.md).
- By submitting code contributions as an individual or on behalf of a corporation to any directory in this repository outside of the [`/ee` subdirectory](/ee), you agree to the [Developer Certificate of Origin](https://docs.gitlab.com/ee/legal/developer_certificate_of_origin.html#developer-certificate-of-origin-version-11).
- By submitting code contributions as an individual or on behalf of a corporation to any directory in this repository outside of the [`/ee` subdirectory](/ee), you agree to the [Developer Certificate of Origin](doc/legal/developer_certificate_of_origin.md#developer-certificate-of-origin-version-11).
All Documentation content that resides under the [`doc/` directory](/doc) of this
repository is licensed under Creative Commons:
@ -17,124 +17,76 @@ _This notice should stay as the first item in the `CONTRIBUTING.md` file._
## Contributing Documentation has been moved
As of July 2018, all the documentation for contributing to the GitLab project has been moved to a new location.
[View the new documentation](https://about.gitlab.com/community/contribute/) to find the latest information.
[View the documentation](https://about.gitlab.com/community/contribute/) to find the latest information.
## Contribute to GitLab
[View the new documentation](https://about.gitlab.com/community/contribute/) to find the latest information.
[View the documentation](https://about.gitlab.com/community/contribute/) to find the latest information.
## Security vulnerability disclosure
This [documentation](doc/development/contributing/index.md#security-vulnerability-disclosure) has been moved.
[View the documentation](doc/development/contributing/index.md#security-vulnerability-disclosure) to find the latest information.
## Code of Conduct
This [documentation](https://about.gitlab.com/contributing/code-of-conduct/) has been moved.
[View the documentation](https://about.gitlab.com/community/contribute/code-of-conduct/) to find the latest information.
## Closing policy for issues and merge requests
This [documentation](doc/development/contributing/index.md#closing-policy-for-issues-and-merge-requests) has been moved.
[View the documentation](doc/development/contributing/index.md#closing-policy-for-issues-and-merge-requests) to find the latest information.
## Helping others
This [documentation](doc/development/contributing/index.md#helping-others) has been moved.
[View the documentation](doc/development/contributing/index.md#helping-others) to find the latest information.
## I want to contribute!
[View the new documentation](https://about.gitlab.com/community/contribute/) to find the latest information.
[View the documentation](https://about.gitlab.com/community/contribute/) to find the latest information.
## Contribution Flow
This [documentation](doc/development/contributing/index.md) has been moved.
[View the documentation](doc/development/contributing/index.md) to find the latest information.
## Workflow labels
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
View the [issue workflow](doc/development/contributing/issue_workflow.md) documentation for these subjects:
### Type labels
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Subject labels
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Team labels
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Release Scoping labels
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Priority labels
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Severity labels
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
#### Severity impact guidance
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Label for community contributors
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
- Type labels
- Subject labels
- Team labels
- Release Scoping labels
- Priority labels
- Severity labels
- Severity impact guidance
- Labels for community contributors
## Implement design & UI elements
This [documentation](doc/development/contributing/design.md) has been moved.
[View the documentation](doc/development/contributing/design.md) to find the latest information.
## Issue tracker
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
View the [issue workflow](doc/development/contributing/issue_workflow.md) documentation for the following subjects.
### Issue triaging
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Feature proposals
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Issue tracker guidelines
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Issue weight
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Regression issues
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Technical and UX debt
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
### Stewardship
This [documentation](doc/development/contributing/issue_workflow.md) has been moved.
- Issue triaging
- Feature proposals
- Issue tracker guidelines
- Issue weight
- Regression issues
- Technical and UX debt
- Stewardship
## Merge requests
This [documentation](doc/development/contributing/merge_request_workflow.md) has been moved.
View the [merge request workflow](doc/development/contributing/merge_request_workflow.md) documentation for the following subjects.
### Merge request guidelines
This [documentation](doc/development/contributing/merge_request_workflow.md) has been moved.
### Contribution acceptance criteria
This [documentation](doc/development/contributing/merge_request_workflow.md) has been moved.
- Merge request guidelines
- Contribution acceptance criteria
## Definition of done
This [documentation](doc/development/contributing/merge_request_workflow.md) has been moved.
[View the documentation](doc/development/contributing/merge_request_workflow.md) to find the latest information.
## Style guides
This [documentation](doc/development/contributing/style_guides.md) has been moved.
[View the documentation](doc/development/contributing/style_guides.md) to find the latest information.

View File

@ -42,8 +42,6 @@ export const initPipelinesIndex = (selector = '#pipelines-list-vue') => {
projectId,
defaultBranchName,
params,
iosRunnersAvailable,
registrationToken,
fullPath,
visibilityPipelineIdType,
} = el.dataset;
@ -55,7 +53,6 @@ export const initPipelinesIndex = (selector = '#pipelines-list-vue') => {
artifactsEndpoint,
artifactsEndpointPlaceholder,
fullPath,
iosRunnersAvailable: parseBoolean(iosRunnersAvailable),
manualActionsLimit: 50,
pipelineEditorPath,
pipelineSchedulesPath,
@ -84,7 +81,6 @@ export const initPipelinesIndex = (selector = '#pipelines-list-vue') => {
newPipelinePath,
params: JSON.parse(params),
projectId,
registrationToken,
resetCachePath,
store: this.store,
},

View File

@ -1,220 +0,0 @@
<script>
import { GlButton, GlCard, GlSprintf, GlLink, GlPopover, GlModalDirective } from '@gitlab/ui';
import { s__ } from '~/locale';
import { helpPagePath } from '~/helpers/help_page_helper';
import { mergeUrlParams, DOCS_URL } from '~/lib/utils/url_utility';
import RunnerInstructionsModal from '~/vue_shared/components/runner_instructions/runner_instructions_modal.vue';
import apolloProvider from '~/ci/pipeline_details/graphql/provider';
import CiTemplates from './ci_templates.vue';
export default {
components: {
GlButton,
GlCard,
GlSprintf,
GlLink,
GlPopover,
RunnerInstructionsModal,
CiTemplates,
},
directives: {
GlModalDirective,
},
inject: ['pipelineEditorPath', 'iosRunnersAvailable'],
props: {
registrationToken: {
type: String,
required: false,
default: null,
},
},
apolloProvider,
iOSTemplateName: 'iOS-Fastlane',
modalId: 'runner-instructions-modal',
runnerDocsLink: `${DOCS_URL}/runner/install/osx`,
whatElseLink: helpPagePath('ci/index.md'),
i18n: {
title: s__('Pipelines|Get started with GitLab CI/CD'),
subtitle: s__('Pipelines|Building for iOS?'),
explanation: s__("Pipelines|We'll walk you through how to deploy to iOS in two easy steps."),
runnerSetupTitle: s__('Pipelines|1. Set up a runner'),
runnerSetupButton: s__('Pipelines|Set up a runner'),
runnerSetupBodyUnfinished: s__(
'Pipelines|GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline.',
),
runnerSetupBodyFinished: s__(
'Pipelines|You have runners available to run your job now. No need to do anything else.',
),
runnerSetupPopoverTitle: s__(
"Pipelines|Let's get that runner set up! %{emojiStart}tada%{emojiEnd}",
),
runnerSetupPopoverBodyLine1: s__(
'Pipelines|Follow these instructions to install GitLab Runner on macOS.',
),
runnerSetupPopoverBodyLine2: s__(
'Pipelines|Need more information to set up your runner? %{linkStart}Check out our documentation%{linkEnd}.',
),
configurePipelineTitle: s__('Pipelines|2. Configure deployment pipeline'),
configurePipelineBody: s__("Pipelines|We'll guide you through a simple pipeline set-up."),
configurePipelineButton: s__('Pipelines|Configure pipeline'),
noWalkthroughTitle: s__("Pipelines|Don't need a guide? Jump in right away with a template."),
noWalkthroughExplanation: s__('Pipelines|Based on your project, we recommend this template:'),
notBuildingForIos: s__(
"Pipelines|Not building for iOS or not what you're looking for? %{linkStart}See what else%{linkEnd} GitLab CI/CD has to offer.",
),
},
data() {
return {
isModalShown: false,
isPopoverShown: false,
isRunnerSetupFinished: this.iosRunnersAvailable,
popoverTarget: `${this.$options.modalId}___BV_modal_content_`,
configurePipelineLink: mergeUrlParams(
{ template: this.$options.iOSTemplateName },
this.pipelineEditorPath,
),
};
},
computed: {
runnerSetupBodyText() {
return this.iosRunnersAvailable
? this.$options.i18n.runnerSetupBodyFinished
: this.$options.i18n.runnerSetupBodyUnfinished;
},
},
methods: {
showModal() {
this.isModalShown = true;
},
hideModal() {
this.togglePopover();
this.isRunnerSetupFinished = true;
},
togglePopover() {
this.isPopoverShown = !this.isPopoverShown;
},
},
};
</script>
<template>
<div>
<h2 class="gl-font-size-h2 gl-text-gray-900">{{ $options.i18n.title }}</h2>
<h3 class="gl-font-lg gl-text-gray-900 gl-mt-1">{{ $options.i18n.subtitle }}</h3>
<p>{{ $options.i18n.explanation }}</p>
<div class="gl-lg-display-flex">
<div class="gl-lg-display-flex gl-lg-w-25p gl-lg-pr-4 gl-mb-4">
<gl-card body-class="gl-display-flex gl-flex-grow-1">
<div
class="gl-display-flex gl-flex-grow-1 gl-flex-direction-column gl-justify-content-space-between gl-align-items-flex-start"
>
<div>
<div class="gl-py-5">
<gl-emoji
v-show="isRunnerSetupFinished"
class="gl-font-size-h2-xl"
data-name="white_check_mark"
data-testid="runner-setup-marked-completed"
/>
<gl-emoji
v-show="!isRunnerSetupFinished"
class="gl-font-size-h2-xl"
data-name="tools"
data-testid="runner-setup-marked-todo"
/>
</div>
<span class="gl-text-gray-800 gl-font-weight-bold">
{{ $options.i18n.runnerSetupTitle }}
</span>
<p class="gl-font-sm gl-mt-3">{{ runnerSetupBodyText }}</p>
</div>
<gl-button
v-if="!iosRunnersAvailable"
v-gl-modal-directive="$options.modalId"
category="primary"
variant="confirm"
@click="showModal"
>
{{ $options.i18n.runnerSetupButton }}
</gl-button>
<runner-instructions-modal
v-if="isModalShown"
:modal-id="$options.modalId"
:registration-token="registrationToken"
default-platform-name="osx"
@shown="togglePopover"
@hide="hideModal"
/>
<gl-popover
v-if="isPopoverShown"
:show="true"
:show-close-button="true"
:target="popoverTarget"
triggers="manual"
placement="left"
fallback-placement="clockwise"
>
<template #title>
<gl-sprintf :message="$options.i18n.runnerSetupPopoverTitle">
<template #emoji="{ content }">
<gl-emoji class="gl-ml-2" :data-name="content" />
</template>
</gl-sprintf>
</template>
<div class="gl-mb-5">
{{ $options.i18n.runnerSetupPopoverBodyLine1 }}
</div>
<gl-sprintf :message="$options.i18n.runnerSetupPopoverBodyLine2">
<template #link="{ content }">
<gl-link :href="$options.runnerDocsLink" target="_blank">{{ content }}</gl-link>
</template>
</gl-sprintf>
</gl-popover>
</div>
</gl-card>
</div>
<div class="gl-lg-display-flex gl-lg-w-25p gl-lg-pr-4 gl-mb-4">
<gl-card body-class="gl-display-flex gl-flex-grow-1">
<div
class="gl-display-flex gl-flex-grow-1 gl-flex-direction-column gl-justify-content-space-between gl-align-items-flex-start"
>
<div>
<div class="gl-py-5"><gl-emoji class="gl-font-size-h2-xl" data-name="tools" /></div>
<span class="gl-text-gray-800 gl-font-weight-bold">
{{ $options.i18n.configurePipelineTitle }}
</span>
<p class="gl-font-sm gl-mt-3">{{ $options.i18n.configurePipelineBody }}</p>
</div>
<gl-button
:disabled="!isRunnerSetupFinished"
category="primary"
variant="confirm"
data-testid="configure-pipeline-link"
:href="configurePipelineLink"
>
{{ $options.i18n.configurePipelineButton }}
</gl-button>
</div>
</gl-card>
</div>
</div>
<h3 class="gl-font-lg gl-text-gray-900 gl-mt-5">{{ $options.i18n.noWalkthroughTitle }}</h3>
<p>{{ $options.i18n.noWalkthroughExplanation }}</p>
<ci-templates
:filter-templates="/* eslint-disable @gitlab/vue-no-new-non-primitive-in-template */ [
$options.iOSTemplateName,
] /* eslint-enable @gitlab/vue-no-new-non-primitive-in-template */"
:disabled="!isRunnerSetupFinished"
/>
<p>
<gl-sprintf :message="$options.i18n.notBuildingForIos">
<template #link="{ content }">
<gl-link :href="$options.whatElseLink">{{ content }}</gl-link>
</template>
</gl-sprintf>
</p>
</div>
</template>

View File

@ -1,9 +1,7 @@
<script>
import { GlEmptyState } from '@gitlab/ui';
import { s__ } from '~/locale';
import GitlabExperiment from '~/experimentation/components/gitlab_experiment.vue';
import PipelinesCiTemplates from './pipelines_ci_templates.vue';
import IosTemplates from './ios_templates.vue';
export default {
i18n: {
@ -12,9 +10,7 @@ export default {
name: 'PipelinesEmptyState',
components: {
GlEmptyState,
GitlabExperiment,
PipelinesCiTemplates,
IosTemplates,
},
props: {
emptyStateSvgPath: {
@ -25,30 +21,15 @@ export default {
type: Boolean,
required: true,
},
registrationToken: {
type: String,
required: false,
default: null,
},
},
};
</script>
<template>
<div>
<gitlab-experiment v-if="canSetCi" name="ios_specific_templates">
<template #control>
<pipelines-ci-templates />
</template>
<template #candidate>
<ios-templates :registration-token="registrationToken" />
</template>
</gitlab-experiment>
<gl-empty-state
v-else
title=""
:svg-path="emptyStateSvgPath"
:svg-height="null"
:description="$options.i18n.noCiDescription"
/>
</div>
<pipelines-ci-templates v-if="canSetCi" />
<gl-empty-state
v-else
:svg-path="emptyStateSvgPath"
:svg-height="null"
:description="$options.i18n.noCiDescription"
/>
</template>

View File

@ -88,11 +88,6 @@ export default {
type: Object,
required: true,
},
registrationToken: {
type: String,
required: false,
default: null,
},
defaultVisibilityPipelineIdType: {
type: String,
required: false,
@ -404,7 +399,6 @@ export default {
v-else-if="stateToRender === $options.stateMap.emptyState"
:empty-state-svg-path="$options.noPipelinesSvgPath"
:can-set-ci="canCreatePipeline"
:registration-token="registrationToken"
/>
<gl-empty-state

View File

@ -1,32 +0,0 @@
# frozen_string_literal: true
class IosSpecificTemplatesExperiment < ApplicationExperiment
control
before_run(if: :skip_experiment) { throw(:abort) } # rubocop:disable Cop/BanCatchThrow
private
def skip_experiment
actor_not_able_to_create_pipelines? ||
project_targets_non_ios_platforms? ||
project_has_gitlab_ci? ||
project_has_pipelines?
end
def actor_not_able_to_create_pipelines?
!context.actor.is_a?(User) || !context.actor.can?(:create_pipeline, context.project)
end
def project_targets_non_ios_platforms?
context.project.project_setting.target_platforms.exclude?('ios')
end
def project_has_gitlab_ci?
context.project.has_ci? && context.project.builds_enabled?
end
def project_has_pipelines?
context.project.all_pipelines.count > 0
end
end

View File

@ -0,0 +1,27 @@
# frozen_string_literal: true
module Types
module Analytics
module CycleAnalytics
class ValueStreamType < BaseObject
graphql_name 'ValueStream'
authorize :read_cycle_analytics
field :name,
GraphQL::Types::String,
null: false,
description: 'Name of the value stream.'
field :namespace, Types::NamespaceType,
null: false,
description: 'Namespace the value stream belongs to.'
field :project, Types::ProjectType,
null: true,
description: 'Project the value stream belongs to, returns empty if it belongs to a group.',
alpha: { milestone: '15.6' }
end
end
end
end

View File

@ -3,5 +3,7 @@
module Types
class BaseInputObject < GraphQL::Schema::InputObject
prepend Gitlab::Graphql::CopyFieldDescription
argument_class ::Types::BaseArgument
end
end

View File

@ -71,7 +71,7 @@ module Ci
def pipelines_list_data(project, list_url)
artifacts_endpoint_placeholder = ':pipeline_artifacts_id'
data = {
{
endpoint: list_url,
project_id: project.id,
default_branch_name: project.default_branch,
@ -89,15 +89,6 @@ module Ci
full_path: project.full_path,
visibility_pipeline_id_type: visibility_pipeline_id_type
}
experiment(:ios_specific_templates, actor: current_user, project: project, sticky_to: project) do |e|
e.candidate do
data[:registration_token] = project.runners_token if can?(current_user, :register_project_runners, project)
data[:ios_runners_available] = (project.shared_runners_available? && Gitlab.com?).to_s
end
end
data
end
def visibility_pipeline_id_type

View File

@ -36,6 +36,12 @@ module Analytics
new(name: Analytics::CycleAnalytics::Stages::BaseService::DEFAULT_VALUE_STREAM_NAME, namespace: namespace)
end
def project
return unless namespace.is_a?(::Namespaces::ProjectNamespace)
namespace.project
end
private
def max_value_streams_count

View File

@ -0,0 +1,9 @@
# frozen_string_literal: true
module Analytics
module CycleAnalytics
class ValueStreamPolicy < ::BasePolicy
delegate { subject.namespace }
end
end
end

View File

@ -1,8 +0,0 @@
---
name: create_embeddings_with_vertex_ai
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/129930
rollout_issue_url:
milestone: '16.4'
type: development
group: group::duo chat
default_enabled: false

View File

@ -1,8 +0,0 @@
---
name: ios_specific_templates
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/84589
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/356398
milestone: "14.10"
type: experiment
group: group::activation
default_enabled: false

View File

@ -18,7 +18,7 @@ def check_database_dictionary_yaml(database_dictionary)
markdown(PARTITIONING_COMMENT, file: database_dictionary.path, line: mr_line.succ)
rescue Psych::Exception
# YAML could not be parsed, fail the build.
fail "#{helper.html_link(database_ditionary.path)} isn't valid YAML! #{SEE_DB_DOC}" # rubocop:disable Style/SignalException
fail "#{helper.html_link(database_ditionary.path)} isn't valid YAML! #{SEE_DB_DOC}"
rescue StandardError => e
warn "There was a problem trying to check the database dictionary file. Exception: #{e.class.name} - #{e.message}"
end

View File

@ -74,7 +74,7 @@ return if helper.mr_labels.include?(DATABASE_APPROVED_LABEL)
migration_testing_has_run = helper.mr_labels.include?(DATABASE_TESTING_RUN_LABEL)
community_contribution = helper.mr_labels.include?(COMMUNITY_CONTRIBUTION_LABEL)
if non_geo_migration_created && !migration_testing_has_run && !community_contribution
fail DB_MIGRATION_TESTING_REQUIRED_MESSAGE # rubocop:disable Style/SignalException
fail DB_MIGRATION_TESTING_REQUIRED_MESSAGE
end
if helper.mr_labels.include?('database') || database.changes.any?

View File

@ -3,5 +3,5 @@
unless experiments.class_files_removed?
msg = "This merge request removes experiment: `#{experiments.removed_experiments.join(',')}`" \
", please also remove the class file."
fail msg # rubocop:disable Style/SignalException
fail msg
end

View File

@ -1,5 +1,4 @@
# frozen_string_literal: true
# rubocop:disable Style/SignalException
SEE_DOC = "See the [feature flag documentation](https://docs.gitlab.com/ee/development/feature_flags#feature-flag-definition-and-validation)."
FEATURE_FLAG_LABEL = "feature flag"

View File

@ -1,5 +1,4 @@
# frozen_string_literal: true
# rubocop:disable Style/SignalException
PATTERNS = %w[
%a.btn.btn-

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
# rubocop:disable Style/SignalException
SEE_DOC = "see the [SaaS feature documentation](https://docs.gitlab.com/ee/development/ee_features.html#saas-only-feature)."
SUGGEST_MR_COMMENT = <<~SUGGEST_COMMENT.freeze
@ -57,5 +55,3 @@ end
added_files.each do |saas_feature|
check_yaml(saas_feature)
end
# rubocop:enable Style/SignalException

View File

@ -7461,6 +7461,32 @@ Input type: `UserSetNamespaceCommitEmailInput`
| <a id="mutationusersetnamespacecommitemailerrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. |
| <a id="mutationusersetnamespacecommitemailnamespacecommitemail"></a>`namespaceCommitEmail` | [`NamespaceCommitEmail`](#namespacecommitemail) | User namespace commit email after mutation. |
### `Mutation.valueStreamCreate`
Creates a value stream.
WARNING:
**Introduced** in 16.6.
This feature is an Experiment. It can be changed or removed at any time.
Input type: `ValueStreamCreateInput`
#### Arguments
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="mutationvaluestreamcreateclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
| <a id="mutationvaluestreamcreatename"></a>`name` | [`String!`](#string) | Value stream description. |
| <a id="mutationvaluestreamcreatenamespacepath"></a>`namespacePath` | [`ID!`](#id) | Full path of the namespace(project or group) the value stream is created in. |
#### Fields
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="mutationvaluestreamcreateclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
| <a id="mutationvaluestreamcreateerrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. |
| <a id="mutationvaluestreamcreatevaluestream"></a>`valueStream` | [`ValueStream`](#valuestream) | Created value stream. |
### `Mutation.vulnerabilitiesDismiss`
Input type: `VulnerabilitiesDismissInput`
@ -26138,6 +26164,16 @@ fields relate to interactions between the two entities.
| <a id="userstatusmessage"></a>`message` | [`String`](#string) | User status message. |
| <a id="userstatusmessagehtml"></a>`messageHtml` | [`String`](#string) | HTML of the user status message. |
### `ValueStream`
#### Fields
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="valuestreamname"></a>`name` | [`String!`](#string) | Name of the value stream. |
| <a id="valuestreamnamespace"></a>`namespace` | [`Namespace!`](#namespace) | Namespace the value stream belongs to. |
| <a id="valuestreamproject"></a>`project` **{warning-solid}** | [`Project`](#project) | **Introduced** in 15.6. This feature is an Experiment. It can be changed or removed at any time. Project the value stream belongs to, returns empty if it belongs to a group. |
### `ValueStreamAnalyticsMetric`
#### Fields
@ -32198,8 +32234,10 @@ A time-frame defined as a closed inclusive range of two dates.
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="unionedepicfilterinputauthorusername"></a>`authorUsername` | [`[String!]`](#string) | Filters epics that are authored by one of the given users. |
| <a id="unionedepicfilterinputlabelname"></a>`labelName` | [`[String!]`](#string) | Filters epics that have at least one of the given labels. |
| <a id="unionedepicfilterinputauthorusername"></a>`authorUsername` **{warning-solid}** | [`[String!]`](#string) | **Deprecated:** Use authorUsernames instead. Deprecated in 16.6. |
| <a id="unionedepicfilterinputauthorusernames"></a>`authorUsernames` | [`[String!]`](#string) | Filters epics that are authored by one of the given users. |
| <a id="unionedepicfilterinputlabelname"></a>`labelName` **{warning-solid}** | [`[String!]`](#string) | **Deprecated:** Use labelNames instead. Deprecated in 16.6. |
| <a id="unionedepicfilterinputlabelnames"></a>`labelNames` | [`[String!]`](#string) | Filters epics that have at least one of the given labels. |
### `UnionedIssueFilterInput`

View File

@ -34773,12 +34773,6 @@ msgstr ""
msgid "Pipelines|\"Hello world\" with GitLab CI"
msgstr ""
msgid "Pipelines|1. Set up a runner"
msgstr ""
msgid "Pipelines|2. Configure deployment pipeline"
msgstr ""
msgid "Pipelines|API"
msgstr ""
@ -34788,15 +34782,9 @@ msgstr ""
msgid "Pipelines|Auto DevOps"
msgstr ""
msgid "Pipelines|Based on your project, we recommend this template:"
msgstr ""
msgid "Pipelines|Build with confidence"
msgstr ""
msgid "Pipelines|Building for iOS?"
msgstr ""
msgid "Pipelines|By revoking a trigger you will break any processes making use of it. Are you sure?"
msgstr ""
@ -34812,9 +34800,6 @@ msgstr ""
msgid "Pipelines|Clear runner caches"
msgstr ""
msgid "Pipelines|Configure pipeline"
msgstr ""
msgid "Pipelines|Continuous integration and deployment template to test and deploy your %{name} project."
msgstr ""
@ -34830,9 +34815,6 @@ msgstr ""
msgid "Pipelines|Description"
msgstr ""
msgid "Pipelines|Don't need a guide? Jump in right away with a template."
msgstr ""
msgid "Pipelines|Edit"
msgstr ""
@ -34842,9 +34824,6 @@ msgstr ""
msgid "Pipelines|Failed to update. Please reload page to update the list of artifacts."
msgstr ""
msgid "Pipelines|Follow these instructions to install GitLab Runner on macOS."
msgstr ""
msgid "Pipelines|Full configuration"
msgstr ""
@ -34860,9 +34839,6 @@ msgstr ""
msgid "Pipelines|GitLab CI/CD can automatically build, test, and deploy your code. Let GitLab take care of time consuming tasks, so you can spend more time creating."
msgstr ""
msgid "Pipelines|GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline."
msgstr ""
msgid "Pipelines|Go to the pipeline editor"
msgstr ""
@ -34881,9 +34857,6 @@ msgstr ""
msgid "Pipelines|Learn the basics of pipelines and .yml files"
msgstr ""
msgid "Pipelines|Let's get that runner set up! %{emojiStart}tada%{emojiEnd}"
msgstr ""
msgid "Pipelines|Lint"
msgstr ""
@ -34896,15 +34869,9 @@ msgstr ""
msgid "Pipelines|More Information"
msgstr ""
msgid "Pipelines|Need more information to set up your runner? %{linkStart}Check out our documentation%{linkEnd}."
msgstr ""
msgid "Pipelines|No triggers have been created yet. Add one using the form above."
msgstr ""
msgid "Pipelines|Not building for iOS or not what you're looking for? %{linkStart}See what else%{linkEnd} GitLab CI/CD has to offer."
msgstr ""
msgid "Pipelines|Owner"
msgstr ""
@ -34932,9 +34899,6 @@ msgstr ""
msgid "Pipelines|Scheduled"
msgstr ""
msgid "Pipelines|Set up a runner"
msgstr ""
msgid "Pipelines|Something went wrong while cleaning runners cache."
msgstr ""
@ -35037,15 +35001,6 @@ msgstr ""
msgid "Pipelines|We'll continuously validate your pipeline configuration. The validation results will appear here."
msgstr ""
msgid "Pipelines|We'll guide you through a simple pipeline set-up."
msgstr ""
msgid "Pipelines|We'll walk you through how to deploy to iOS in two easy steps."
msgstr ""
msgid "Pipelines|You have runners available to run your job now. No need to do anything else."
msgstr ""
msgid "Pipelines|You should review the code thoroughly before running this pipeline with the parent project's CI/CD resources."
msgstr ""

View File

@ -1,62 +0,0 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe IosSpecificTemplatesExperiment do
subject do
described_class.new(actor: user, project: project) do |e|
e.candidate { true }
end.run
end
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :auto_devops_disabled) }
let!(:project_setting) { create(:project_setting, project: project, target_platforms: target_platforms) }
let(:target_platforms) { %w[ios] }
before do
stub_experiments(ios_specific_templates: :candidate)
project.add_developer(user) if user
end
it { is_expected.to be true }
describe 'skipping the experiment' do
context 'no actor' do
let_it_be(:user) { nil }
it { is_expected.to be_falsey }
end
context 'actor cannot create pipelines' do
before do
project.add_guest(user)
end
it { is_expected.to be_falsey }
end
context 'targeting a non iOS platform' do
let(:target_platforms) { [] }
it { is_expected.to be_falsey }
end
context 'project has a ci.yaml file' do
before do
allow(project).to receive(:has_ci?).and_return(true)
end
it { is_expected.to be_falsey }
end
context 'project has pipelines' do
before do
create(:ci_pipeline, project: project)
end
it { is_expected.to be_falsey }
end
end
end

View File

@ -805,29 +805,12 @@ RSpec.describe 'Pipelines', :js, feature_category: :continuous_integration do
describe 'Empty State' do
let(:project) { create(:project, :repository) }
context 'when `ios_specific_templates` is not enabled' do
before do
visit project_pipelines_path(project)
end
it 'renders empty state' do
expect(page).to have_content 'Try test template'
end
before do
visit project_pipelines_path(project)
end
describe 'when the `ios_specific_templates` experiment is enabled and the "Set up a runner" button is clicked' do
before do
stub_experiments(ios_specific_templates: :candidate)
project.project_setting.update!(target_platforms: %w[ios])
visit project_pipelines_path(project)
click_button 'Set up a runner'
end
it 'displays a modal with the macOS platform selected and an explanation popover' do
expect(page).to have_button 'macOS', class: 'selected'
expect(page).to have_selector('#runner-instructions-modal___BV_modal_content_')
expect(page).to have_selector('.popover')
end
it 'renders empty state' do
expect(page).to have_content 'Try test template'
end
end
end

View File

@ -1,133 +0,0 @@
import '~/commons';
import { nextTick } from 'vue';
import { GlPopover, GlButton } from '@gitlab/ui';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import RunnerInstructionsModal from '~/vue_shared/components/runner_instructions/runner_instructions_modal.vue';
import IosTemplates from '~/ci/pipelines_page/components/empty_state/ios_templates.vue';
import CiTemplates from '~/ci/pipelines_page/components/empty_state/ci_templates.vue';
const pipelineEditorPath = '/-/ci/editor';
const registrationToken = 'SECRET_TOKEN';
const iOSTemplateName = 'iOS-Fastlane';
describe('iOS Templates', () => {
let wrapper;
const createWrapper = (providedPropsData = {}) => {
return shallowMountExtended(IosTemplates, {
provide: {
pipelineEditorPath,
iosRunnersAvailable: true,
...providedPropsData,
},
propsData: {
registrationToken,
},
stubs: {
GlButton,
},
});
};
const findIosTemplate = () => wrapper.findComponent(CiTemplates);
const findRunnerInstructionsModal = () => wrapper.findComponent(RunnerInstructionsModal);
const findRunnerInstructionsPopover = () => wrapper.findComponent(GlPopover);
const findRunnerSetupTodoEmoji = () => wrapper.findByTestId('runner-setup-marked-todo');
const findRunnerSetupCompletedEmoji = () => wrapper.findByTestId('runner-setup-marked-completed');
const findSetupRunnerLink = () => wrapper.findByText('Set up a runner');
const configurePipelineLink = () => wrapper.findByTestId('configure-pipeline-link');
describe('when ios runners are not available', () => {
beforeEach(() => {
wrapper = createWrapper({ iosRunnersAvailable: false });
});
describe('the runner setup section', () => {
it('marks the section as todo', () => {
expect(findRunnerSetupTodoEmoji().isVisible()).toBe(true);
expect(findRunnerSetupCompletedEmoji().isVisible()).toBe(false);
});
it('renders the setup runner link', () => {
expect(findSetupRunnerLink().exists()).toBe(true);
});
it('renders the runner instructions modal with a popover once clicked', async () => {
findSetupRunnerLink().element.parentElement.click();
await nextTick();
expect(findRunnerInstructionsModal().exists()).toBe(true);
expect(findRunnerInstructionsModal().props('registrationToken')).toBe(registrationToken);
expect(findRunnerInstructionsModal().props('defaultPlatformName')).toBe('osx');
findRunnerInstructionsModal().vm.$emit('shown');
await nextTick();
expect(findRunnerInstructionsPopover().exists()).toBe(true);
});
});
describe('the configure pipeline section', () => {
it('has a disabled link button', () => {
expect(configurePipelineLink().props('disabled')).toBe(true);
});
});
describe('the ios-Fastlane template', () => {
it('renders the template', () => {
expect(findIosTemplate().props('filterTemplates')).toStrictEqual([iOSTemplateName]);
});
it('has a disabled link button', () => {
expect(findIosTemplate().props('disabled')).toBe(true);
});
});
});
describe('when ios runners are available', () => {
beforeEach(() => {
wrapper = createWrapper();
});
describe('the runner setup section', () => {
it('marks the section as completed', () => {
expect(findRunnerSetupTodoEmoji().isVisible()).toBe(false);
expect(findRunnerSetupCompletedEmoji().isVisible()).toBe(true);
});
it('does not render the setup runner link', () => {
expect(findSetupRunnerLink().exists()).toBe(false);
});
});
describe('the configure pipeline section', () => {
it('has an enabled link button', () => {
expect(configurePipelineLink().props('disabled')).toBe(false);
});
it('links to the pipeline editor with the right template', () => {
expect(configurePipelineLink().attributes('href')).toBe(
`${pipelineEditorPath}?template=${iOSTemplateName}`,
);
});
});
describe('the ios-Fastlane template', () => {
it('renders the template', () => {
expect(findIosTemplate().props('filterTemplates')).toStrictEqual([iOSTemplateName]);
});
it('has an enabled link button', () => {
expect(findIosTemplate().props('disabled')).toBe(false);
});
it('links to the pipeline editor with the right template', () => {
expect(configurePipelineLink().attributes('href')).toBe(
`${pipelineEditorPath}?template=${iOSTemplateName}`,
);
});
});
});
});

View File

@ -1,11 +1,8 @@
import '~/commons';
import { shallowMount } from '@vue/test-utils';
import { GlEmptyState } from '@gitlab/ui';
import { stubExperiments } from 'helpers/experimentation_helper';
import EmptyState from '~/ci/pipelines_page/components/empty_state/no_ci_empty_state.vue';
import GitlabExperiment from '~/experimentation/components/gitlab_experiment.vue';
import PipelinesCiTemplates from '~/ci/pipelines_page/components/empty_state/pipelines_ci_templates.vue';
import IosTemplates from '~/ci/pipelines_page/components/empty_state/ios_templates.vue';
describe('Pipelines Empty State', () => {
let wrapper;
@ -13,7 +10,6 @@ describe('Pipelines Empty State', () => {
const findIllustration = () => wrapper.find('img');
const findButton = () => wrapper.find('a');
const pipelinesCiTemplates = () => wrapper.findComponent(PipelinesCiTemplates);
const iosTemplates = () => wrapper.findComponent(IosTemplates);
const createWrapper = (props = {}) => {
wrapper = shallowMount(EmptyState, {
@ -30,40 +26,17 @@ describe('Pipelines Empty State', () => {
},
stubs: {
GlEmptyState,
GitlabExperiment,
},
});
};
describe('when user can configure CI', () => {
describe('when the ios_specific_templates experiment is active', () => {
beforeEach(() => {
stubExperiments({ ios_specific_templates: 'candidate' });
createWrapper();
});
it('should render the iOS templates', () => {
expect(iosTemplates().exists()).toBe(true);
});
it('should not render the CI/CD templates', () => {
expect(pipelinesCiTemplates().exists()).toBe(false);
});
beforeEach(() => {
createWrapper();
});
describe('when the ios_specific_templates experiment is inactive', () => {
beforeEach(() => {
stubExperiments({ ios_specific_templates: 'control' });
createWrapper();
});
it('should render the CI/CD templates', () => {
expect(pipelinesCiTemplates().exists()).toBe(true);
});
it('should not render the iOS templates', () => {
expect(iosTemplates().exists()).toBe(false);
});
it('should render the CI/CD templates', () => {
expect(pipelinesCiTemplates().exists()).toBe(true);
});
});

View File

@ -10,7 +10,8 @@ import {
import { mount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import { chunk } from 'lodash';
import { nextTick } from 'vue';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import mockPipelinesResponse from 'test_fixtures/pipelines/pipelines.json';
import setWindowLocation from 'helpers/set_window_location_helper';
import { TEST_HOST } from 'helpers/test_constants';
@ -36,10 +37,11 @@ import {
setIdTypePreferenceMutationResponse,
setIdTypePreferenceMutationResponseWithErrors,
} from 'jest/issues/list/mock_data';
import { stageReply } from 'jest/ci/pipeline_mini_graph/mock_data';
import { users, mockSearch, branches } from '../pipeline_details/mock_data';
Vue.use(VueApollo);
jest.mock('~/sentry/sentry_browser_wrapper');
jest.mock('~/alert');

View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Types::Analytics::CycleAnalytics::ValueStreamType, feature_category: :value_stream_management do
specify { expect(described_class.graphql_name).to eq('ValueStream') }
specify { expect(described_class).to require_graphql_authorizations(:read_cycle_analytics) }
specify { expect(described_class).to have_graphql_fields(:name, :namespace, :project) }
end

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Ci::PipelinesHelper do
RSpec.describe Ci::PipelinesHelper, feature_category: :continuous_integration do
include Devise::Test::ControllerHelpers
describe 'pipeline_warnings' do
@ -99,75 +99,6 @@ RSpec.describe Ci::PipelinesHelper do
:full_path,
:visibility_pipeline_id_type])
end
describe 'when the project is eligible for the `ios_specific_templates` experiment' do
let_it_be(:project) { create(:project, :auto_devops_disabled, shared_runners_enabled: false) }
let_it_be(:user) { create(:user) }
before do
allow(helper).to receive(:current_user).and_return(user)
project.add_developer(user)
create(:project_setting, project: project, target_platforms: %w[ios])
end
describe 'the `registration_token` attribute' do
subject { data[:registration_token] }
context 'when the `ios_specific_templates` experiment variant is control' do
before do
stub_experiments(ios_specific_templates: :control)
end
it { is_expected.to be_nil }
end
context 'when the `ios_specific_templates` experiment variant is candidate' do
before do
stub_experiments(ios_specific_templates: :candidate)
end
context 'when the user cannot register project runners' do
before do
allow(helper).to receive(:can?).with(user, :register_project_runners, project).and_return(false)
end
it { is_expected.to be_nil }
end
context 'when the user can register project runners' do
it { is_expected.to eq(project.runners_token) }
end
end
end
describe 'the `ios_runners_available` attribute', :saas do
subject { data[:ios_runners_available] }
context 'when the `ios_specific_templates` experiment variant is control' do
before do
stub_experiments(ios_specific_templates: :control)
end
it { is_expected.to be_nil }
end
context 'when the `ios_specific_templates` experiment variant is candidate' do
before do
stub_experiments(ios_specific_templates: :candidate)
end
context 'when shared runners are not enabled' do
it { is_expected.to eq('false') }
end
context 'when shared runners are enabled' do
let_it_be(:project) { create(:project, :auto_devops_disabled, shared_runners_enabled: true) }
it { is_expected.to eq('true') }
end
end
end
end
end
describe '#visibility_pipeline_id_type' do

View File

@ -99,4 +99,23 @@ RSpec.describe Analytics::CycleAnalytics::ValueStream, type: :model, feature_cat
it { is_expected.to be_custom }
end
end
describe '#project' do
subject(:value_stream) do
build(:cycle_analytics_value_stream, name: 'value_stream_1', namespace: namespace).project
end
context 'when namespace is a project' do
let_it_be(:project) { create(:project) }
let(:namespace) { project.project_namespace }
it { is_expected.to eq(project) }
end
context 'when namespace is a group' do
let_it_be(:namespace) { create(:group) }
it { is_expected.to be_nil }
end
end
end

View File

@ -3504,7 +3504,6 @@
- './spec/dependencies/omniauth_saml_spec.rb'
- './spec/experiments/application_experiment_spec.rb'
- './spec/experiments/in_product_guidance_environments_webide_experiment_spec.rb'
- './spec/experiments/ios_specific_templates_experiment_spec.rb'
- './spec/features/abuse_report_spec.rb'
- './spec/features/action_cable_logging_spec.rb'
- './spec/features/admin/admin_abuse_reports_spec.rb'

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
# rubocop:disable Style/SignalException
module Tooling
module Danger
module AnalyticsInstrumentation

View File

@ -56,7 +56,6 @@ module Tooling
Read the "QA e2e:package-and-test-ee" section for more details.
MSG
# rubocop:disable Style/SignalException
def check!
return unless valid_stable_branch?
@ -77,7 +76,6 @@ module Tooling
warn WARN_PACKAGE_AND_TEST_MESSAGE
end
end
# rubocop:enable Style/SignalException
def encourage_package_and_qa_execution?
valid_stable_branch? &&