Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab/ci/review-apps')
-rw-r--r--.gitlab/ci/review-apps/dast-api.gitlab-ci.yml14
-rw-r--r--.gitlab/ci/review-apps/main.gitlab-ci.yml18
-rw-r--r--.gitlab/ci/review-apps/qa.gitlab-ci.yml27
-rw-r--r--.gitlab/ci/review-apps/rules.gitlab-ci.yml41
4 files changed, 85 insertions, 15 deletions
diff --git a/.gitlab/ci/review-apps/dast-api.gitlab-ci.yml b/.gitlab/ci/review-apps/dast-api.gitlab-ci.yml
new file mode 100644
index 00000000000..e2f32f120af
--- /dev/null
+++ b/.gitlab/ci/review-apps/dast-api.gitlab-ci.yml
@@ -0,0 +1,14 @@
+include:
+ - template: DAST-API.gitlab-ci.yml
+
+dast_api:
+ variables:
+ DAST_API_PROFILE: Passive
+ DAST_API_GRAPHQL: /api/graphql
+ DAST_API_TARGET_URL: ${CI_ENVIRONMENT_URL}
+ DAST_API_OVERRIDES_ENV: "{\"headers\":{\"Authorization\":\"Bearer $REVIEW_APPS_ROOT_TOKEN\"}}"
+ needs: ["review-deploy"]
+ # Uncomment resource_group if DAST_API_PROFILE is changed to an active scan
+ # resource_group: dast_api_scan
+ rules:
+ - !reference [".reports:rules:schedule-dast", rules]
diff --git a/.gitlab/ci/review-apps/main.gitlab-ci.yml b/.gitlab/ci/review-apps/main.gitlab-ci.yml
index e28ffc82811..d3f5d014464 100644
--- a/.gitlab/ci/review-apps/main.gitlab-ci.yml
+++ b/.gitlab/ci/review-apps/main.gitlab-ci.yml
@@ -1,3 +1,6 @@
+default:
+ interruptible: true
+
stages:
- prepare
- deploy
@@ -11,17 +14,25 @@ include:
- local: .gitlab/ci/review-apps/rules.gitlab-ci.yml
- local: .gitlab/ci/review-apps/qa.gitlab-ci.yml
- local: .gitlab/ci/review-apps/dast.gitlab-ci.yml
+ - local: .gitlab/ci/review-apps/dast-api.gitlab-ci.yml
.base-before_script: &base-before_script
- source ./scripts/utils.sh
- source ./scripts/review_apps/review-apps.sh
- apt-get update && apt-get install -y jq
+dont-interrupt-me:
+ extends: .rules:dont-interrupt
+ stage: prepare
+ interruptible: false
+ script:
+ - echo "This jobs makes sure this pipeline won't be interrupted! See https://docs.gitlab.com/ee/ci/yaml/#interruptible."
+
review-build-cng-env:
extends:
- .default-retry
- .review:rules:review-build-cng
- image: ${GITLAB_DEPENDENCY_PROXY}ruby:3.0-alpine3.13
+ image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:3.0-alpine3.13
stage: prepare
needs: []
before_script:
@@ -90,6 +101,10 @@ review-deploy:
- .review:rules:review-deploy
stage: deploy
needs: ["review-build-cng"]
+ cache:
+ key: "review-deploy-dependencies-charts-${GITLAB_HELM_CHART_REF}-v1"
+ paths:
+ - "gitlab-${GITLAB_HELM_CHART_REF}"
before_script:
- export GITLAB_SHELL_VERSION=$(<GITLAB_SHELL_VERSION)
- export GITALY_VERSION=$(<GITALY_SERVER_VERSION)
@@ -100,7 +115,6 @@ review-deploy:
script:
- check_kube_domain
- download_chart
- - date
- deploy || (display_deployment_debug && exit 1)
- verify_deploy || exit 1
- disable_sign_ups || (delete_release && exit 1)
diff --git a/.gitlab/ci/review-apps/qa.gitlab-ci.yml b/.gitlab/ci/review-apps/qa.gitlab-ci.yml
index 21e6a8e42fb..0214f5ef3f2 100644
--- a/.gitlab/ci/review-apps/qa.gitlab-ci.yml
+++ b/.gitlab/ci/review-apps/qa.gitlab-ci.yml
@@ -1,7 +1,8 @@
include:
- project: gitlab-org/quality/pipeline-common
- ref: 1.2.2
+ ref: 1.3.0
file:
+ - /ci/base.gitlab-ci.yml
- /ci/allure-report.yml
- /ci/knapsack-report.yml
@@ -58,7 +59,7 @@ include:
download-knapsack-report:
extends:
- .bundle-base
- - .rules:app-or-qa-framework-changes-or-review-scenarios
+ - .rules:prepare-report
stage: prepare
script:
- bundle exec rake "knapsack:download[qa]"
@@ -134,7 +135,7 @@ review-performance:
e2e-test-report:
extends:
- .generate-allure-report-base
- - .rules:app-or-qa-framework-changes-or-review-scenarios
+ - .rules:prepare-report
stage: post-qa
variables:
ALLURE_JOB_NAME: e2e-review-qa
@@ -162,7 +163,7 @@ upload-knapsack-report:
delete-test-resources:
extends:
- .bundle-base
- - .rules:app-or-qa-framework-changes-or-review-scenarios
+ - .rules:prepare-report
stage: post-qa
variables:
QA_TEST_RESOURCES_FILE_PATTERN: $CI_PROJECT_DIR/qa/tmp/test-resources-*.json
@@ -172,3 +173,21 @@ delete-test-resources:
- bundle exec rake "test_resources:delete[$QA_TEST_RESOURCES_FILE_PATTERN]"
allow_failure: true
when: always
+
+notify-slack:
+ extends:
+ - .notify-slack-qa
+ - .qa-cache
+ - .rules:notify-slack
+ stage: post-qa
+ variables:
+ RUN_WITH_BUNDLE: "true"
+ QA_PATH: qa
+ ALLURE_JOB_NAME: e2e-review-qa
+ SLACK_ICON_EMOJI: ci_failing
+ STATUS_SYM: ☠️
+ STATUS: failed
+ TYPE: "(review-app) "
+ script:
+ - bundle exec gitlab-qa-report --prepare-stage-reports "$CI_PROJECT_DIR/qa/tmp/rspec-*.xml" # generate summary
+ - !reference [.notify-slack-qa, script]
diff --git a/.gitlab/ci/review-apps/rules.gitlab-ci.yml b/.gitlab/ci/review-apps/rules.gitlab-ci.yml
index 56d3731bb56..4e07f381bc9 100644
--- a/.gitlab/ci/review-apps/rules.gitlab-ci.yml
+++ b/.gitlab/ci/review-apps/rules.gitlab-ci.yml
@@ -19,6 +19,15 @@
.qa-framework-changes: &qa-framework-changes
if: $QA_FRAMEWORK_CHANGES == "true"
+.default-branch: &default-branch
+ if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
+
+.qa-manual: &qa-manual
+ when: manual
+ allow_failure: true
+ variables:
+ QA_TESTS: ""
+
.never-when-qa-framework-changes-or-no-specific-specs:
- <<: *qa-framework-changes
when: never
@@ -27,10 +36,24 @@
.never-when-specific-specs-always-when-qa-framework-changes:
- <<: *specific-specs
- when: never
+ when: manual
+ allow_failure: true
+ variables:
+ QA_TESTS: ""
- *qa-framework-changes
# ------------------------------------------
+# Prepare
+# ------------------------------------------
+.rules:dont-interrupt:
+ rules:
+ - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
+ allow_failure: true
+ - if: $CI_MERGE_REQUEST_IID
+ when: manual
+ allow_failure: true
+
+# ------------------------------------------
# Test
# ------------------------------------------
.rules:qa-smoke:
@@ -41,6 +64,7 @@
QA_TESTS: "" # unset QA_TESTS even if specific tests were inferred from stage label
- *qa-framework-changes
- if: $QA_SUITES =~ /Test::Instance::Smoke/
+ - *qa-manual
.rules:qa-blocking:
rules:
@@ -70,12 +94,11 @@
# ------------------------------------------
# Prepare/Report
# ------------------------------------------
-# if no rules for test execution are matched, pipeline will not have e2e test jobs
-# so we need to skip knapsack, allure and test resource deletion jobs as well
-.rules:app-or-qa-framework-changes-or-review-scenarios:
+.rules:prepare-report:
rules:
- - *app-changes
- - *qa-framework-changes
- - if: $QA_SUITES =~ /Test::Instance::Smoke/
- - if: $QA_SUITES =~ /Test::Instance::ReviewBlocking/
- - if: $QA_SUITES =~ /Test::Instance::ReviewNonBlocking/
+ - when: always
+
+.rules:notify-slack:
+ rules:
+ - <<: *default-branch
+ when: on_failure