Ensure stable branches are green before starting the internal release process

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR adds internal:prepare:check_component_branch_pipeline_status task to the internal rake. This will ensure that the stable branches of the GitLab Managed Versioned projects are green before starting the release.

I updated the existing BranchesStatusService and ComponentBranchHelper to support all the release types (monthly, patch, and internal).

Related issue: gitlab-com/gl-infra/delivery#20866 (closed)

(Note: The addition of the internal release job that calls this rake task will be part of a separate MR.)

Testing

Using pry with DRY-RUN mode (including the three release types)

  • Patch - rake 'security:check_component_branch_pipeline_status'

    ReleaseTools::Services::BranchesStatusService -- All branches are green! \u{2705}
    Task#invoke'
    2025-02-10 21:42:59.316025 I [dry-run] ReleaseTools::Slack::ReleaseJobEndNotifier -- Posting slack message -- {job_type: "Branches Status", status: :success}
  • Monthly - rake 'monthly:tag_day:ensure_stable_branches_green'

    ReleaseTools::Services::BranchesStatusService -- 
    
    ❌ The following branches do not have green pipelines:
    
    - cng-ee - 17-9-stable - : https://gitlab.com/gitlab-org/build/CNG/-/commits/17-9-stable
    - gitaly - 17-9-stable - : https://gitlab.com/gitlab-org/gitaly/-/commits/17-9-stable
    - gitlab-ee - 17-9-stable-ee - : https://gitlab.com/gitlab-org/gitlab/-/commits/17-9-stable-ee
    - gitlab-pages - 17-9-stable - : https://gitlab.com/gitlab-org/gitlab-pages/-/commits/17-9-stable
    - omnibus-gitlab-ee - 17-9-stable - : https://gitlab.com/gitlab-org/omnibus-gitlab/-/commits/17-9-stable
    - gitlab-ce - 17-9-stable - : https://gitlab.com/gitlab-org/gitlab-foss/-/commits/17-9-stable
    invoke'
    2025-02-10 21:44:30.220392 I [dry-run] ReleaseTools::Slack::ReleaseJobEndNotifier -- Posting slack message -- {job_type: "Branches Status", status: :failed}
  • Internal - rake 'internal:prepare:check_component_branch_pipeline_status'

    2025-02-11 19:12:44.474465 I [dry-run] ReleaseTools::Services::BranchesStatusService -- All branches are green! \u{2705}
    
    Caused by:
    2025-02-11 19:12:44.474520 I [dry-run] ReleaseTools::Slack::ReleaseJobEndNotifier -- Posting slack message -- {job_type: "Branches Status", status: :success}

Content

  • Update specs
  • Create internal:prepare:check_component_branch_pipeline_status rake task
  • Create ComponentBranchVerifier class for internal release
  • Update BranchesStatusService and ComponentBranchHelper classes to support internal releases

Author Check-list

  • Has documentation been updated?
Edited by Mawreen Dela Cruz

Merge request reports

Loading