Merge "Use /detail in check-release-approval queries"

This commit is contained in:
Zuul 2020-03-19 13:26:41 +00:00 committed by Gerrit Code Review
commit af1c4b810c

View File

@ -67,17 +67,14 @@ class GerritChange(object):
LOG.warning( LOG.warning(
'\ndata from gerrit is missing required keys:\n\n%s\n', '\ndata from gerrit is missing required keys:\n\n%s\n',
json.dumps(self.raw_data, indent=2)) json.dumps(self.raw_data, indent=2))
LOG.warning("Retrying once...") raise
self.load_from_gerrit(args.changeid)
LOG.warning("Second try was successful.")
self.workspace = args.releases self.workspace = args.releases
def load_from_gerrit(self, changeid): def load_from_gerrit(self, changeid):
# Grab changeid details from Gerrit # Grab changeid details from Gerrit
call = 'changes/%s' % changeid + \ call = 'changes/%s/detail' % changeid + \
'?o=CURRENT_REVISION&o=CURRENT_FILES&o=DETAILED_LABELS' + \ '?o=CURRENT_REVISION&o=CURRENT_FILES'
'&o=DETAILED_ACCOUNTS'
raw = requests.get(GERRIT_URL + call) raw = requests.get(GERRIT_URL + call)
# Gerrit's REST API prepends a JSON-breaker to avoid XSS # Gerrit's REST API prepends a JSON-breaker to avoid XSS