latest_successful_on_build

in lib/release_tools/commits.rb [33:68]


    def latest_successful_on_build(since_last_auto_deploy: true)
      limit = find_last_auto_deploy_limit_sha if since_last_auto_deploy

      commit_list.detect do |commit|
        if commit.id == limit
          logger.info('Reached the limit commit', project: @project.auto_deploy_path, limit: limit)

          next true
        end

        next unless yield(commit.id)

        begin
          
          Retriable.with_context(:mirroring) do
            ReleaseTools::GitlabDevClient
              .commit(@project.dev_path, ref: commit.id)
          end

          logger.info(
            'Passing commit found on Build',
            project: @project.auto_deploy_path,
            commit: commit.id
          )
        rescue Gitlab::Error::Error
          logger.debug(
            'Commit passed on Canonical, missing on Build',
            project: @project.auto_deploy_path,
            commit: commit.id
          )

          false
        end
      end
    end