def METHOD_NAME(
    self, repo: Repository, start_sha: str | None, end_sha: str
) -> Sequence[Mapping[str, str]]:
    """TODO(mgaeta): This function is kinda a mess."""
    installation = self.get_installation(repo.integration_id, repo.organization_id)
    instance = repo.config["instance"]
    client = installation.get_client(base_url=instance)
    try:
        if start_sha is None:
            res = client.get_commits(repo.external_id, commit=end_sha, limit=10)
        else:
            res = client.get_commit_range(repo.external_id, start_sha, end_sha)
    except Exception as e:
        raise installation.raise_error(e)
    commits = self.zip_commit_data(repo, res["value"], repo.organization_id)
    return self._format_commits(repo, commits)