Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitbucket cloud - Commits.each() - trailing / included incorrectly when top param is set #1319

Open
sbgamma opened this issue Jan 31, 2024 · 1 comment

Comments

@sbgamma
Copy link
Contributor

sbgamma commented Jan 31, 2024

for commit in self._get_paged(top, trailing=True, params=params):
yield self.__get_object(commit)

A trailing slash is always added to the URL in requests for this endpoint.

If the "top" param is set, then the resulting URL will be https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commits/{commit}/. This results in a 404.

I'll raise a PR to fix this.

@sbgamma
Copy link
Contributor Author

sbgamma commented Jan 31, 2024

To clarify, the Bitbucket API is interpreting the / as part of the commit hash. Sample response shown below:

{
  "type": "error",
  "error": {
    "message": "Commit not found",
    "data": {
      "shas": [
        "05XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX03/"
      ]
    }
  },
  "data": {
    "shas": [
      "05XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX03/"
    ]
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant