Skip to content

Instantly share code, notes, and snippets.

@tflink
Last active April 8, 2020 22:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tflink/1a1ed4263fbeb56b04442a948770965f to your computer and use it in GitHub Desktop.
quick python script to show issue I'm having with querying results in resultsdb
import requests
nvr1 = "switchboard-plug-about.2.6.2-1.fc31"
nvr2 = "elementary-photos-2.7.0-1.fc33"
print("looking for results nvr={}".format(nvr1))
params = {'nvr':nvr1}
r = requests.get('http://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/results', params=params)
print(r.json())
print("looking for results item={}".format(nvr1))
params = {'item':"switchboard-plug-about.2.6.2-1.fc31"}
r = requests.get('http://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/results', params=params)
print(r.json())
print("looking for results nvr={}".format(nvr2))
params = {'nvr':nvr2}
r = requests.get('http://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/results', params=params)
print(r.json())
$ python3 debug_resultsdb.py
looking for results nvr=switchboard-plug-about.2.6.2-1.fc31
{'data': [], 'next': None, 'prev': None}
looking for results item=switchboard-plug-about.2.6.2-1.fc31
{'data': [], 'next': None, 'prev': None}
looking for results nvr=elementary-photos-2.7.0-1.fc33
{'data': [{'data': {'build_id': ['10842'], 'build_url': ['http://fedora-build-checks.apps.ci.centos.org/blue/organizations/jenkins/fedora-rpminspect/detail/fedora-rpminspect/10842/pipeline/'], 'category': ['static-analysis'], 'group': ['None'], 'item': ['elementary-photos-2.7.0-1.fc33'], 'koji_task_id': ['43137718'], 'msg_id': ['2020-3e451a44-5a21-4501-a4d0-c787bcb6effa'], 'namespace': ['fedora-ci.koji-build'], 'nvr': ['elementary-photos-2.7.0-1.fc33'], 'repo': ['elementary-photos'], 'scratch': ['False'], 'status': ['failed'], 'test_type': ['rpminspect'], 'topic': ['org.centos.prod.ci.koji-build.test.complete'], 'type': ['koji_build'], 'username': ['decathorpe']}, 'groups': [], 'href': 'https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/results/39161739', 'id': 39161739, 'note': None, 'outcome': 'FAILED', 'ref_url': 'http://fedora-build-checks.apps.ci.centos.org/blue/organizations/jenkins/fedora-rpminspect/detail/fedora-rpminspect/10842/pipeline/', 'submit_time': '2020-04-08T21:45:53.873292', 'testcase': {'href': 'https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/testcases/fedora-ci.koji-build.rpminspect.static-analysis', 'name': 'fedora-ci.koji-build.rpminspect.static-analysis', 'ref_url': None}}], 'next': None, 'prev': None}
$ http https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/results/39162039
HTTP/1.1 200 OK
AppTime: D=156217
Connection: Keep-Alive
Content-Length: 1186
Content-Type: application/json
Date: Wed, 08 Apr 2020 22:16:29 GMT
Keep-Alive: timeout=15, max=500
Referrer-Policy: same-origin
Server: Apache
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-Fedora-AppServer: resultsdb01.qa.fedoraproject.org
X-Fedora-ProxyServer: proxy06.fedoraproject.org
X-Fedora-RequestID: Xo5NPR6S4nfSJ7ExfEDNogAAB0A
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
{
"data": {
"build_id": [
"10854"
],
"build_url": [
"http://fedora-build-checks.apps.ci.centos.org/blue/organizations/jenkins/fedora-rpminspect/detail/fedora-rpminspect/10854/pipeline/"
],
"category": [
"static-analysis"
],
"group": [
"None"
],
"item": [
"switchboard-plug-about-2.6.2-1.fc31"
],
"koji_task_id": [
"43138200"
],
"msg_id": [
"2020-faf3aa6b-743d-4172-a1c2-2a87768632a3"
],
"namespace": [
"fedora-ci.koji-build"
],
"nvr": [
"switchboard-plug-about-2.6.2-1.fc31"
],
"repo": [
"switchboard-plug-about"
],
"scratch": [
"False"
],
"status": [
"passed"
],
"test_type": [
"rpminspect"
],
"topic": [
"org.centos.prod.ci.koji-build.test.complete"
],
"type": [
"koji_build"
],
"username": [
"decathorpe"
]
},
"groups": [],
"href": "https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/results/39162039",
"id": 39162039,
"note": null,
"outcome": "PASSED",
"ref_url": "http://fedora-build-checks.apps.ci.centos.org/blue/organizations/jenkins/fedora-rpminspect/detail/fedora-rpminspect/10854/pipeline/",
"submit_time": "2020-04-08T21:56:56.561836",
"testcase": {
"href": "https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/testcases/fedora-ci.koji-build.rpminspect.static-analysis",
"name": "fedora-ci.koji-build.rpminspect.static-analysis",
"ref_url": null
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment