Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-11-18 03:14:17 +00:00
parent d150848f7e
commit edd6fda56d
22 changed files with 115 additions and 191 deletions

View File

@ -18,7 +18,7 @@ review-cleanup:
start-review-app-pipeline: start-review-app-pipeline:
extends: extends:
- .review:rules:review-app-pipeline - .review:rules:start-review-app-pipeline
stage: review stage: review
needs: needs:
- job: build-assets-image - job: build-assets-image

View File

@ -76,9 +76,6 @@
.if-dot-com-gitlab-org-schedule: &if-dot-com-gitlab-org-schedule .if-dot-com-gitlab-org-schedule: &if-dot-com-gitlab-org-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_PIPELINE_SOURCE == "schedule"' if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_PIPELINE_SOURCE == "schedule"'
.if-dot-com-gitlab-org-schedule-child-pipeline: &if-dot-com-gitlab-org-schedule-child-pipeline
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_PIPELINE_SOURCE == "parent_pipeline" && $FREQUENCY'
.if-dot-com-ee-schedule: &if-dot-com-ee-schedule .if-dot-com-ee-schedule: &if-dot-com-ee-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_PIPELINE_SOURCE == "schedule"' if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_PIPELINE_SOURCE == "schedule"'
@ -1537,7 +1534,7 @@
################ ################
# Review rules # # Review rules #
################ ################
.review:rules:review-app-pipeline: .review:rules:start-review-app-pipeline:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
@ -1556,79 +1553,29 @@
.review:rules:review-build-cng: .review:rules:review-build-cng:
rules: rules:
- <<: *if-not-ee - when: always
when: never
- <<: *if-merge-request-labels-run-review-app
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
- <<: *if-dot-com-gitlab-org-schedule-child-pipeline
.review:rules:review-deploy: .review:rules:review-deploy:
rules: rules:
- <<: *if-not-ee - when: on_success
when: never
- <<: *if-merge-request-labels-run-review-app
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
- <<: *if-dot-com-gitlab-org-schedule-child-pipeline
allow_failure: true
.review:rules:review-performance: .review:rules:review-performance:
rules: rules:
- if: '$DAST_RUN == "true"' # Skip this job when DAST is run - if: '$DAST_RUN == "true"' # Skip this job when DAST is run
when: never when: never
- <<: *if-not-ee - <<: *if-merge-request-labels-run-review-app # we explicitely don't allow the job to fail in that case
when: never - <<: *if-dot-com-gitlab-org-merge-request # we explicitely don't allow the job to fail in that case
- <<: *if-merge-request-labels-run-review-app
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns changes: *ci-review-patterns
- <<: *if-dot-com-gitlab-org-merge-request - when: on_success
changes: *frontend-patterns
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
allow_failure: true
- <<: *if-dot-com-gitlab-org-schedule-child-pipeline
allow_failure: true allow_failure: true
.review:rules:review-delete-deployment: .review:rules:review-delete-deployment:
rules: rules:
- <<: *if-not-ee - when: on_success
when: never
- <<: *if-merge-request-labels-run-review-app
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
.review:rules:review-qa-smoke: .review:rules:review-qa-smoke:
rules: rules:
- <<: *if-not-ee - when: on_success
when: never
- <<: *if-merge-request-labels-run-review-app
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns
allow_failure: true
- <<: *if-dot-com-ee-schedule-child-pipeline
allow_failure: true
# The rule needs to be duplicated between `on_success` and `on_failure` # The rule needs to be duplicated between `on_success` and `on_failure`
# because the jobs `needs` the previous job to complete. # because the jobs `needs` the previous job to complete.
@ -1637,34 +1584,8 @@
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63844#note_599012559 # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63844#note_599012559
.review:rules:review-qa-smoke-report: .review:rules:review-qa-smoke-report:
rules: rules:
- <<: *if-not-ee - when: on_success
when: never - when: on_failure
- <<: *if-merge-request-labels-run-review-app
when: on_success
- <<: *if-merge-request-labels-run-review-app
when: on_failure
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns
when: on_success
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns
when: on_failure
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
when: on_success
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
when: on_failure
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
when: on_success
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
when: on_failure
- <<: *if-dot-com-ee-schedule-child-pipeline
when: on_success
- <<: *if-dot-com-ee-schedule-child-pipeline
when: on_failure
.review:rules:review-qa-reliable: .review:rules:review-qa-reliable:
rules: rules:
@ -1673,17 +1594,12 @@
.review:rules:review-qa-all: .review:rules:review-qa-all:
rules: rules:
- <<: *if-not-ee - <<: *if-merge-request-labels-run-review-app # we explicitely don't allow the job to fail in that case
when: never
- <<: *if-merge-request-labels-run-review-app
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns changes: *code-patterns
when: manual when: manual
allow_failure: true allow_failure: true # manual jobs needs to be allowd to fail, otherwise they block the pipeline
- <<: *if-dot-com-gitlab-org-merge-request - when: on_success
changes: *qa-patterns
allow_failure: true
- <<: *if-dot-com-ee-nightly-schedule-child-pipeline
allow_failure: true allow_failure: true
# The rule needs to be duplicated between `on_success` and `on_failure` # The rule needs to be duplicated between `on_success` and `on_failure`
@ -1693,29 +1609,9 @@
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63844#note_599012559 # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63844#note_599012559
.review:rules:review-qa-all-report: .review:rules:review-qa-all-report:
rules: rules:
- <<: *if-not-ee - when: on_success
when: never
- <<: *if-merge-request-labels-run-review-app
when: on_success
- <<: *if-merge-request-labels-run-review-app
when: on_failure
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns
when: manual
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - when: on_failure
changes: *qa-patterns
when: on_success
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
when: on_failure
allow_failure: true
- <<: *if-dot-com-ee-nightly-schedule-child-pipeline
when: on_success
allow_failure: true
- <<: *if-dot-com-ee-nightly-schedule-child-pipeline
when: on_failure
allow_failure: true allow_failure: true
.review:rules:review-cleanup: .review:rules:review-cleanup:
@ -1731,23 +1627,16 @@
.review:rules:review-stop: .review:rules:review-stop:
rules: rules:
- <<: *if-not-ee - when: manual
when: never
- <<: *if-merge-request-labels-run-review-app
when: manual
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
when: manual
allow_failure: true allow_failure: true
.review:rules:danger: .review:rules:danger:
rules: rules:
- if: '$CI_MERGE_REQUEST_IID' - <<: *if-merge-request
.review:rules:danger-local: .review:rules:danger-local:
rules: rules:
- if: '$CI_MERGE_REQUEST_IID' - <<: *if-merge-request
changes: *danger-patterns changes: *danger-patterns
############### ###############

View File

@ -236,6 +236,8 @@ export default {
}, },
statusTimeRanges, statusTimeRanges,
safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] }, safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] },
actionPrimary: { text: s__('SetStatusModal|Set status') },
actionSecondary: { text: s__('SetStatusModal|Remove status') },
}; };
</script> </script>
@ -243,14 +245,13 @@ export default {
<gl-modal <gl-modal
:title="s__('SetStatusModal|Set a status')" :title="s__('SetStatusModal|Set a status')"
:modal-id="modalId" :modal-id="modalId"
:ok-title="s__('SetStatusModal|Set status')" :action-primary="$options.actionPrimary"
:cancel-title="s__('SetStatusModal|Remove status')" :action-secondary="$options.actionSecondary"
ok-variant="success"
modal-class="set-user-status-modal" modal-class="set-user-status-modal"
@shown="setupEmojiListAndAutocomplete" @shown="setupEmojiListAndAutocomplete"
@hide="hideEmojiMenu" @hide="hideEmojiMenu"
@ok="setStatus" @primary="setStatus"
@cancel="removeStatus" @secondary="removeStatus"
> >
<div> <div>
<input <input

View File

@ -34,7 +34,7 @@ module Gitlab
end end
def file_name def file_name
"#{report_type}.json" "#{report_type.to_s.dasherize}-report-format.json"
end end
end end

View File

@ -70,7 +70,7 @@ browser_performance:
reports: reports:
browser_performance: browser-performance.json browser_performance: browser-performance.json
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$BROWSER_PERFORMANCE_DISABLED' - if: '$BROWSER_PERFORMANCE_DISABLED'
when: never when: never

View File

@ -70,7 +70,7 @@ browser_performance:
reports: reports:
browser_performance: browser-performance.json browser_performance: browser-performance.json
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$BROWSER_PERFORMANCE_DISABLED' - if: '$BROWSER_PERFORMANCE_DISABLED'
when: never when: never

View File

@ -9,6 +9,6 @@ cloud_formation:
rules: rules:
- if: '($AUTO_DEVOPS_PLATFORM_TARGET != "EC2") || ($AUTO_DEVOPS_PLATFORM_TARGET != "ECS")' - if: '($AUTO_DEVOPS_PLATFORM_TARGET != "EC2") || ($AUTO_DEVOPS_PLATFORM_TARGET != "ECS")'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
when: never when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'

View File

@ -30,7 +30,7 @@ dast_environment_deploy:
- if: $DAST_WEBSITE # we don't need to create a review app if a URL is already given - if: $DAST_WEBSITE # we don't need to create a review app if a URL is already given
when: never when: never
- if: $CI_COMMIT_BRANCH && - if: $CI_COMMIT_BRANCH &&
$CI_KUBERNETES_ACTIVE && ($CI_KUBERNETES_ACTIVE || $KUBECONFIG) &&
$GITLAB_FEATURES =~ /\bdast\b/ $GITLAB_FEATURES =~ /\bdast\b/
stop_dast_environment: stop_dast_environment:
@ -54,6 +54,6 @@ stop_dast_environment:
- if: $DAST_WEBSITE # we don't need to create a review app if a URL is already given - if: $DAST_WEBSITE # we don't need to create a review app if a URL is already given
when: never when: never
- if: $CI_COMMIT_BRANCH && - if: $CI_COMMIT_BRANCH &&
$CI_KUBERNETES_ACTIVE && ($CI_KUBERNETES_ACTIVE || $KUBECONFIG) &&
$GITLAB_FEATURES =~ /\bdast\b/ $GITLAB_FEATURES =~ /\bdast\b/
when: always when: always

View File

@ -25,7 +25,7 @@ review:
paths: [environment_url.txt, tiller.log] paths: [environment_url.txt, tiller.log]
when: always when: always
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
@ -47,7 +47,7 @@ stop_review:
action: stop action: stop
allow_failure: true allow_failure: true
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
@ -77,7 +77,7 @@ staging:
name: staging name: staging
url: http://$CI_PROJECT_PATH_SLUG-staging.$KUBE_INGRESS_BASE_DOMAIN url: http://$CI_PROJECT_PATH_SLUG-staging.$KUBE_INGRESS_BASE_DOMAIN
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
@ -105,7 +105,7 @@ canary:
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE != null'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
@ -137,7 +137,7 @@ production:
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE != null'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$STAGING_ENABLED' - if: '$STAGING_ENABLED'
when: never when: never
@ -155,7 +155,7 @@ production_manual:
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE != null'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_ENABLED' - if: '$INCREMENTAL_ROLLOUT_ENABLED'
when: never when: never
@ -194,7 +194,7 @@ production_manual:
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE != null'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "timed"' - if: '$INCREMENTAL_ROLLOUT_MODE == "timed"'
when: never when: never
@ -209,7 +209,7 @@ production_manual:
rules: rules:
- if: '$CI_DEPLOY_FREEZE != null' - if: '$CI_DEPLOY_FREEZE != null'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "manual"' - if: '$INCREMENTAL_ROLLOUT_MODE == "manual"'
when: never when: never

View File

@ -21,7 +21,7 @@ review:
paths: [environment_url.txt, tiller.log] paths: [environment_url.txt, tiller.log]
when: always when: always
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
@ -42,7 +42,7 @@ stop_review:
action: stop action: stop
allow_failure: true allow_failure: true
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
@ -71,7 +71,7 @@ staging:
name: staging name: staging
url: http://$CI_PROJECT_PATH_SLUG-staging.$KUBE_INGRESS_BASE_DOMAIN url: http://$CI_PROJECT_PATH_SLUG-staging.$KUBE_INGRESS_BASE_DOMAIN
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
@ -96,7 +96,7 @@ canary:
name: production name: production
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_INGRESS_BASE_DOMAIN url: http://$CI_PROJECT_PATH_SLUG.$KUBE_INGRESS_BASE_DOMAIN
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
@ -125,7 +125,7 @@ canary:
production: production:
<<: *production_template <<: *production_template
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$STAGING_ENABLED' - if: '$STAGING_ENABLED'
when: never when: never
@ -141,7 +141,7 @@ production_manual:
<<: *production_template <<: *production_template
allow_failure: false allow_failure: false
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_ENABLED' - if: '$INCREMENTAL_ROLLOUT_ENABLED'
when: never when: never
@ -177,7 +177,7 @@ production_manual:
resource_group: production resource_group: production
allow_failure: true allow_failure: true
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "timed"' - if: '$INCREMENTAL_ROLLOUT_MODE == "timed"'
when: never when: never
@ -190,7 +190,7 @@ production_manual:
.timed_rollout_template: &timed_rollout_template .timed_rollout_template: &timed_rollout_template
<<: *rollout_template <<: *rollout_template
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "manual"' - if: '$INCREMENTAL_ROLLOUT_MODE == "manual"'
when: never when: never

View File

@ -16,7 +16,7 @@ review_ec2:
rules: rules:
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "EC2"' - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "EC2"'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
@ -32,7 +32,7 @@ production_ec2:
rules: rules:
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "EC2"' - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "EC2"'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
when: never when: never
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never

View File

@ -42,7 +42,7 @@ review_ecs:
rules: rules:
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "ECS"' - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "ECS"'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
@ -58,7 +58,7 @@ stop_review_ecs:
rules: rules:
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "ECS"' - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "ECS"'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
@ -77,7 +77,7 @@ review_fargate:
rules: rules:
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "FARGATE"' - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "FARGATE"'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
@ -93,7 +93,7 @@ stop_review_fargate:
rules: rules:
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "FARGATE"' - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "FARGATE"'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
@ -107,7 +107,7 @@ production_ecs:
rules: rules:
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "ECS"' - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "ECS"'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
when: never when: never
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
@ -118,7 +118,7 @@ production_fargate:
rules: rules:
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "FARGATE"' - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "FARGATE"'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
when: never when: never
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never

View File

@ -72,7 +72,7 @@
rules: rules:
- if: '$MIGRATE_HELM_2TO3 != "true"' - if: '$MIGRATE_HELM_2TO3 != "true"'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
@ -89,7 +89,7 @@ review:helm-2to3:cleanup:
rules: rules:
- if: '$MIGRATE_HELM_2TO3 != "true" && $CLEANUP_HELM_2TO3 == null' - if: '$MIGRATE_HELM_2TO3 != "true" && $CLEANUP_HELM_2TO3 == null'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
@ -104,7 +104,7 @@ review:helm-2to3:cleanup:
rules: rules:
- if: '$MIGRATE_HELM_2TO3 != "true"' - if: '$MIGRATE_HELM_2TO3 != "true"'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
@ -119,7 +119,7 @@ staging:helm-2to3:cleanup:
rules: rules:
- if: '$MIGRATE_HELM_2TO3 != "true" && $CLEANUP_HELM_2TO3 == null' - if: '$MIGRATE_HELM_2TO3 != "true" && $CLEANUP_HELM_2TO3 == null'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
@ -132,7 +132,7 @@ staging:helm-2to3:cleanup:
rules: rules:
- if: '$MIGRATE_HELM_2TO3 != "true"' - if: '$MIGRATE_HELM_2TO3 != "true"'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: manual when: manual
@ -145,7 +145,7 @@ production:helm-2to3:cleanup:
rules: rules:
- if: '$MIGRATE_HELM_2TO3 != "true" && $CLEANUP_HELM_2TO3 == null' - if: '$MIGRATE_HELM_2TO3 != "true" && $CLEANUP_HELM_2TO3 == null'
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: manual when: manual

View File

@ -23,7 +23,7 @@ load_performance:
reports: reports:
load_performance: load-performance.json load_performance: load-performance.json
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never when: never
- if: '$LOAD_PERFORMANCE_DISABLED' - if: '$LOAD_PERFORMANCE_DISABLED'
when: never when: never

View File

@ -51,7 +51,7 @@ dast:
$REVIEW_DISABLED $REVIEW_DISABLED
when: never when: never
- if: $CI_COMMIT_BRANCH && - if: $CI_COMMIT_BRANCH &&
$CI_KUBERNETES_ACTIVE && ($CI_KUBERNETES_ACTIVE || $KUBECONFIG) &&
$GITLAB_FEATURES =~ /\bdast\b/ $GITLAB_FEATURES =~ /\bdast\b/
- if: $CI_COMMIT_BRANCH && - if: $CI_COMMIT_BRANCH &&
$GITLAB_FEATURES =~ /\bdast\b/ $GITLAB_FEATURES =~ /\bdast\b/

View File

@ -52,7 +52,7 @@ dast:
$DAST_API_SPECIFICATION == null $DAST_API_SPECIFICATION == null
when: never when: never
- if: $CI_COMMIT_BRANCH && - if: $CI_COMMIT_BRANCH &&
$CI_KUBERNETES_ACTIVE && ($CI_KUBERNETES_ACTIVE || $KUBECONFIG) &&
$GITLAB_FEATURES =~ /\bdast\b/ $GITLAB_FEATURES =~ /\bdast\b/
- if: $CI_COMMIT_BRANCH && - if: $CI_COMMIT_BRANCH &&
$DAST_WEBSITE $DAST_WEBSITE

View File

@ -20,6 +20,10 @@ module QA
@description = "My awesome project milestone." @description = "My awesome project milestone."
end end
def api_delete_path
"/projects/#{project.id}/milestones/#{id}"
end
def api_get_path def api_get_path
"/projects/#{project.id}/milestones/#{id}" "/projects/#{project.id}/milestones/#{id}"
end end

View File

@ -198,7 +198,7 @@ describe('SetStatusModalWrapper', () => {
}); });
it('clicking "removeStatus" clears the emoji and message fields', async () => { it('clicking "removeStatus" clears the emoji and message fields', async () => {
findModal().vm.$emit('cancel'); findModal().vm.$emit('secondary');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(findFormField('message').element.value).toBe(''); expect(findFormField('message').element.value).toBe('');
@ -206,7 +206,7 @@ describe('SetStatusModalWrapper', () => {
}); });
it('clicking "setStatus" submits the user status', async () => { it('clicking "setStatus" submits the user status', async () => {
findModal().vm.$emit('ok'); findModal().vm.$emit('primary');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
// set the availability status // set the availability status
@ -215,7 +215,7 @@ describe('SetStatusModalWrapper', () => {
// set the currentClearStatusAfter to 30 minutes // set the currentClearStatusAfter to 30 minutes
wrapper.find('[data-testid="thirtyMinutes"]').vm.$emit('click'); wrapper.find('[data-testid="thirtyMinutes"]').vm.$emit('click');
findModal().vm.$emit('ok'); findModal().vm.$emit('primary');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
const commonParams = { const commonParams = {
@ -237,7 +237,7 @@ describe('SetStatusModalWrapper', () => {
}); });
it('calls the "onUpdateSuccess" handler', async () => { it('calls the "onUpdateSuccess" handler', async () => {
findModal().vm.$emit('ok'); findModal().vm.$emit('primary');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.vm.onUpdateSuccess).toHaveBeenCalled(); expect(wrapper.vm.onUpdateSuccess).toHaveBeenCalled();
@ -253,7 +253,7 @@ describe('SetStatusModalWrapper', () => {
}); });
it('displays a toast success message', async () => { it('displays a toast success message', async () => {
findModal().vm.$emit('ok'); findModal().vm.$emit('primary');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect($toast.show).toHaveBeenCalledWith('Status updated'); expect($toast.show).toHaveBeenCalledWith('Status updated');
@ -270,7 +270,7 @@ describe('SetStatusModalWrapper', () => {
}); });
it('calls the "onUpdateFail" handler', async () => { it('calls the "onUpdateFail" handler', async () => {
findModal().vm.$emit('ok'); findModal().vm.$emit('primary');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.vm.onUpdateFail).toHaveBeenCalled(); expect(wrapper.vm.onUpdateFail).toHaveBeenCalled();
@ -286,7 +286,7 @@ describe('SetStatusModalWrapper', () => {
}); });
it('flashes an error message', async () => { it('flashes an error message', async () => {
findModal().vm.$emit('ok'); findModal().vm.$emit('primary');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(createFlash).toHaveBeenCalledWith({ expect(createFlash).toHaveBeenCalledWith({

View File

@ -27,9 +27,9 @@ RSpec.describe 'Jobs/Deploy.gitlab-ci.yml' do
end end
describe 'the created pipeline' do describe 'the created pipeline' do
let(:project) { create(:project, :repository) } let_it_be(:project, refind: true) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.owner }
let(:default_branch) { 'master' } let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch } let(:pipeline_ref) { default_branch }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) }
@ -43,23 +43,23 @@ RSpec.describe 'Jobs/Deploy.gitlab-ci.yml' do
allow(project).to receive(:default_branch).and_return(default_branch) allow(project).to receive(:default_branch).and_return(default_branch)
end end
context 'with no cluster' do context 'with no cluster or agent' do
it 'does not create any kubernetes deployment jobs' do it 'does not create any kubernetes deployment jobs' do
expect(build_names).to eq %w(placeholder) expect(build_names).to eq %w(placeholder)
end end
end end
context 'with only a disabled cluster' do context 'with only a disabled cluster' do
let!(:cluster) { create(:cluster, :project, :provided_by_gcp, enabled: false, projects: [project]) } before do
create(:cluster, :project, :provided_by_gcp, enabled: false, projects: [project])
end
it 'does not create any kubernetes deployment jobs' do it 'does not create any kubernetes deployment jobs' do
expect(build_names).to eq %w(placeholder) expect(build_names).to eq %w(placeholder)
end end
end end
context 'with an active cluster' do shared_examples_for 'pipeline with deployment jobs' do
let!(:cluster) { create(:cluster, :project, :provided_by_gcp, projects: [project]) }
context 'on master' do context 'on master' do
it 'by default' do it 'by default' do
expect(build_names).to include('production') expect(build_names).to include('production')
@ -218,5 +218,21 @@ RSpec.describe 'Jobs/Deploy.gitlab-ci.yml' do
end end
end end
end end
context 'with an agent' do
before do
create(:cluster_agent, project: project)
end
it_behaves_like 'pipeline with deployment jobs'
end
context 'with a cluster' do
before do
create(:cluster, :project, :provided_by_gcp, projects: [project])
end
it_behaves_like 'pipeline with deployment jobs'
end
end end
end end

View File

@ -148,9 +148,7 @@ RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do
it_behaves_like 'no Kubernetes deployment job' it_behaves_like 'no Kubernetes deployment job'
end end
context 'when the project has an active cluster' do shared_examples 'pipeline with Kubernetes jobs' do
let!(:cluster) { create(:cluster, :project, :provided_by_gcp, projects: [project]) }
describe 'deployment-related builds' do describe 'deployment-related builds' do
context 'on default branch' do context 'on default branch' do
it 'does not include rollout jobs besides production' do it 'does not include rollout jobs besides production' do
@ -233,6 +231,22 @@ RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do
end end
end end
end end
context 'when a cluster is attached' do
before do
create(:cluster, :project, :provided_by_gcp, projects: [project])
end
it_behaves_like 'pipeline with Kubernetes jobs'
end
context 'when project has an Agent is present' do
before do
create(:cluster_agent, project: project)
end
it_behaves_like 'pipeline with Kubernetes jobs'
end
end end
describe 'buildpack detection' do describe 'buildpack detection' do