Skip to content

Add merge pipelines to registration features

Taras Tadai requested to merge 422281-add-merge-pipelines-to-reg-features into master

What does this MR do and why?

We want to add Merged results pipelines 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
merge_pipelines_settings_off merge_pipelines_settings_on
merge_pipelines_off merge_pipelines_on
merge_pipelines_off2 merge_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 can be 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
    • Enable Merged results pipelines Some Project -> Settings > Merge requests in the Merge options section, select Enable merged results pipelines
    • Create new project (test-merged-results or your custom name)
    • Add CI/CD .gitlab-ci.yml with next content to main branch:
stages:
  - build
  - test

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

job_test:
  stage: test
  script:
    - echo "Running tests"

job_mr_test:
  stage: test
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  script:
    - echo "Running MR tests"
  • create new branch for MR main_test and modify .gitlab-ci.yml with next content(added job_mr_test2):
stages:
  - build
  - test

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

job_test:
  stage: test
  script:
    - echo "Running tests"

job_mr_test:
  stage: test
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  script:
    - echo "Running MR tests"

job_mr_test2:
  stage: test
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  script:
    - echo "Running MR tests 2"
  • Modify .gitlab-ci.yml pipeline in main branch Built -> Pipeline editor with next content(added job_mr_test3):
stages:
  - build
  - test

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

job_test:
  stage: test
  script:
    - echo "Running tests"

job_mr_test3:
  stage: test
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  script:
    - echo "Running MR tests 3"

job_mr_test:
  stage: test
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  script:
    - echo "Running MR tests"
  • It's important to add new job in the main branch above the job_mr_test just not to have conflicts in MR.
  • Create MR from main_test to main and check you can see "merged results"(see screenshots).
  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)
    • Follow steps from 1. but using new project (or try to restart pipelines in existing MR).
  2. 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)
    • Check you don't have Merged results pipelines setting available(see screenshots)
  3. 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
merge_pipelines_docs merge_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 #422281 (closed)

Edited by Taras Tadai

Merge request reports