def associate_rebase_comment_prs(tags, prs_left, total)
      i = total - prs_left.count
      # Any remaining PRs were not found in the list of tags by their merge
      # commit and not found in any specified release branch. Fallback to
      # rebased commit comment.
      @fetcher.fetch_comments_async(prs_left)
      prs_left.reject do |pr|
        found = false
        if pr["comments"] && (rebased_comment = pr["comments"].reverse.find { |c| c["body"].match(%r{rebased commit: ([0-9a-f]{40})}i) })
          rebased_sha = rebased_comment["body"].match(%r{rebased commit: ([0-9a-f]{40})}i)[1]
          if (oldest_tag = tags.reverse.find { |tag| tag["shas_in_tag"].include?(rebased_sha) })
            pr["first_occurring_tag"] = oldest_tag["name"]
            found = true
            i += 1
          elsif sha_in_release_branch(rebased_sha)
            found = true
            i += 1
          else
            raise StandardError, "PR #{pr['number']} has a rebased SHA comment but that SHA was not found in the release branch or any tags"
          end
          print("Associating PRs with tags: #{i}/#{total}\r") if @options[:verbose]
        else
          puts "Warning: PR #{pr['number']} merge commit was not found in the release branch or tagged git history and no rebased SHA comment was found"
        end
        found
      end
    end
def associate_rebase_comment_prs(tags, prs_left, total)
      i = total - prs_left.count
      # Any remaining PRs were not found in the list of tags by their merge
      # commit and not found in any specified release branch. Fallback to
      # rebased commit comment.
      @fetcher.fetch_comments_async(prs_left)
      prs_left.reject do |pr|
        found = false
        if pr["comments"] && (rebased_comment = pr["comments"].reverse.find { |c| c["body"].match(%r{rebased commit: ([0-9a-f]{40})}i) })
          rebased_sha = rebased_comment["body"].match(%r{rebased commit: ([0-9a-f]{40})}i)[1]
          if (oldest_tag = tags.reverse.find { |tag| tag["shas_in_tag"].include?(rebased_sha) })
            pr["first_occurring_tag"] = oldest_tag["name"]
            found = true
            i += 1
          elsif sha_in_release_branch(rebased_sha)
            found = true
            i += 1
          else
            raise StandardError, "PR #{pr['number']} has a rebased SHA comment but that SHA was not found in the release branch or any tags"
          end
          print("Associating PRs with tags: #{i}/#{total}\r") if @options[:verbose]
        else
          puts "Warning: PR #{pr['number']} merge commit was not found in the release branch or tagged git history and no rebased SHA comment was found"
        end
        found
      end
    end
Associate merged PRs by the SHA detected in github comments of the form
 "rebased commit: <sha>". For use when the merge_commit_sha is not in the
 actual git history due to rebase.

 @param [Array] tags The tags sorted by time, newest to oldest.
 @param [Array] prs_left The PRs not yet associated with any tag or branch.
 @return [Array] PRs without rebase comments.