2020-05-24 23:13:21 +05:30
review-cleanup :
2019-12-21 20:55:43 +05:30
extends :
- .default-retry
2020-03-13 15:44:24 +05:30
- .review:rules:review-cleanup
2022-08-27 11:52:29 +05:30
image : ${REVIEW_APPS_IMAGE}
2019-12-21 20:55:43 +05:30
stage : prepare
2023-04-23 21:23:45 +05:30
needs : [ ]
2019-12-21 20:55:43 +05:30
environment :
2023-01-13 00:05:48 +05:30
name : review/regular-cleanup
2023-03-04 22:38:38 +05:30
action : access
2023-04-23 21:23:45 +05:30
variables :
GIT_DEPTH : 1
2019-12-21 20:55:43 +05:30
before_script :
- source scripts/utils.sh
2023-03-04 22:38:38 +05:30
- !reference [".use-kube-context", before_script]
2019-12-21 20:55:43 +05:30
- install_gitlab_gem
2023-03-04 22:38:38 +05:30
- setup_gcloud
2019-12-21 20:55:43 +05:30
script :
2023-03-04 22:38:38 +05:30
- scripts/review_apps/automated_cleanup.rb || (scripts/slack review-apps-monitoring "☠️ \`${CI_JOB_NAME}\` failed! ☠️ See ${CI_JOB_URL} - <https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/blob/main/runbooks/review-apps.md#review-cleanup-job-failed|📗 RUNBOOK 📕>" warning "GitLab Bot" && exit 1);
2023-04-23 21:23:45 +05:30
review-stop :
extends :
- review-cleanup
- .review:rules:review-stop
environment :
name : review/${CI_COMMIT_REF_SLUG}${SCHEDULE_TYPE} # No separator for SCHEDULE_TYPE so it's compatible as before and looks nice without it
action : stop
resource_group : review/${CI_COMMIT_REF_SLUG}${SCHEDULE_TYPE} # CI_ENVIRONMENT_SLUG is not available here and we want this to be the same as the environment
before_script :
- source ./scripts/utils.sh
- source ./scripts/review_apps/review-apps.sh
- !reference [".use-kube-context", before_script]
script :
- retry delete_helm_release
2023-03-04 22:38:38 +05:30
.base-review-checks :
extends :
- .default-retry
image : ${REVIEW_APPS_IMAGE}
stage : prepare
before_script :
- source scripts/utils.sh
- setup_gcloud
- !reference [".use-kube-context", before_script]
review-k8s-resources-count-checks :
extends :
- .base-review-checks
- .review:rules:review-k8s-resources-count-checks
needs :
- job : review-cleanup
optional : true
environment :
name : review/k8s-resources-count-checks
action : verify
script :
- scripts/review_apps/k8s-resources-count-checks.sh || (scripts/slack review-apps-monitoring "☠️ \`${CI_JOB_NAME}\` failed! ☠️ See ${CI_JOB_URL} - <https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/blob/main/runbooks/review-apps.md#review-k8s-resources-count-checks-job-failed|📗 RUNBOOK 📕>" warning "GitLab Bot" && exit 1);
review-gcp-quotas-checks :
extends :
- .base-review-checks
- .review:rules:review-gcp-quotas-checks
needs : [ ]
environment :
name : review/gcp-quotas-checks
action : verify
script :
- ruby scripts/review_apps/gcp-quotas-checks.rb || (scripts/slack review-apps-monitoring "☠️ \`${CI_JOB_NAME}\` failed! ☠️ See ${CI_JOB_URL} - <https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/blob/main/runbooks/review-apps.md#review-gcp-quotas-checks-job-failed|📗 RUNBOOK 📕>" warning "GitLab Bot" && exit 1);
2020-04-22 19:07:51 +05:30
2021-11-18 22:05:49 +05:30
start-review-app-pipeline :
2020-07-28 23:09:34 +05:30
extends :
2022-01-26 12:08:38 +05:30
- .review:rules:start-review-app-pipeline
2023-01-13 00:05:48 +05:30
resource_group : review/${CI_COMMIT_REF_SLUG}${SCHEDULE_TYPE} # CI_ENVIRONMENT_SLUG is not available here and we want this to be the same as the environment
2021-11-18 22:05:49 +05:30
stage : review
2020-07-28 23:09:34 +05:30
needs :
2022-10-11 01:57:18 +05:30
- job : e2e-test-pipeline-generate
2021-11-18 22:05:49 +05:30
- job : build-assets-image
2020-07-28 23:09:34 +05:30
artifacts : false
2023-04-23 21:23:45 +05:30
# We do not want to have ALL global variables passed as trigger variables,
# as they cannot be overridden. See this issue for more context:
#
# https://gitlab.com/gitlab-org/gitlab/-/issues/387183
inherit :
variables :
- CHROME_VERSION
- REGISTRY_GROUP
- REGISTRY_HOST
- REVIEW_APPS_DOMAIN
- REVIEW_APPS_GCP_PROJECT
- REVIEW_APPS_GCP_REGION
- REVIEW_APPS_IMAGE
- RUBY_VERSION
2021-11-18 22:05:49 +05:30
# These variables are set in the pipeline schedules.
# They need to be explicitly passed on to the child pipeline.
# https://docs.gitlab.com/ee/ci/pipelines/multi_project_pipelines.html#pass-cicd-variables-to-a-downstream-pipeline-by-using-the-variables-keyword
2021-10-27 15:23:28 +05:30
variables :
2023-03-04 22:38:38 +05:30
# This is needed by `review-build-cng-env` (`.gitlab/ci/review-apps/main.gitlab-ci.yml`).
PARENT_PIPELINE_ID : $CI_PIPELINE_ID
2022-08-13 15:12:31 +05:30
SCHEDULE_TYPE : $SCHEDULE_TYPE
2021-11-18 22:05:49 +05:30
DAST_RUN : $DAST_RUN
2022-10-11 01:57:18 +05:30
SKIP_MESSAGE : Skipping review-app due to mr containing only quarantine changes!
2021-11-18 22:05:49 +05:30
trigger :
2022-10-11 01:57:18 +05:30
strategy : depend
2021-11-18 22:05:49 +05:30
include :
2022-08-27 11:52:29 +05:30
- artifact : review-app-pipeline.yml
2022-10-11 01:57:18 +05:30
job : e2e-test-pipeline-generate
2019-07-31 22:56:46 +05:30
danger-review :
2019-12-04 20:38:33 +05:30
extends :
- .default-retry
2022-11-25 23:54:43 +05:30
- .ruby-node-cache
2020-03-13 15:44:24 +05:30
- .review:rules:danger
2019-07-31 22:56:46 +05:30
stage : test
2020-04-08 14:13:33 +05:30
needs : [ ]
2021-04-17 20:07:23 +05:30
before_script :
2021-06-08 01:23:25 +05:30
- source scripts/utils.sh
- bundle_install_script "--with danger"
2022-11-25 23:54:43 +05:30
- yarn_install_script
2021-04-17 20:07:23 +05:30
script :
2022-08-27 11:52:29 +05:30
# ${DANGER_DANGERFILE} is used by Jihulab for customizing danger support: https://jihulab.com/gitlab-cn/gitlab/-/blob/main-jh/jh/.gitlab-ci.yml
2021-04-29 21:17:54 +05:30
- >
if [ -z "$DANGER_GITLAB_API_TOKEN" ]; then
2021-09-30 23:02:18 +05:30
run_timed_command danger_as_local
2021-04-29 21:17:54 +05:30
else
2022-06-21 17:19:12 +05:30
danger_id=$(echo -n ${DANGER_GITLAB_API_TOKEN} | md5sum | awk '{print $1}' | cut -c5-10)
2022-08-27 11:52:29 +05:30
run_timed_command "bundle exec danger --fail-on-errors=true --verbose --danger_id=\"${danger_id}\" --dangerfile=\"${DANGER_DANGERFILE:-Dangerfile}\""
2021-04-29 21:17:54 +05:30
fi
2021-09-30 23:02:18 +05:30
danger-review-local :
extends :
- danger-review
- .review:rules:danger-local
script :
- run_timed_command danger_as_local