Skip to content

ParsePatchHeader failing on dependabot emails #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alam-chime opened this issue May 1, 2024 · 2 comments · Fixed by #44
Closed

ParsePatchHeader failing on dependabot emails #43

alam-chime opened this issue May 1, 2024 · 2 comments · Fixed by #44
Labels
bug Something isn't working

Comments

@alam-chime
Copy link

alam-chime commented May 1, 2024

From a94db29e472831db7a75ba52e99ab717c17886eb Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <59619111+dependabot[bot]@users.noreply.github.com>
Date: Mon, 29 Apr 2024 17:31:28 +0000
Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20(deps):=20Bump=20schemas=20fr?=
 =?UTF-8?q?om=202.11.20240425191412=20to=202.11.20240429164216=20(#10143)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Gemfile.lock | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Gemfile.lock b/Gemfile.lock
index 5b1718812c..5e83f3d1fa 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -109,7 +109,7 @@ GEM
       faraday
       flipper
       jwt
-    schemas (2.11.20240425191412)
+    schemas (2.11.20240429164216)
       google-protobuf (~> 3.21)
       googleapis-common-protos-types
       twirp (>= 1.7)

For the above patch, ParsePatchHeader is failing with mail: missing @ in addr-spec. I completely understand that the email 59619111+dependabot[bot]@users.noreply.github.com is invalid, and the code for parsing logic belongs to net/mail package. Just wanted to post it hear anyways to hear your thoughts on it. Please close it as invalid if it's not worth your time. Thank you!

@bluekeyes
Copy link
Owner

Thanks for reporting this. I'm guessing that git will accept this patch, but I'll need to test - if it does, then this library should accept it as well.

@bluekeyes
Copy link
Owner

Git happily accepts this email format, so I consider this a bug in go-gitdiff. To fix it, I need to avoid the net/mail package for this parsing and use the existing ParsePatchIdentity function. But after reviewing how Git handles the From line, that function also needs some updates so the full fix here is more involved. I'll hopefully have something in the next few days.

@bluekeyes bluekeyes added the bug Something isn't working label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants