Unable to open a PR

Issue #18 resolved
Sebastiaan Stok created an issue

I'm having a really hard time trying to open PR with the API. Basically everything do gives an UNAUTHORIZED error, with no useful message.

The following scripts gives a 200 for the pull request list, but once I try to open a new PR it fails with no useful error message what so ever.

The credentials are correct as I'm able to get a list of PR's, and this is a private repository. So why I cant open PR, is a big mystery.

<?php

require __DIR__.'/../vendor/autoload.php';

$oauth_params = [
    'oauth_consumer_key' => '',
    'oauth_consumer_secret' => ''
];

$pull = new Bitbucket\API\Repositories\PullRequests();
$pull->setCredentials(new \Bitbucket\API\Authentication\OAuth($oauth_params));

$listener = new \Bitbucket\API\Http\Listener\OAuthListener($oauth_params);
$pull->getClient()->addListener($listener);

$response = $pull->all(
    'sstok',
    'gush-sandbox'
);

print_r($response);

$response = $pull->all(
    'sstok',
    'gush-sandbox'
);

print_r($response);

$response = $pull->create('sstok', 'gush-sandbox', '{
  "title": "Testing",
  "source": {
    "branch": {
      "name": "6-testing"
    }
  },
  "description": "                   \n|Q            |A  |\n|---          |---|\n|Bug Fix?     |n  |\n|New Feature? |n  |\n|BC Breaks?   |n  |\n|Deprecations?|n  |\n|Tests Pass?  |n  |\n|Fixed Tickets|   |\n|License      |MIT|\n|Doc PR       |   |\n                   \n\n\n Sent using [Gush](https://github.com/gushphp/gush)",
  "destination": {
    "branch": {
      "name": "master"
    }
  }
}');

print_r($response);

I'm using the 0.4.0 version and v0.10 of Buzz.

Comments (5)

  1. Alexandru Guzinschi

    Bug fixed in v0.4.1

    If you have the time, please confirm that new version fixes this bug.

  2. Sebastiaan Stok reporter

    And now merging fails with UNAUTHORIZED. When I reverted the changed code its working again.

    found it, will open a PR.

  3. Log in to comment