Bug 9817

Summary: add a robot that tracks when patches are sent to mailing list for review and merged into master branches
Product: [Infrastructure] Bugzilla Reporter: Alexander Kanavin <alex.kanavin>
Component: bugzillaAssignee: Michael Halstead <mhalstead>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: Medium CC: bluelightning, infras.bug.watcher, Infras.watcher, ross.burton, tim.orling
Version: unspecified   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
See Also: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7327
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Alexander Kanavin 2016-06-23 13:16:27 UTC
Currently when a patch associated with a bug is posted for review or merged into repository, the bug has to be manually updated with a link to it. Humans are bad at this kind of activity, but it can be entirely automated, because there is already an established practice to include the bug number into the patch.

So the robot would add comments to the bug with a link to either the maillist archive or the git web UI.
Comment 1 Michael Halstead 2016-06-29 19:46:52 UTC
It appears https://github.com/gera/gitzilla will support what we want here. 

Which repos do we need to watch for bug numbers? Is poky enough? 

Does this regex grab all the bug numbers we need?

git log | python -c "import sys,re; bug_id = re.compile(r'.*\[YOCTO[ #]*(\d{3,5})[^]]*\]'); print([bug_id.match(line).group(1) for line in sys.stdin if bug_id.match(line)])"
Comment 2 Alexander Kanavin 2016-06-30 13:43:30 UTC
We also need something that would track the mailing lists.

The regex could be simplified:
 - no need to match exactly between 3 and 5 digits (any amount will do, no?)
 - no need to do matching beyond the digits

Ross?
Comment 3 Ross Burton 2016-06-30 13:46:00 UTC
Indeed Gitzilla looks like it should work.

My little tool uses the regex r"(YOCTO|YP) ?#?(?P<bug>[0-9]+)" with re.IGNORECASE.

There's example of bugs using YP#1234 or Yocto#1234 or YOCTO 1234.  The square brackets are not used consistently enough so I dropped them from the match.
Comment 4 Ross Burton 2020-11-05 08:10:57 UTC
Duplicate

*** This bug has been marked as a duplicate of bug 7327 ***