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

Bug #1786337 reported by Simon Quigley
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-phabricator (Debian)
New
Unknown
python-phabricator (Ubuntu)
Fix Released
High
Simon Quigley
Bionic
Fix Released
High
Simon Quigley
Cosmic
Fix Released
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)
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)
Revision history for this message
Simon Quigley (tsimonq2) wrote :
Changed in python-phabricator (Ubuntu Cosmic):
status: Confirmed → Fix Committed
Revision history for this message
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)
description: updated
Changed in python-phabricator (Debian):
status: Unknown → New
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

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
Revision history for this message
Brian Murray (brian-murray) wrote : [python-phabricator/bionic] verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for bionic for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Revision history for this message
Steve Langasek (vorlon) wrote :
Download full text (4.6 KiB)

$ python -c 'from phabricator import Phabricator; phab = Phabricator(host="https://phab.lubuntu.me/api/", token="API KEY"); phab.diffusion.commit.search(constraints={"query": "a34837de8224"})'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/phabricator/__init__.py", line 248, in __call__
    return self._request(**kwargs)
  File "/usr/lib/python2.7/dist-packages/phabricator/__init__.py", line 323, in _request
    data = self._parse_response(response)
  File "/usr/lib/python2.7/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.
$ python3 -c 'from phabricator import Phabricator; phab = Phabricator(host="https://phab.lubuntu.me/api/", token="API KEY"); phab.diffusion.commit.search(constraints={"query": "a34837de8224"})'
Traceback (most recent call last):
  File "<string>", 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.
$ sudo apt install python3-phabricator python-phabricator
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  python-phabricator python3-phabricator
2 upgraded, 0 newly installed, 0 to remove and 45 not upgraded.
Need to get 32.8 kB of archives.
After this operation, 5120 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 python-phabricator all 0.7.0-1ubuntu0.1 [16.1 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 python3-phabricator all 0.7.0-1ubuntu0.1 [16.7 kB]
Fetched 32.8 kB in 1s (45.4 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 23490 files and directories currently installed.)
Preparing to unpack .../python-phabricator_0.7.0-1ubuntu0.1_all.deb ...
Unpacking python-phabricator (0.7.0-1ubuntu0.1) over (0.7.0-1) ...
Preparing to unpack .../python3-phabricator_0.7.0-1ubuntu0.1_all.deb ...
Unpacking python3-phabricator (0.7.0-1ubuntu0.1) over (0.7.0-1) ...
Setting up python-phabricator (0.7.0-1ubuntu0.1) ...
Setting up python3-phabricator (0.7.0-1ubuntu0.1) ...
$ python -c 'from phabricator import Phabricator; phab = Phabricator(host="https://phab.lubuntu.me/api/", token="API KEY"); phab.diffusion.commit.search(constraints={"query": "a34837de8224"})'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/phabricator/__init__.py", line 248, in __call__
    return self._request(**kwargs)
  File "/usr/lib/python2.7/dist-packages/phabricat...

Read more...

Revision history for this message
Ben (docbrown-) wrote :
Download full text (3.6 KiB)

I have tested the bionic proposed update in the bionic docker container and can confirm the fix:

root@hillValley:/# python -c 'from phabricator import Phabricator; phab = Phabricator(host="http://127.0.0.1:9091/api/", token="api-nojs2ip33hmp4zn6u6cf72w7d6yh"); phab.diffusion.commit.search(constraints={"query": "b634a23c82be"})'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/phabricator/__init__.py", line 248, in __call__
    return self._request(**kwargs)
  File "/usr/lib/python2.7/dist-packages/phabricator/__init__.py", line 323, in _request
    data = self._parse_response(response)
  File "/usr/lib/python2.7/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.

root@hillValley:/# python3 -c 'from phabricator import Phabricator; phab = Phabricator(host="http://127.0.0.1:9091/api/", token="api-nojs2ip33hmp4zn6u6cf72w7d6yh"); phab.diffusion.commit.search(constraints={"query": "b634a23c82be"})'
Traceback (most recent call last):
  File "<string>", 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.

root@hillValley:/# apt-get install -y python-phabricator/bionic-proposed python3-phabricator/bionic-proposed
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '0.7.0-1ubuntu0.1' (Ubuntu:18.04/bionic-proposed [all]) for 'python-phabricator'
Selected version '0.7.0-1ubuntu0.1' (Ubuntu:18.04/bionic-proposed [all]) for 'python3-phabricator'
The following packages will be upgraded:
  python-phabricator python3-phabricator
2 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
Need to get 32.8 kB of archives.
After this operation, 5120 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 python-phabricator all 0.7.0-1ubuntu0.1 [16.1 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 python3-phabricator all 0.7.0-1ubuntu0.1 [16.7 kB]
Fetched 32.8 kB in 1s (22.2 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 7544 files and directories currently installed.)
Preparing to unpack .../python-phabricator_0.7.0-1ubuntu0.1_all.deb ...
Unpacking python-phabricator (0.7.0-1ubuntu0.1) over (0.7.0-1) ...
Preparing to unpack .../python3-phabricator_0.7.0-1ubuntu0.1_all.deb ...
Unpacking python3-phabricator (0.7.0-1ubuntu0.1) over (0.7.0-1) ...
Setting up python-phabricator (0.7.0-1ubuntu0.1) ...
Setting up python3-phabricator (0.7.0-1ubuntu0.1) ...

root@hi...

Read more...

Thomas Ward (teward)
tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
python-phabricator (0.7.0-1ubuntu0.1) bionic; 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 Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for python-phabricator has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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