Bug 1630691
| Summary: | The 'search bug' API's result does not match the documentation. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Community] Bugzilla | Reporter: | Jingyi Wang <jingywan> | ||||
| Component: | Documentation | Assignee: | PnT DevOps Devs <hss-ied-bugs> | ||||
| Status: | CLOSED NOTABUG | QA Contact: | tools-bugs <tools-bugs> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 5.0 | CC: | khong, qgong, qzhang, yhong | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2018-10-04 00:14:44 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Jingyi Wang
2018-09-19 06:36:37 UTC
Created attachment 1484584 [details]
The actual results.
The actual result is in the attachment.
Here's the source code to reproduce:
import requests
if __name__ == "__main__":
r = requests.get('https://bugzilla5.redhat.com/rest/bug?'
+ 'qa_contact=yhong')
print json.loads(r.text)
The RPC Interface is experimental, you will find bugs, and we may not prioritize fixing them. From https://bugzilla5.redhat.com/docs/en/html/integrating/api/Bugzilla/WebService/Server/REST.html?highlight=experimental#description "Please note that everything about this REST interface is EXPERIMENTAL." (In reply to Jingyi Wang from comment #0) > > requests.get('https://bugzilla5.redhat.com/rest/bug?qa_contact=yhong@redhat. > com') I think that server has some firewall or proxy issues that cause it to do weird things. If you try partner-bugzilla.redhat.com it will probably work. e.g. if you just click that link a few times, sometimes you'll get a nice json payload, other times you will get weird stuff. (In reply to Jeff Fearn from comment #3) > The RPC Interface is experimental, you will find bugs, and we may not > prioritize fixing them. > > From > https://bugzilla5.redhat.com/docs/en/html/integrating/api/Bugzilla/ > WebService/Server/REST.html?highlight=experimental#description > > "Please note that everything about this REST interface is EXPERIMENTAL." > > (In reply to Jingyi Wang from comment #0) > > > > requests.get('https://bugzilla5.redhat.com/rest/bug?qa_contact=yhong@redhat. > > com') > > I think that server has some firewall or proxy issues that cause it to do > weird things. If you try partner-bugzilla.redhat.com it will probably work. > > e.g. if you just click that link a few times, sometimes you'll get a nice > json payload, other times you will get weird stuff. There are still some questions: 1. The solutions above are for Bugzilla 5, it's not stable and 'partner-bugzilla' still returns weird stuff. 2. If I use Bugzilla 4, which API should I use? If it is RPC, what would the server url be? could you give me an example? I don't think the partner server is returning invalid data, at least I can't duplicate it. cCick this link, attach any invalid data you can get to this bug. https://partner-bugzilla.redhat.com/rest/bug?qa_contact=yhong@redhat.com I know nothing about python, maybe you can give python-bugzilla a try? It has an active community. https://github.com/python-bugzilla/python-bugzilla I don't think this is a bug, I think your script is mishandling the attachment data.
You can try something like this, which works fine for me:
r = requests.get('https://partner-bugzilla.redhat.com/rest/bug?qa_contact=yhong@redhat.com', json=payload, allow_redirects=True, proxies=None)
print r
print r.status_code
print r.json
print r.raise_for_status()
print r.headers
print r.history
|