mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] runbot_merge: error-reporting during PR sync
This commit is contained in:
parent
76c4d24bf5
commit
899ee4e2c4
@ -4,6 +4,7 @@ import logging
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
from odoo.exceptions import UserError
|
||||||
from . import exceptions
|
from . import exceptions
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
@ -115,14 +116,17 @@ class GH(object):
|
|||||||
cursor = None
|
cursor = None
|
||||||
owner, name = self._repo.split('/')
|
owner, name = self._repo.split('/')
|
||||||
while True:
|
while True:
|
||||||
response = self._session.post('{}/graphql'.format(self._url), json={
|
r = self._session.post('{}/graphql'.format(self._url), json={
|
||||||
'query': PR_QUERY,
|
'query': PR_QUERY,
|
||||||
'variables': {
|
'variables': {
|
||||||
'owner': owner,
|
'owner': owner,
|
||||||
'name': name,
|
'name': name,
|
||||||
'cursor': cursor,
|
'cursor': cursor,
|
||||||
}
|
}
|
||||||
}).json()
|
})
|
||||||
|
response = r.json()
|
||||||
|
if 'data' not in response:
|
||||||
|
raise UserError('\n'.join(e['message'] for e in response.get('errors', map(str, [r.status_code, r.reason, r.text]))))
|
||||||
|
|
||||||
result = response['data']['repository']['pullRequests']
|
result = response['data']['repository']['pullRequests']
|
||||||
for pr in result['nodes']:
|
for pr in result['nodes']:
|
||||||
|
Loading…
Reference in New Issue
Block a user