From 7625a96bd89e340b6595cf99d1ee6e60b26a508b Mon Sep 17 00:00:00 2001 From: davidvader Date: Tue, 4 Jun 2024 10:05:12 -0500 Subject: [PATCH] chore: verbose comment on fallback user fetch --- api/webhook/post.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/webhook/post.go b/api/webhook/post.go index c514943b9..50d69d315 100644 --- a/api/webhook/post.go +++ b/api/webhook/post.go @@ -208,6 +208,8 @@ func PostWebhook(c *gin.Context) { } // attach a sender SCM id if the webhook payload from the SCM has no sender id + // the code in ProcessWebhook implies that the sender may not always be present + // fallbacks like pusher/commit_author do not have an id if len(b.GetSenderSCMID()) == 0 || b.GetSenderSCMID() == "0" { // fetch scm user id for pusher senderID, err := scm.FromContext(c).GetUserID(ctx, b.GetSender(), repo.GetOwner().GetToken())