From: Simon Glass <sjg@chromium.org>
Add tout.debug() calls throughout the autolink pipeline so failures
can be diagnosed with -v. Log the patchwork URL resolution, project
lookup, series queries and autolink progress.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
tools/patman/control.py | 1 +
tools/patman/cseries.py | 8 ++++++++
tools/patman/patchwork.py | 5 +++--
3 files changed, 12 insertions(+), 2 deletions(-)
@@ -182,6 +182,7 @@ def do_series(args, test_db=None, pwork=None, cser=None):
cser.open_database()
if args.subcmd in needs_patchwork:
ups = cser.get_series_upstream(args.series)
+ tout.debug(f'Series upstream: {ups!r}')
pwork = _setup_patchwork(
cser, pwork, ups, args.patchwork_url)
elif pwork and pwork is not True:
@@ -302,11 +302,19 @@ class Cseries(cser_helper.CseriesHelper):
stop = start + wait_s
sleep_time = 5
last_options = None
+ first = True
while True:
pws, options, name, version, desc = self.link_search(
pwork, series, version)
+ if first:
+ tout.debug(f"Autolinking series '{name}' v{version}"
+ f" (timeout {wait_s}s)")
+ first = False
+ tout.debug(f"Searching {pwork.url} project {pwork.proj_id}"
+ f" for '{desc}'")
if pws:
tout.clear_progress()
+ tout.debug(f'Found link: {pws}')
if wait_s:
tout.notice('Link completed after '
f'{self.get_time() - start} seconds')
@@ -281,8 +281,9 @@ class Patchwork:
list of series matches, each a dict, see get_series()
"""
query = desc.replace(' ', '+')
- return await self._request(
- client, f'series/?project={self.proj_id}&q={query}')
+ subpath = f'series/?project={self.proj_id}&q={query}'
+ tout.debug(f' GET {self.url}/api/1.2/{subpath}')
+ return await self._request(client, subpath)
async def _find_series(self, client, svid, ser_id, version, ser):
"""Find a series on the server