2022-04-15 18:09:57 +00:00
include :
- remote : 'https://gitlab.com/gitlab-org/modelops/applied-ml/review-recommender/ci-templates/-/raw/v0.2.1/recommender/Reviewers.gitlab-ci.yml'
2020-04-21 18:09:31 +00:00
review-cleanup :
2019-09-18 18:06:14 +00:00
extends :
- .default-retry
2020-02-12 15:09:37 +00:00
- .review:rules:review-cleanup
2022-07-21 15:09:12 +00:00
image : ${REVIEW_APPS_IMAGE}
2022-07-21 21:10:17 +00:00
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
2019-09-18 18:06:14 +00:00
stage : prepare
environment :
2022-07-04 15:10:24 +00:00
name : review/${CI_COMMIT_REF_SLUG}${SCHEDULE_TYPE} # No separator for SCHEDULE_TYPE so it's compatible as before and looks nice without it
2019-09-18 18:06:14 +00:00
action : stop
before_script :
- source scripts/utils.sh
2021-12-15 15:15:54 +00:00
- source scripts/review_apps/review-apps.sh
2020-04-21 18:09:31 +00:00
- source scripts/review_apps/gcp_cleanup.sh
2019-09-18 18:06:14 +00:00
- install_gitlab_gem
2020-04-21 18:09:31 +00:00
- setup_gcp_dependencies
2019-09-18 18:06:14 +00:00
script :
2021-12-13 21:14:32 +00:00
- delete_release
2021-12-15 15:15:54 +00:00
- delete_namespace
2019-09-18 18:06:14 +00:00
- ruby -rrubygems scripts/review_apps/automated_cleanup.rb
2020-03-31 03:07:51 +00:00
- gcp_cleanup
2022-08-26 03:12:38 +00:00
start-review-app-pipeline :
2020-06-30 15:08:48 +00:00
extends :
2021-11-18 03:14:17 +00:00
- .review:rules:start-review-app-pipeline
2022-07-21 21:10:17 +00:00
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-10-14 15:14:02 +00:00
stage : review
2020-06-30 15:08:48 +00:00
needs :
2022-09-06 03:12:08 +00:00
- job : e2e-test-pipeline-generate
2021-10-14 15:14:02 +00:00
- job : build-assets-image
2020-06-30 15:08:48 +00:00
artifacts : false
2021-10-18 09:12:29 +00:00
# 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
variables :
2022-07-04 15:10:24 +00:00
SCHEDULE_TYPE : $SCHEDULE_TYPE
2021-10-18 09:12:29 +00:00
DAST_RUN : $DAST_RUN
2022-09-06 03:12:08 +00:00
SKIP_MESSAGE : Skipping review-app due to mr containing only quarantine changes!
2021-10-14 15:14:02 +00:00
trigger :
2022-09-06 03:12:08 +00:00
strategy : depend
2021-10-14 15:14:02 +00:00
include :
2022-08-02 15:09:10 +00:00
- artifact : review-app-pipeline.yml
2022-09-06 03:12:08 +00:00
job : e2e-test-pipeline-generate
2021-05-26 21:10:49 +00:00
2022-09-15 15:13:49 +00:00
# Fetch child pipeline test results and store in parent pipeline
# workaround until natively implemented: https://gitlab.com/groups/gitlab-org/-/epics/8205
review-app-test-results :
image : ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3
stage : review
extends :
- .qa-cache
- .review:rules:start-review-app-pipeline
needs :
- start-review-app-pipeline
variables :
COLORIZED_LOGS : "true"
QA_LOG_LEVEL : "debug"
before_script :
- cd qa && bundle install
script :
- bundle exec rake "ci:download_test_results[start-review-app-pipeline,e2e-test-report,${CI_PROJECT_DIR}]"
when : always
allow_failure : true
artifacts :
when : always
reports :
junit : qa/tmp/rspec-*.xml
2019-04-12 08:56:38 +00:00
danger-review :
2019-08-26 20:41:55 +00:00
extends :
- .default-retry
2022-10-04 18:08:15 +00:00
- .ruby-node-cache
2020-02-12 15:09:37 +00:00
- .review:rules:danger
2019-04-12 08:56:38 +00:00
stage : test
2020-02-20 18:08:51 +00:00
needs : [ ]
2021-03-12 12:09:33 +00:00
before_script :
2021-05-14 18:10:34 +00:00
- source scripts/utils.sh
- bundle_install_script "--with danger"
2022-10-05 21:09:08 +00:00
- yarn_install_script
2021-03-12 12:09:33 +00:00
script :
2022-08-11 21:09:14 +00:00
# ${DANGER_DANGERFILE} is used by Jihulab for customizing danger support: https://jihulab.com/gitlab-cn/gitlab/-/blob/main-jh/jh/.gitlab-ci.yml
2021-03-31 18:09:19 +00:00
- >
if [ -z "$DANGER_GITLAB_API_TOKEN" ]; then
2021-07-15 12:09:01 +00:00
run_timed_command danger_as_local
2021-03-31 18:09:19 +00:00
else
2022-03-21 12:08:01 +00:00
danger_id=$(echo -n ${DANGER_GITLAB_API_TOKEN} | md5sum | awk '{print $1}' | cut -c5-10)
2022-08-11 21:09:14 +00:00
run_timed_command "bundle exec danger --fail-on-errors=true --verbose --danger_id=\"${danger_id}\" --dangerfile=\"${DANGER_DANGERFILE:-Dangerfile}\""
2021-03-31 18:09:19 +00:00
fi
2021-07-15 12:09:01 +00:00
danger-review-local :
extends :
- danger-review
- .review:rules:danger-local
script :
- run_timed_command danger_as_local
2022-04-15 18:09:57 +00:00
reviewers-recommender :
extends :
- .default-retry
2022-08-01 12:12:10 +00:00
# extends generated values cannot overwrite values from included files
# Use !reference as a workaround here
rules : !reference [".review:rules:reviewers-recommender", rules]
2022-04-15 18:09:57 +00:00
stage : test
needs : [ ]