Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/tests/test_bitbucket.py reviewboard/hostingsvcs/bitbucket.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/tests/test_bitbucket.py reviewboard/hostingsvcs/bitbucket.py
Update Bitbucket to use the 2.0 API.
Review Request #8816 - Created March 15, 2017 and submitted
This moves us entirely (almost) onto the Bitbucket 2.0 API. The old 1.0
API has a number of bugs, which have bit some users, and 2.0 has
recently been expanded to include most of what we need (without the
bugs and with improved error reporting).
We now use the 2.0 API for retrieving branches, commits, checking the
repository, and validating the user. We can't use it yet for fetching
the contents of files, though, as that's still a 1.0-only feature
(though is being tracked upstream by Bitbucket -- see
One of the advantages of the new API is that payloads can be limited to
the specific fields needed in a client. We now use this to slim down
communication with Bitbucket.
There's also additional bullet-proofing in here for validating that the
repository is of the correct type, based on the choices selected in the
Unit tests passed.
Tested with a handful of repositories (Git and Mercurial, and including
one that triggered crashes in the Bitbucket API). I tested that
repository validation, account linking, branch/commit listing, and
file fetching all work.