Skip to contentSkip to conversation

pr: Provide more information on PR fetch failures

PATCH New Palmer Dabbelt 1 participant 1 message Oct 12, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pr: Provide more information on PR fetch failures

The error message that triggers when b4 is unable to fetch a PR doesn't indicate whether the trouble was in parsing the message ID or in fetching from the remote. This provides more information.

---
Turns out this was just a PEBKAC, I'd forgotten to turn on my Yubikey so I couldn't fetch from kernel.org via SSH. So I don't really need this any more, but maybe it'll help someone else who ends up doing the same thing.

---
 b4/pr.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
b4/pr.py +6 -1
index 1c00e75..f728828 100644
@@ -495,7 +495,12 @@ def main(cmdargs):
                     break
 
     if lmsg is None or lmsg.pr_remote_tip_commit is None:
-        logger.critical('ERROR: Could not find pull request info in %s', cmdargs.msgid)
+        reason = None
+        if lmsg is None:
+            reason = "unable to determine Message-IDe"
+        else:
+            reason = "unable to determite remote tip commit"
+        logger.critical('ERROR: Could not find pull request info in %s, %s', cmdargs.msgid, reason)
         sys.exit(1)
 
     if not lmsg.pr_tip_commit:
Signature · 1 line
2.38.0