wait_for_ee_to_ce_sync

in lib/release_tools/public_release/gitlab_release.rb [174:222]


      def wait_for_ee_to_ce_sync
        return if Feature.enabled?(:skip_foss_merge_train)

        logger.info(
          'Creating pipeline to sync EE to CE',
          project: project_path,
          target_branch: target_branch,
          ce_project_path: ce_project_path,
          ce_target_branch: ce_target_branch
        )

        initial_pipeline = GitlabOpsClient.create_pipeline(
          Project::MergeTrain,
          {
            MERGE_FOSS: '1',
            SOURCE_PROJECT: project_path,
            SOURCE_BRANCH: target_branch,
            TARGET_PROJECT: ce_project_path,
            TARGET_BRANCH: ce_target_branch
          }
        )

        url = initial_pipeline.web_url

        logger.info('Created pipeline to sync EE to CE', pipeline: url)

        Retriable.retriable(intervals: WAIT_SYNC_INTERVALS, on: PipelineTooSlow) do
          pipeline = GitlabOpsClient
            .pipeline(Project::MergeTrain, initial_pipeline.id)

          case pipeline.status
          when 'success'
            logger.info('The EE to CE sync finished', pipeline: url)
            return
          when 'running', 'pending', 'created', 'waiting_for_resource'
            logger.info('The EE to CE sync is still running', pipeline: url)
            raise PipelineTooSlow
          else
            logger.error(
              'The EE to CE sync did not succeed',
              pipeline: url,
              status: pipeline.status
            )

            raise PipelineFailed
          end
        end
      end