Skip to content

Add cross project pipelines to registration features

What does this MR do and why?

We want to add Сross-project pipelines with artifacts dependencies to Registration features available to users who have service ping data sharing enabled.

Screenshots or screen recordings

Before After
enable_reg_features_off enable_reg_features_on
cross_project_pipelines_off cross_project_pipelines_on
cross_project_pipelines_on2

How to set up and validate locally

Requirements:

  • Make sure you have gitlab runner installed.
  • Make sure you have instance or project runner to process pipelines. Instance runner created the same way as project runner but from Admin Area -> CI/CD -> Runners (/admin/runners).
  1. Testing previous behavior:
    • Make sure you're on a Premium plan GitLab GDK instance
    • Create new public project (test-ci or your custom name)
    • Add CI/CD .gitlab-ci.yml with next content:
stages:
  - build
  - test

job_build:
  stage: build
  script:
    - echo "Building the test-ci project"
    - echo "Build timestamp `date +%s-%D-%T`" > build.log
    - echo "Build OK" >> build.log
    - cat build.log
  artifacts:
    paths:
      - build.log

job_test:
  stage: test
  needs: ["job_build"]
  script:
    - echo "Running tests"
  • Make sure it does not fail
  • Create one more project (test-ci2 or your custom name) and also add next CI/CD to it .gitlab-ci.yml (replace ttaday/test-ci project path with correct value of your project):
stages:
  - build
  - test

job_build:
  stage: build
  script:
    - echo "Building the test-ci2 project"

job_test:
  stage: test
  script:
    - echo "Running test-ci2 tests using test-ci artifacts"
    - ls -al
    - cat build.log
    - echo "DONE"
  needs:
    - job: job_build
    - project: ttaday/test-ci
      job: job_build
      ref: main
      artifacts: true
  • Make sure it does not fail and uses correct artifact file (see screenshots for example)
  1. When registration features are enabled:
    • Make sure you're on a free plan GitLab GDK instance (for example, remove current license or stub #current to return nil)
    • Make sure you have the Registration Features checkbox enabled (Admin -> Settings -> Metrics and profiling -> Usage statistics -> Enable Service Ping & Enable Registration Features)
    • Create new public project (free-test-ci or your custom name)
    • Add CI/CD .gitlab-ci.yml with next content:
stages:
  - build
  - test

job_build:
  stage: build
  script:
    - echo "Building the project"
    - echo "Build timestamp `date +%s-%D-%T`" > build.log
    - echo "Build OK" >> build.log
    - cat build.log
  artifacts:
    paths:
      - build.log

job_test:
  stage: test
  needs: ["job_build"]
  script:
    - echo "Running tests"
  • Make sure it does not fail
  • Create one more project (free-test-ci2 or your custom name) and also add next CI/CD to it .gitlab-ci.yml (replace ttaday/free-test-ci project path with correct value of your project!):
stages:
  - build
  - test

job_build:
  stage: build
  script:
    - echo "Building the free-test-ci2 project"

job_test:
  stage: test
  script:
    - echo "Running free-test-ci2 tests using free-test-ci artifacts"
    - ls -al
    - cat build.log
    - echo "DONE"
  needs:
    - job: job_build
    - project: ttaday/free-test-ci
      job: job_build
      ref: main
      artifacts: true
  • Make sure it does not fail and uses correct artifact file (see screenshots for example)
  1. When registration features are disabled:
    • Make sure you're on a free plan GitLab GDK instance
    • Make sure you have the registration features checkbox disabled (Admin -> Settings -> Metrics and profiling -> Usage statistics -> Enable Registration Features)
    • Restart pipeline jobs of the second project of 2. (free-test-ci2)
    • job_test must fail with error (see screenshots).
  2. Make sure that the new text appears on the docs page:
    • run gdk restart gitlab-docs
    • go to <local_gitlab_docs_host>/ee/user/admin_area/settings/usage_statistics.html#registration-features-program and make sure the new section is on the page and the link works
Updated doc Link page
cross_project_pipelines_docs cross_project_pipelines_docs2

MR acceptance checklist

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

Related to #422275 (closed)

Merge request reports