From 1c8c470b807e9737ab5bc5c445bc9caa05dc7e68 Mon Sep 17 00:00:00 2001 From: Mayra Cabrera Date: Fri, 7 Jan 2022 10:15:35 -0600 Subject: [PATCH] Trigger quality jobs for gstg-ref and gprd-cny As part of https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/2160 and https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/2159, QA jobs for gstg-ref and gstg-cny were moved to the coordinated pipeline. Summarized: * Two jobs were added for gstg-ref: One for smoke and another one for full specs. * Two jobs were added for gstg-cny: One for smoke and another one for smoke main specs --- .gitlab-ci.yml | 1 + .gitlab/ci/coordinated-pipeline.gitlab-ci.yml | 127 +++++++++++++++++- 2 files changed, 126 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf7d09888..7137d4cf3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ stages: - coordinated:build - coordinated:metrics:prepare - coordinated:deploy:staging-canary + - coordinated:qa:staging-canary - coordinated:finish:staging-canary - coordinated:deploy:staging - coordinated:qa:staging diff --git a/.gitlab/ci/coordinated-pipeline.gitlab-ci.yml b/.gitlab/ci/coordinated-pipeline.gitlab-ci.yml index 2d420b638..6e7ec85d3 100644 --- a/.gitlab/ci/coordinated-pipeline.gitlab-ci.yml +++ b/.gitlab/ci/coordinated-pipeline.gitlab-ci.yml @@ -181,6 +181,48 @@ deploy:gstg-ref: # - auto_deploy:start # we need DEPLOY_VERSION env artifact # - metrics:start_time +# Triggers a Full Quality pipeline on quality/staging-ref +qa:full:gstg-ref: + stage: coordinated:qa:staging-canary + allow_failure: true + rules: + - <<: *if-auto-deploy-tag + when: on_success + - <<: *if-coordinated-pipeline + when: on_success + variables: + DEPLOY_ENVIRONMENT: 'gstg-ref' + DEPLOY_VERSION: $DEPLOY_VERSION + GITLAB_QA_ISSUE_URL: '' + FULL_ONLY: 'true' + needs: + - auto_deploy:start + - deploy:gstg-ref + trigger: + project: gitlab-org/quality/staging-ref + strategy: depend + +# Triggers a Smoke Quality pipeline on quality/staging-ref +qa:smoke:gstg-ref: + stage: coordinated:qa:staging-canary + allow_failure: true + rules: + - <<: *if-auto-deploy-tag + when: on_success + - <<: *if-coordinated-pipeline + when: on_success + variables: + DEPLOY_ENVIRONMENT: 'gstg-ref' + DEPLOY_VERSION: $DEPLOY_VERSION + GITLAB_QA_ISSUE_URL: '' + SMOKE_ONLY: 'true' + needs: + - auto_deploy:start + - deploy:gstg-ref + trigger: + project: gitlab-org/quality/staging-ref + strategy: depend + # Sends a slack notification notifying a successful deployment for gstg-ref notify_success:gstg-ref: extends: .notify_success @@ -189,7 +231,7 @@ notify_success:gstg-ref: DEPLOY_ENVIRONMENT: 'gstg-ref' needs: - auto_deploy:start - - deploy:gstg-ref + - qa:smoke:gstg-ref # Sends a slack notification notifying a failed deployment for gstg-ref notify_failure:gstg-ref: @@ -201,6 +243,32 @@ notify_failure:gstg-ref: - auto_deploy:start - deploy:gstg-ref +# Sends a slack notification notifying a failed QA for gstg +notify_failure:gstg:qa: + extends: .notify_failure + stage: coordinated:finish:staging + variables: + DEPLOY_ENVIRONMENT: 'gstg' + DEPLOY_VERSION: $DEPLOY_VERSION + needs: + - auto_deploy:start + - qa:smoke:gstg-ref + script: + - bundle exec rake 'quality:notify' + +# Sends a slack notification notifying a failed QA for gstg-ref +notify_failure:gstg-cny:qa-ref: + extends: .notify_failure + stage: coordinated:finish:canary + variables: + DEPLOY_ENVIRONMENT: 'gstg-ref' + DEPLOY_VERSION: $DEPLOY_VERSION + needs: + - auto_deploy:start + - qa:smoke:gstg-cny + script: + - bundle exec rake 'quality:notify' + # Send a slack notification about the start of the staging canary deployment. # # Runs after the initial metrics (metrics:start) have been collected. @@ -246,6 +314,48 @@ metrics:deployment_started:gstg-cny: - auto_deploy:start # we need DEPLOY_VERSION env artifact - metrics:start_time +# Triggers a Smoke Quality pipeline on quality/staging-canary +qa:smoke:gstg-cny: + stage: coordinated:qa:staging-canary + allow_failure: true + rules: + - <<: *if-auto-deploy-tag + when: on_success + - <<: *if-coordinated-pipeline + when: on_success + variables: + DEPLOY_ENVIRONMENT: 'gstg-cny' + DEPLOY_VERSION: $DEPLOY_VERSION + GITLAB_QA_ISSUE_URL: '' + SMOKE_ONLY: 'true' + needs: + - auto_deploy:start + - deploy:gstg-cny + trigger: + project: gitlab-org/quality/staging-canary + strategy: depend + +# Triggers a Smoke Quality pipeline on quality/staging +qa:smoke:gstg-cny-main: + stage: coordinated:qa:staging-canary + allow_failure: true + rules: + - <<: *if-auto-deploy-tag + when: on_success + - <<: *if-coordinated-pipeline + when: on_success + variables: + DEPLOY_ENVIRONMENT: 'gstg-cny' + DEPLOY_VERSION: $DEPLOY_VERSION + GITLAB_QA_ISSUE_URL: '' + SMOKE_ONLY: 'true' + needs: + - auto_deploy:start + - deploy:gstg-cny + trigger: + project: gitlab-org/quality/staging + strategy: depend + # Sends a slack notification notifying a successful deployment for gstg-cny notify_success:gstg-cny: extends: .notify_success @@ -254,7 +364,7 @@ notify_success:gstg-cny: DEPLOY_ENVIRONMENT: 'gstg-cny' needs: - auto_deploy:start - - deploy:gstg-cny + - qa:smoke:gstg-cny # Sends a slack notification notifying a failed deployment for gstg-cny notify_failure:gstg-cny: @@ -278,6 +388,19 @@ notify_start:gstg: - auto_deploy:start - notify_success:gstg-cny +# Sends a slack notification notifying a failed QA for gstg-cny +notify_failure:gstg-cny:qa: + extends: .notify_failure + stage: coordinated:finish:canary + variables: + DEPLOY_ENVIRONMENT: 'gstg-cny' + DEPLOY_VERSION: $DEPLOY_VERSION + needs: + - auto_deploy:start + - qa:smoke:gstg-cny + script: + - bundle exec rake 'quality:notify' + # Trigger a downstream pipeline to deploy to staging deploy:gstg: stage: coordinated:deploy:staging -- GitLab