diffusion.querycommits deprecated in favor of diffusion.commit.search which support hasn't been merged for yet

Bug #1786337 reported by Simon Quigley on 2018-08-09
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-phabricator (Debian)
New
Unknown
python-phabricator (Ubuntu)
Status tracked in Cosmic
Bionic
High
Simon Quigley
Cosmic
High
Simon Quigley

Bug Description

[Impact]

Without this, users of the API will eventually be unable to search commits in Phabricator, something that is essential to some programs.

[Test Case]

In the Python interactive console, first import the library:

phab = Phabricator(host="https://phab.lubuntu.me/api/", token="API KEY")

(for example)

Then, with an example commit hash, run this:

phab.diffusion.commit.search(constraints={"query": "a34837de8224"})

It should correctly return a result, rather than erroring out as shown below.

[Regression Potential]

Very unlikely. If the interpretation of the JSON file somehow changes in the underlying Python code, it could regress, but the more likely scenario is that the API changes again in upstream Phabricator, which will need another SRU to adjust.

[Original Description]

I'm looking to improve some Phabricator code for Lugito (Lubuntu's Python script which acts as a hook for commits such as IRC notifications), and I can't use diffusion.commit.search because there's no support for it yet.

>>> phab.diffusion.commit.search(constraints={"query": "a34837de8224"})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/phabricator/__init__.py", line 248, in __call__
    return self._request(**kwargs)
  File "/usr/lib/python3/dist-packages/phabricator/__init__.py", line 323, in _request
    data = self._parse_response(response)
  File "/usr/lib/python3/dist-packages/phabricator/__init__.py", line 333, in _parse_response
    raise APIError(parsed['error_code'], parsed['error_info'])
phabricator.APIError: ERR-CONDUIT-CALL: Conduit API method "commit.search" does not exist.

However, my Phabricator instance (last updated about a week ago) says this under diffusions.querycommits:

Frozen Method: This method is frozen and will eventually be deprecated. New code should use "diffusion.commit.search" instead.

A patch adding support for this is available upstream: https://github.com/disqus/python-phabricator/commit/a52c0e1357532f9ef8b26321d3728a0edead6ed4

This needs to be backported, or functionality will be lost.

Simon Quigley (tsimonq2) on 2018-08-09
Changed in python-phabricator (Ubuntu Bionic):
status: New → Confirmed
Changed in python-phabricator (Ubuntu Cosmic):
status: New → Confirmed
Changed in python-phabricator (Ubuntu Bionic):
importance: Undecided → High
Changed in python-phabricator (Ubuntu Cosmic):
importance: Undecided → High
Changed in python-phabricator (Ubuntu Bionic):
assignee: nobody → Simon Quigley (tsimonq2)
Changed in python-phabricator (Ubuntu Cosmic):
assignee: nobody → Simon Quigley (tsimonq2)
Simon Quigley (tsimonq2) wrote :
Changed in python-phabricator (Ubuntu Cosmic):
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-phabricator - 0.7.0-1ubuntu1

---------------
python-phabricator (0.7.0-1ubuntu1) cosmic; urgency=medium

  * Add diffusion.commit.search endpoint to interfaces.json (LP: #1786337).

 -- Simon Quigley <email address hidden> Thu, 09 Aug 2018 15:03:16 -0500

Changed in python-phabricator (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Simon Quigley (tsimonq2) on 2018-08-09
description: updated
Changed in python-phabricator (Debian):
status: Unknown → New

Hello Simon, or anyone else affected,

Accepted python-phabricator into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-phabricator/0.7.0-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python-phabricator (Ubuntu Bionic):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-bionic
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.