Commit 3c69043c authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'ci-streamline-needs-usage' into 'master'

ci: Streamline our usage of 'needs' after latest improvements

See merge request gitlab-org/gitlab!60030
parents b5f722e1 0b30e3e6
...@@ -121,7 +121,7 @@ rspec frontend_fixture as-if-foss: ...@@ -121,7 +121,7 @@ rspec frontend_fixture as-if-foss:
rspec-ee frontend_fixture: rspec-ee frontend_fixture:
extends: extends:
- .frontend-fixtures-base - .frontend-fixtures-base
- .frontend:rules:default-frontend-jobs - .frontend:rules:default-frontend-jobs-ee
parallel: 2 parallel: 2
graphql-schema-dump: graphql-schema-dump:
...@@ -169,8 +169,10 @@ karma: ...@@ -169,8 +169,10 @@ karma:
extends: extends:
- .karma-base - .karma-base
- .frontend:rules:default-frontend-jobs - .frontend:rules:default-frontend-jobs
# Don't use `needs` since `rspec-ee frontend_fixture` doesn't exist in `gitlab-foss` pipelines. needs:
dependencies: ["rspec frontend_fixture", "rspec-ee frontend_fixture"] - job: "rspec frontend_fixture"
- job: "rspec-ee frontend_fixture"
optional: true
coverage: '/^Statements *: (\d+\.\d+%)/' coverage: '/^Statements *: (\d+\.\d+%)/'
artifacts: artifacts:
name: coverage-javascript name: coverage-javascript
...@@ -201,8 +203,10 @@ jest: ...@@ -201,8 +203,10 @@ jest:
extends: extends:
- .jest-base - .jest-base
- .frontend:rules:default-frontend-jobs - .frontend:rules:default-frontend-jobs
# Don't use `needs` since `rspec-ee frontend_fixture` doesn't exist in `gitlab-foss` pipelines. needs:
dependencies: ["rspec frontend_fixture", "rspec-ee frontend_fixture"] - job: "rspec frontend_fixture"
- job: "rspec-ee frontend_fixture"
optional: true
artifacts: artifacts:
name: coverage-frontend name: coverage-frontend
expire_in: 31d expire_in: 31d
...@@ -222,8 +226,11 @@ jest-integration: ...@@ -222,8 +226,11 @@ jest-integration:
script: script:
- *yarn-install - *yarn-install
- run_timed_command "yarn jest:integration --ci" - run_timed_command "yarn jest:integration --ci"
# Don't use `needs` since `rspec-ee frontend_fixture` doesn't exist in `gitlab-foss` pipelines. needs:
dependencies: ["rspec frontend_fixture", "rspec-ee frontend_fixture", "graphql-schema-dump"] - job: "rspec frontend_fixture"
- job: "rspec-ee frontend_fixture"
optional: true
- job: "graphql-schema-dump"
jest-as-if-foss: jest-as-if-foss:
extends: extends:
......
...@@ -3,7 +3,7 @@ pages: ...@@ -3,7 +3,7 @@ pages:
- .default-retry - .default-retry
- .pages:rules - .pages:rules
stage: pages stage: pages
dependencies: needs:
- rspec:coverage - rspec:coverage
- coverage-frontend - coverage-frontend
- karma - karma
......
...@@ -35,9 +35,6 @@ review-build-cng: ...@@ -35,9 +35,6 @@ review-build-cng:
artifacts: false artifacts: false
script: script:
- BUILD_TRIGGER_TOKEN=$REVIEW_APPS_BUILD_TRIGGER_TOKEN ./scripts/trigger-build cng - BUILD_TRIGGER_TOKEN=$REVIEW_APPS_BUILD_TRIGGER_TOKEN ./scripts/trigger-build cng
# When the job is manual, review-deploy is also manual and we don't want people
# to have to manually start the jobs in sequence, so we do it for them.
- '[ -z $CI_JOB_MANUAL ] || scripts/api/play_job.rb --job-name "review-deploy"'
.review-workflow-base: .review-workflow-base:
extends: extends:
...@@ -59,7 +56,7 @@ review-deploy: ...@@ -59,7 +56,7 @@ review-deploy:
- .review-workflow-base - .review-workflow-base
- .review:rules:review-deploy - .review:rules:review-deploy
stage: review stage: review
dependencies: [] needs: ["review-build-cng"]
resource_group: "review/${CI_COMMIT_REF_NAME}" resource_group: "review/${CI_COMMIT_REF_NAME}"
before_script: before_script:
- export GITLAB_SHELL_VERSION=$(<GITLAB_SHELL_VERSION) - export GITLAB_SHELL_VERSION=$(<GITLAB_SHELL_VERSION)
...@@ -75,10 +72,6 @@ review-deploy: ...@@ -75,10 +72,6 @@ review-deploy:
- date - date
- deploy || (display_deployment_debug && exit 1) - deploy || (display_deployment_debug && exit 1)
- disable_sign_ups || (delete_release && exit 1) - disable_sign_ups || (delete_release && exit 1)
# When the job is manual, review-qa-smoke is also manual and we don't want people
# to have to manually start the jobs in sequence, so we do it for them.
- '[ -z $CI_JOB_MANUAL ] || scripts/api/play_job.rb --job-name "review-qa-smoke"'
- '[ -z $CI_JOB_MANUAL ] || scripts/api/play_job.rb --job-name "review-performance"'
after_script: after_script:
# Run seed-dast-test-data.sh only when DAST_RUN is set to true. This is to pupulate review app with data for DAST scan. # Run seed-dast-test-data.sh only when DAST_RUN is set to true. This is to pupulate review app with data for DAST scan.
# Set DAST_RUN to true when jobs are manually scheduled. # Set DAST_RUN to true when jobs are manually scheduled.
...@@ -123,9 +116,7 @@ review-stop: ...@@ -123,9 +116,7 @@ review-stop:
- .use-docker-in-docker - .use-docker-in-docker
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7 image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7
stage: qa stage: qa
# This is needed so that manual jobs with needs don't block the pipeline. needs: ["review-deploy"]
# See https://gitlab.com/gitlab-org/gitlab/-/issues/199979.
dependencies: ["review-deploy"]
variables: variables:
QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa" QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa"
QA_CAN_TEST_GIT_PROTOCOL_V2: "false" QA_CAN_TEST_GIT_PROTOCOL_V2: "false"
...@@ -175,9 +166,7 @@ review-performance: ...@@ -175,9 +166,7 @@ review-performance:
name: sitespeedio/sitespeed.io name: sitespeedio/sitespeed.io
entrypoint: [""] entrypoint: [""]
stage: qa stage: qa
# This is needed so that manual jobs with needs don't block the pipeline. needs: ["review-deploy"]
# See https://gitlab.com/gitlab-org/gitlab/-/issues/199979.
dependencies: ["review-deploy"]
before_script: before_script:
- export CI_ENVIRONMENT_URL="$(cat environment_url.txt)" - export CI_ENVIRONMENT_URL="$(cat environment_url.txt)"
- echo "${CI_ENVIRONMENT_URL}" - echo "${CI_ENVIRONMENT_URL}"
...@@ -200,7 +189,7 @@ parallel-spec-reports: ...@@ -200,7 +189,7 @@ parallel-spec-reports:
- .review:rules:review-qa-all - .review:rules:review-qa-all
image: ${GITLAB_DEPENDENCY_PROXY}ruby:2.7-alpine image: ${GITLAB_DEPENDENCY_PROXY}ruby:2.7-alpine
stage: post-qa stage: post-qa
dependencies: ["review-qa-all"] needs: ["review-qa-all"]
variables: variables:
NEW_PARALLEL_SPECS_REPORT: qa/report-new.html NEW_PARALLEL_SPECS_REPORT: qa/report-new.html
BASE_ARTIFACT_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/file/qa/" BASE_ARTIFACT_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/file/qa/"
......
...@@ -424,6 +424,13 @@ ...@@ -424,6 +424,13 @@
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-patterns changes: *code-backstage-patterns
.frontend:rules:default-frontend-jobs-ee:
rules:
- <<: *if-not-ee
when: never
- <<: *if-default-refs
changes: *code-backstage-patterns
.frontend:rules:default-frontend-jobs-as-if-foss: .frontend:rules:default-frontend-jobs-as-if-foss:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
...@@ -1069,7 +1076,6 @@ ...@@ -1069,7 +1076,6 @@
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns changes: *code-patterns
when: manual
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns changes: *qa-patterns
...@@ -1090,7 +1096,6 @@ ...@@ -1090,7 +1096,6 @@
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: manual
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-schedule - <<: *if-dot-com-gitlab-org-schedule
allow_failure: true allow_failure: true
...@@ -1113,7 +1118,6 @@ ...@@ -1113,7 +1118,6 @@
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: manual
allow_failure: true allow_failure: true
.review:rules:review-qa-all: .review:rules:review-qa-all:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment