# Insurance in case a gem needed by one of our releases gets yanked from # rubygems.org in the future. cache gems: extends: - .default-retry - .ruby-cache - .default-before_script - .setup:rules:cache-gems stage: prepare needs: [] variables: BUNDLE_WITHOUT: "" BUNDLE_WITH: "production:development:test" SETUP_DB: "false" script: - echo -e "\e[0Ksection_start:`date +%s`:bundle-package[collapsed=true]\r\e[0KPackaging gems" - bundle config set cache_all true - run_timed_command "bundle package --all-platforms" - echo -e "\e[0Ksection_end:`date +%s`:bundle-package\r\e[0K" artifacts: paths: - vendor/cache expire_in: 31d .predictive-job: extends: - .default-retry needs: [] .absolutely-predictive-job: extends: - .predictive-job image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}alpine:latest variables: GIT_STRATEGY: none dont-interrupt-me: extends: - .absolutely-predictive-job - .setup:rules:dont-interrupt-me stage: sync interruptible: false script: - echo "This jobs makes sure this pipeline won't be interrupted! See https://docs.gitlab.com/ee/ci/yaml/#interruptible." clone-gitlab-repo: extends: - .absolutely-predictive-job - .setup:rules:clone-gitlab-repo stage: sync script: - echo OK variables: GIT_STRATEGY: clone artifacts: paths: - '*' expire_in: '12 hours' set-pipeline-name: extends: - .predictive-job - .setup:rules:set-pipeline-name - .fast-no-clone-job variables: # We use > instead of | because we want the files to be space-separated. FILES_TO_DOWNLOAD: > scripts/utils.sh scripts/pipeline/set_pipeline_name.rb image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION}-alpine3.20 stage: prepare before_script: - apk add --no-cache --update curl # Not present in ruby-alpine, so we add it manually - !reference [".fast-no-clone-job", before_script] script: - install_gitlab_gem - chmod u+x scripts/pipeline/set_pipeline_name.rb && scripts/pipeline/set_pipeline_name.rb allow_failure: exit_codes: - 3 gitlab_git_test: extends: - .predictive-job - .setup:rules:gitlab_git_test stage: test script: - spec/support/prepare-gitlab-git-test-for-commit --check-for-changes verify-tests-yml: extends: - .setup:rules:verify-tests-yml image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION}-alpine3.20 stage: preflight needs: [] script: - source scripts/utils.sh - install_tff_gem - scripts/verify-tff-mapping verify-approvals: extends: - .predictive-job - .setup:rules:jh-contribution script: - source scripts/utils.sh - install_gitlab_gem - tooling/bin/find_app_sec_approval generate-frontend-fixtures-mapping: extends: - .setup:rules:generate-frontend-fixtures-mapping - .use-pg14 - .ruby-cache needs: ["setup-test-env"] stage: prepare before_script: - !reference [.default-before_script, before_script] - source ./scripts/rspec_helpers.sh - section_start "gitaly-test-spawn" "Spawning Gitaly"; scripts/gitaly-test-spawn; section_end "gitaly-test-spawn"; # Do not use 'bundle exec' here script: - generate_frontend_fixtures_mapping artifacts: expire_in: 7d paths: - ${FRONTEND_FIXTURES_MAPPING_PATH} detect-tests: extends: .rails:rules:detect-tests image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION}-slim needs: [] stage: prepare variables: RSPEC_TESTS_MAPPING_ENABLED: "true" before_script: - apt update && apt install -y curl script: - source ./scripts/utils.sh - source ./scripts/rspec_helpers.sh - install_gitlab_gem - install_tff_gem - retrieve_tests_mapping - retrieve_frontend_fixtures_mapping - | # $FIND_CHANGES_MERGE_REQUEST_IID is defined in as-if-foss.gitlab-ci.yml if [ -n "$CI_MERGE_REQUEST_IID" ] || [ -n "$FIND_CHANGES_MERGE_REQUEST_IID" ]; then mkdir -p $(dirname "$RSPEC_CHANGED_FILES_PATH") tooling/bin/predictive_tests filter_rspec_matched_foss_tests ${RSPEC_MATCHING_TESTS_PATH} ${RSPEC_MATCHING_TESTS_FOSS_PATH}; filter_rspec_matched_ee_tests ${RSPEC_MATCHING_TESTS_PATH} ${RSPEC_MATCHING_TESTS_EE_PATH}; echoinfo 'Changed files:' echoinfo "$(tr ' ' '\n' < $RSPEC_CHANGED_FILES_PATH)" echo "" echoinfo 'Related FOSS RSpec tests:' echoinfo "$(tr ' ' '\n' < $RSPEC_MATCHING_TESTS_FOSS_PATH)" echo "" echoinfo 'Related EE RSpec tests:' echoinfo "$(tr ' ' '\n' < $RSPEC_MATCHING_TESTS_EE_PATH)" echo "" echoinfo 'Related JS files:' echoinfo "$(tr ' ' '\n' < $RSPEC_MATCHING_JS_FILES_PATH)" echo "" fi artifacts: expire_in: 7d paths: - ${FRONTEND_FIXTURES_MAPPING_PATH} - ${RSPEC_CHANGED_FILES_PATH} - ${RSPEC_MATCHING_JS_FILES_PATH} - ${RSPEC_MATCHING_TESTS_EE_PATH} - ${RSPEC_MATCHING_TESTS_FOSS_PATH} - ${RSPEC_MATCHING_TESTS_PATH} - ${RSPEC_VIEWS_INCLUDING_PARTIALS_PATH} detect-previous-failed-tests: extends: - detect-tests - .rails:rules:detect-previous-failed-tests variables: PREVIOUS_FAILED_TESTS_DIR: tmp/previous_failed_tests/ script: - source ./scripts/utils.sh - source ./scripts/rspec_helpers.sh - retrieve_failed_tests "${PREVIOUS_FAILED_TESTS_DIR}" "oneline" "previous" artifacts: expire_in: 7d paths: - ${PREVIOUS_FAILED_TESTS_DIR} e2e-test-pipeline-generate: extends: - .qa-job-base - .predictive-job - .qa:rules:determine-e2e-tests stage: prepare variables: ENV_FILE: $CI_PROJECT_DIR/qa_tests_vars.env COLORIZED_LOGS: "true" script: - bundle exec rake "ci:detect_changes[$ENV_FILE]" - cd $CI_PROJECT_DIR && scripts/generate-e2e-pipeline artifacts: expire_in: 1 day paths: - '*-pipeline.yml' - "${CI_PROJECT_DIR}/qa_tests_vars.env" # This is the manual start of the chain of E2E jobs # After playing this, it'll follow up with: # follow-up:compile-production-assets -> follow-up:build-assets-image --\ # \-> follow-up:e2e:package-and-test-ee # follow-up:build-qa-image --------------------------------------------------------------------------/ manual:e2e-test-pipeline-generate: extends: - e2e-test-pipeline-generate - .qa:rules:manual-e2e