Hi!
I found an issue in the API client. Whenever I try to fetch a deployments list, I'm getting the following exception:
{
"message": "Resource not found: There is no API hosted at this URL.",
"exception": "Bitbucket\\Exception\\RuntimeException",
"file": "/srv/app/vendor/bitbucket/client/src/HttpClient/Plugin/BitbucketExceptionThrower.php",
"line": 76,
"trace": [ ... ]
}
Here's how I'm trying to get the list from code:
$deployments = $this
->bitbucket
->repositories()
->workspaces($workspace)
->deployments($repository)
->list();
Technically, this code should work, but I think there might be an issue with generated URL for this specific endpoint. Here's the URL that I'm getting in code:
https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/deployments
The thing is, this URL just doesn't work without a trailing slash. I'm getting the following response when I'm trying to make a request in Postman:
GET https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/deployments
{
"type": "error",
"error": {
"message": "Resource not found",
"detail": "There is no API hosted at this URL.\n\nFor information about our API's, please refer to the documentation at: https://developer.atlassian.com/bitbucket/api/2/reference/"
}
}
... and the same URL but with a trailing slash:
GET https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/deployments/
{
"page": 1,
"values": [
{
"type": "deployment",
"deployable": {
"type": "deployment_release",
"uuid": "<>",
"pipeline": {
"uuid": "<>",
"type": "pipeline"
},
...
I guess we need a fix :)