Bug 15270

Summary: patchtest-send-results should reply to specific threads
Product: [Yocto Project Subprojects] Patchwork/Patchtest Reporter: Trevor Gamblin <tgamblin>
Component: PatchtestAssignee: Trevor Gamblin <tgamblin>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: Medium+ CC: mhalstead, randy.macleod, richard.purdie, ross.burton
Version: 5.0   
Target Milestone: 5.1 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Trevor Gamblin 2023-10-30 15:29:03 UTC
the boto3 send_email function that patchtest-send-results uses does not provide a means to specify a thread to reply to. send_raw_email does but will require more careful construction of the reply patch. Ideally, patchtest-send-results should at least provide the option to specify a particular thread/message ID to reply to, if not make it the default.
Comment 1 Richard Purdie 2023-10-31 10:27:57 UTC
Make it the default please!
Comment 2 Richard Purdie 2023-10-31 10:28:30 UTC
*** Bug 15271 has been marked as a duplicate of this bug. ***
Comment 3 Trevor Gamblin 2023-11-01 15:47:44 UTC
Did some investigating into this and found that there are actually two message IDs for patches on the mailing list, as described by the email headers: the "X-Orig-Message-Id" and the "Message ID". The latter seems to be what is needed to reply correctly to a message thread, but the former is what is available in the patch files that patchtest pulls from Patchwork. 

The Groups.io Help Center page confirms that it replaces the original message ID and renames the old one if a checkbox is selected in the account preferences (for a mailing list?): https://groups.io/helpcenter/membersmanual?single=true under "Seeing copies of your own messages that you email to groups":

"For those interested in the technical details: When this checkbox is selected, Groups.io replaces the Message-Id header with a new, system-generated one and renames the original Message-Id header to X-Orig-Message-Id."

I'm not sure what the larger implications for the mailing list usability would be if this is indeed an account setting for openembedded-core@lists.openembedded.org. If true and we don't want to change the groups.io settings, some extra function could be written to scan the mailing list for the right patch and get the new message ID, but that could have a lot of test time/validation impacts.
Comment 4 Trevor Gamblin 2023-11-01 16:51:19 UTC
We'll have to scan the mailing list and compare message IDs to get the right one to respond against.
Comment 5 Trevor Gamblin 2023-11-01 18:21:35 UTC
After review that's incorrect - I was operating under incorrect assumptions about message ID mangling. Submitted a patch to use In-Reply-To with results emails.
Comment 8 Randy MacLeod 2024-02-08 16:00:46 UTC
Trevor is working on this.
Comment 9 Trevor Gamblin 2024-02-09 15:25:15 UTC
Sent a patch to add the 'References' header to patchtest-send-results in oe-core. That should fix this issue.
Comment 10 Randy MacLeod 2024-02-22 16:03:22 UTC
Michael, Trevor is mostly waiting for your input on why the threading isn't working.
Comment 11 Trevor Gamblin 2024-02-22 17:36:24 UTC
Steve was right in the bug triage meeting - it seems to be threading properly now. I'll keep an eye on it and reopen this if there are instances where it doesn't.
Comment 14 Trevor Gamblin 2024-09-03 13:28:08 UTC
I haven't seen patchtest fail to thread responses in a while. It would still be good to improve the subject line in its replies, but that's not a factor in whether it replies to the right email. I'll close this for now, but if we see problems again then it can be reopened.