CanineHQ/canine · error · Git::Client::Error

Failed to fetch commits: #{response.body}

Error message

Failed to fetch commits: #{response.body}

What it means

Error "Failed to fetch commits: #{response.body}" thrown in CanineHQ/canine.

Source

Thrown at app/services/git/bitbucket/client.rb:37

    @repository_url = repository_url
    @api_base_url = api_base_url || "https://api.bitbucket.org"
  end

  def bitbucket_api_base
    "#{@api_base_url}/2.0"
  end

  def repository_exists?
    repository.present? && repository["uuid"].present?
  end

  def commits(branch)
    response = HTTParty.get(
      "#{bitbucket_api_base}/repositories/#{repository_url}/commits?include=#{branch}",
      headers: auth_headers
    )
    unless response.success?
      raise Git::Client::Error, "Failed to fetch commits: #{response.body}"
    end

    (response["values"] || []).map do |commit|
      Git::Common::Commit.new(
        sha: commit["hash"],
        message: commit["message"],
        author_name: commit.dig("author", "user", "display_name") || commit.dig("author", "raw")&.split("<")&.first&.strip,
        author_email: extract_email(commit.dig("author", "raw")),
        authored_at: DateTime.parse(commit["date"]),
        committer_name: commit.dig("author", "user", "display_name") || commit.dig("author", "raw")&.split("<")&.first&.strip,
        committer_email: extract_email(commit.dig("author", "raw")),
        committed_at: DateTime.parse(commit["date"]),
        url: commit.dig("links", "html", "href")
      )
    end
  end

  def can_write_webhooks?

View on GitHub (pinned to ba4ee3968d)

When it happens

Trigger: Thrown at app/services/git/bitbucket/client.rb:37 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of CanineHQ/canine@ba4ee3968d (2026-08-23). Data as JSON: /api/errors/7695146c21750f3e. Report an issue: GitHub.