Skip to content

Fix pre-main-jh pipeline job trigger

Baodong请求将fix-pre-main-jh-pipeline-job-trigger合并到main-jh

What does this MR do and why?

Issue link: pre-main-jh merges the unverified code into main-jh

Add .frontend:rules:jest and .rails:rules:ee-only-system rules for code sync trigger job: trigger-merge-pre-into-main-jh.

If the pipeline of pre-main-jh branch only runs part of jobs, it is allowed to pass, but automatic code sync is not triggered.

Job rules preview
trigger-merge-pre-into-main-jh:
  stage: ".post"
  rules:
  - if: $CI_COMMIT_BRANCH == "pre-main-jh"
  - - if: "($CI_MERGE_REQUEST_LABELS =~ /master:(foss-)?broken/ || $CI_MERGE_REQUEST_LABELS
        =~ /quarantine/) && $CI_MERGE_REQUEST_LABELS =~ /pipeline:expedite/"
      when: never
    - if: $CI_PROJECT_NAMESPACE !~ /^gitlab(-org)?($|\/)/ && ($CI_MERGE_REQUEST_EVENT_TYPE
        == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $CI_MERGE_REQUEST_LABELS
        !~ /pipeline:run-all-rspec/
      when: never
    - if: "$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-all-jest/"
    - if: "$CI_MERGE_REQUEST_LABELS =~ /frontend/ && $CI_MERGE_REQUEST_LABELS =~ /feature
        flag/"
    - if: $CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE
        == "detached"
      changes:
      - "{package.json,yarn.lock}"
      - config/webpack.config.js
      - config/helpers/*.js
    - if: $CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE
        == "detached"
      changes:
      - ".gitlab/ci/rules.gitlab-ci.yml"
      - ".gitlab/ci/frontend.gitlab-ci.yml"
    - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "release-tools/update-gitaly" ||
        $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /stable-(ee|jh)$/
      changes:
      - "{package.json,yarn.lock}"
      - ".browserslistrc"
      - babel.config.js
      - jest.config.{base,integration,unit}.js
      - ".stylelintrc"
      - Dockerfile.assets
      - vendor/assets/**/*
      - ".{eslintrc.yml,eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
      - "*_VERSION"
      - "{,jh/}Gemfile{,.lock}"
      - Rakefile
      - tests.yml
      - config.ru
      - "{,ee/,jh/}{app,bin,config,db,generator_templates,gems,haml_lint,lib,locale,public,scripts,storybook,symbol,vendor}/**/*"
      - doc/api/graphql/reference/*
      - ".gitlab-ci.yml"
      - ".gitlab/ci/**/*"
      - data/whats_new/*.yml
      - doc/index.md
      - Dangerfile
      - danger/**/*
      - "{,ee/,jh/}fixtures/**/*"
      - "{,ee/,jh/}rubocop/**/*"
      - "{,ee/,jh/}spec/**/*"
      - "{,spec/}tooling/**/*"
    - if: $CI_PROJECT_NAMESPACE == "gitlab-org/security" && ($CI_MERGE_REQUEST_EVENT_TYPE
        == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached")
      changes:
      - "{package.json,yarn.lock}"
      - ".browserslistrc"
      - babel.config.js
      - jest.config.{base,integration,unit}.js
      - ".stylelintrc"
      - Dockerfile.assets
      - vendor/assets/**/*
      - ".{eslintrc.yml,eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
      - "*_VERSION"
      - "{,jh/}Gemfile{,.lock}"
      - Rakefile
      - tests.yml
      - config.ru
      - "{,ee/,jh/}{app,bin,config,db,generator_templates,gems,haml_lint,lib,locale,public,scripts,storybook,symbol,vendor}/**/*"
      - doc/api/graphql/reference/*
      - ".gitlab-ci.yml"
      - ".gitlab/ci/**/*"
      - data/whats_new/*.yml
      - doc/index.md
      - Dangerfile
      - danger/**/*
      - "{,ee/,jh/}fixtures/**/*"
      - "{,ee/,jh/}rubocop/**/*"
      - "{,ee/,jh/}spec/**/*"
      - "{,spec/}tooling/**/*"
    - if: ($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE
        == "detached") && $CI_MERGE_REQUEST_LABELS !~ /pipeline:mr-approved/
      when: never
    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/
        || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME
        =~ /^security\// || $CI_COMMIT_REF_NAME == "ruby3_1" || ($CI_MERGE_REQUEST_EVENT_TYPE
        == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") || $CI_COMMIT_TAG
        || $FORCE_GITLAB_CI
      changes:
      - "{package.json,yarn.lock}"
      - ".browserslistrc"
      - babel.config.js
      - jest.config.{base,integration,unit}.js
      - ".stylelintrc"
      - Dockerfile.assets
      - vendor/assets/**/*
      - ".{eslintrc.yml,eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
      - "*_VERSION"
      - "{,jh/}Gemfile{,.lock}"
      - Rakefile
      - tests.yml
      - config.ru
      - "{,ee/,jh/}{app,bin,config,db,generator_templates,gems,haml_lint,lib,locale,public,scripts,storybook,symbol,vendor}/**/*"
      - doc/api/graphql/reference/*
      - ".gitlab-ci.yml"
      - ".gitlab/ci/**/*"
      - data/whats_new/*.yml
      - doc/index.md
      - Dangerfile
      - danger/**/*
      - "{,ee/,jh/}fixtures/**/*"
      - "{,ee/,jh/}rubocop/**/*"
      - "{,ee/,jh/}spec/**/*"
      - "{,spec/}tooling/**/*"
  - - if: "$CI_PROJECT_NAME !~ /^gitlab(-ee)?$/ && $CI_PROJECT_NAME !~ /^gitlab-jh/"
      when: never
    - if: $CI_PROJECT_NAMESPACE !~ /^gitlab(-org)?($|\/)/ && ($CI_MERGE_REQUEST_EVENT_TYPE
        == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $CI_MERGE_REQUEST_LABELS
        !~ /pipeline:run-all-rspec/
      when: never
    - - if: "($CI_MERGE_REQUEST_LABELS =~ /master:(foss-)?broken/ || $CI_MERGE_REQUEST_LABELS
          =~ /quarantine/) && $CI_MERGE_REQUEST_LABELS =~ /pipeline:expedite/"
        when: never
      - if: "$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-all-rspec/"
      - if: $CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE
          == "detached"
        changes:
        - "{,jh/}Gemfile{,.lock}"
        - "{,ee/,jh/}config/**/*.rb"
      - if: $CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE
          == "detached"
        changes:
        - ".gitlab/ci/workhorse.gitlab-ci.yml"
        - GITLAB_WORKHORSE_VERSION
        - workhorse/**/*
        - scripts/gitaly-test-build
        - scripts/gitaly-test-spawn
        - spec/support/gitlab-git-test.git/**/*
        - spec/support/helpers/gitaly_setup.rb
      - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "release-tools/update-gitaly"
          || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /stable-(ee|jh)$/
        changes:
        - "{package.json,yarn.lock}"
        - ".browserslistrc"
        - babel.config.js
        - jest.config.{base,integration,unit}.js
        - ".stylelintrc"
        - Dockerfile.assets
        - vendor/assets/**/*
        - ".{eslintrc.yml,eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
        - "*_VERSION"
        - "{,jh/}Gemfile{,.lock}"
        - Rakefile
        - tests.yml
        - config.ru
        - "{,ee/,jh/}{app,bin,config,db,generator_templates,gems,haml_lint,lib,locale,public,scripts,storybook,symbol,vendor}/**/*"
        - doc/api/graphql/reference/*
        - ".gitlab-ci.yml"
        - ".gitlab/ci/**/*"
        - data/whats_new/*.yml
        - doc/index.md
        - Dangerfile
        - danger/**/*
        - "{,ee/,jh/}fixtures/**/*"
        - "{,ee/,jh/}rubocop/**/*"
        - "{,ee/,jh/}spec/**/*"
        - "{,spec/}tooling/**/*"
      - if: $CI_PROJECT_NAMESPACE == "gitlab-org/security" && ($CI_MERGE_REQUEST_EVENT_TYPE
          == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached")
        changes:
        - "{package.json,yarn.lock}"
        - ".browserslistrc"
        - babel.config.js
        - jest.config.{base,integration,unit}.js
        - ".stylelintrc"
        - Dockerfile.assets
        - vendor/assets/**/*
        - ".{eslintrc.yml,eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
        - "*_VERSION"
        - "{,jh/}Gemfile{,.lock}"
        - Rakefile
        - tests.yml
        - config.ru
        - "{,ee/,jh/}{app,bin,config,db,generator_templates,gems,haml_lint,lib,locale,public,scripts,storybook,symbol,vendor}/**/*"
        - doc/api/graphql/reference/*
        - ".gitlab-ci.yml"
        - ".gitlab/ci/**/*"
        - data/whats_new/*.yml
        - doc/index.md
        - Dangerfile
        - danger/**/*
        - "{,ee/,jh/}fixtures/**/*"
        - "{,ee/,jh/}rubocop/**/*"
        - "{,ee/,jh/}spec/**/*"
        - "{,spec/}tooling/**/*"
      - if: ($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE
          == "detached") && $CI_MERGE_REQUEST_LABELS !~ /pipeline:mr-approved/
        when: never
    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/
        || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME
        =~ /^security\// || $CI_COMMIT_REF_NAME == "ruby3_1" || ($CI_MERGE_REQUEST_EVENT_TYPE
        == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") || $CI_COMMIT_TAG
        || $FORCE_GITLAB_CI
      changes:
      - "{package.json,yarn.lock}"
      - ".browserslistrc"
      - babel.config.js
      - jest.config.{base,integration,unit}.js
      - ".stylelintrc"
      - Dockerfile.assets
      - vendor/assets/**/*
      - ".{eslintrc.yml,eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
      - "*_VERSION"
      - "{,jh/}Gemfile{,.lock}"
      - Rakefile
      - tests.yml
      - config.ru
      - "{,ee/,jh/}{app,bin,config,db,generator_templates,gems,haml_lint,lib,locale,public,scripts,storybook,symbol,vendor}/**/*"
      - doc/api/graphql/reference/*
      - ".gitlab-ci.yml"
      - ".gitlab/ci/**/*"
      - data/whats_new/*.yml
      - doc/index.md
      - Dangerfile
      - danger/**/*
      - "{,ee/,jh/}fixtures/**/*"
      - "{,ee/,jh/}rubocop/**/*"
      - "{,ee/,jh/}spec/**/*"
      - "{,spec/}tooling/**/*"
  variables:
    SYNC_CODE_PROJECT_ID: 9281
    TRIGGER_CODE_SYNC_PIPELINE_URL: "$CI_SERVER_URL/api/v4/projects/$SYNC_CODE_PROJECT_ID/trigger/pipeline"
  script:
  - echo "Trigger code-sync pipeline to merge pre-main-jh into main-jh"
  - curl -X POST --fail -F token="${TRIGGER_CODE_SYNC_TOKEN}" -F ref="main-jh" -F
    "variables[JH_SYNC_SCHEDULE]=gitlab-main-jh" $TRIGGER_CODE_SYNC_PIPELINE_URL

Screenshots or screen recordings

Non-UI

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Baodong 编辑于

合并请求报告

加载中