Skip to content

Commit 2df8842

Browse files
committed
fix: avoid collapsing distinct authors with missing From header (CM-1318)
Signed-off-by: Uroš Marolt <uros@marolt.me>
1 parent 977d45e commit 2df8842

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

services/apps/mailing_list_integration/src/crowdmail/services/parse/noteren.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@ def parse_email(
228228
except ValueError:
229229
author = None
230230
if author is None:
231-
author = "Unknown <unknown@kernel.org>"
231+
# Synthesize a per-message identity keyed on git_id instead of a fixed
232+
# placeholder — a shared "unknown@kernel.org" would otherwise collapse
233+
# every unattributable message from distinct real authors into one
234+
# member.
235+
author = f"Unknown <unknown+{git_id}@kernel.org>"
232236
author_name, author_email = parse_author(author)
233237

234238
# The b4 tool provides a relay for sending patches to the list, if it is

services/apps/mailing_list_integration/src/test/test_noteren.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ def parsebytes(self, message):
367367
monkeypatch.setattr(noteren, "get_body", lambda msg: "line\n")
368368
parsed = _parse_email(b"irrelevant", "src", "chan", "commit1", "blob1")
369369
assert parsed["activityData"]["member"]["displayName"] == "Unknown"
370-
assert parsed["activityData"]["member"]["identities"][0]["value"] == "unknown@kernel.org"
370+
assert parsed["activityData"]["member"]["identities"][0]["value"] == "unknown+commit1@kernel.org"
371371

372372

373373
def test_parse_id_writes_json(monkeypatch):

0 commit comments

Comments
 (0)