Bug 7327 - Add git hook to update bug status
Summary: Add git hook to update bug status
Status: NEW
Alias: None
Product: Bugzilla
Classification: Infrastructure
Component: bugzilla (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: Future
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
: 9817 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-02-16 17:38 UTC by Michael Wood
Modified: 2024-11-14 16:22 UTC (History)
8 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Wood 2015-02-16 17:38:23 UTC
I'd be useful if bug status were automatically updated once the patch is in tree. Not just because it's time saved updating bug status but also for the value in the email notification generated for QA fixer.

It should be fairly easy to scrape the commit message body for [YOCTO #nnnn] and then the bug number parsed.

Various tools exist to update the bug status such as pybugz http://www.liquidx.net/pybugz/
Comment 1 Paul Eggleton 2015-02-19 15:48:00 UTC
The consensus is that we wouldn't want to mark bugs resolved automatically, however we should be at the very least adding a comment to the bug with a link to the commit.

Richard raised another concern that this should not impose additional time on his process of pushing changes, so it would have to be either completely independent of the pushing client, or a process that simply gets triggered at the end of pushing and asynchronously does the bugzilla updates on a server somewhere.
Comment 2 Paul Eggleton 2015-11-18 22:24:16 UTC
We may do this from patchwork rather than from a separate script, since that's already triggered when commits are pushed to the git repository.
Comment 3 Ross Burton 2017-01-11 17:19:44 UTC
I was reminded about this by looking at a bug in glibc, which does comment in bugs when a commit references the bug.  As we agreed it doesn't do anything apart from leave a comment:

https://sourceware.org/bugzilla/show_bug.cgi?id=20019#c14

Gitzilla (https://github.com/gera/gitzilla) appears to make this fairly simple, and the reminder that a patch has landed will be very useful to ensure bugs are closed and alert users that their bugs are resolved.

Is there any chance we can get this done sooner rather than later?
Comment 4 Michael Halstead 2018-11-09 15:30:32 UTC
Would you expect the bugzilla entry to be similar to the sourceware comment you linked to?
Comment 5 Ross Burton 2018-11-09 15:47:55 UTC
Yes, similar, the commit log and patch summary would be good to help identify what landed.
Comment 6 Ross Burton 2020-11-05 08:10:57 UTC
*** Bug 9817 has been marked as a duplicate of this bug. ***
Comment 7 Randy MacLeod 2022-11-10 15:55:57 UTC
A script rather than a git hook is what people prefer. Ross claims to have a starting point.
Comment 8 Ross Burton 2022-11-10 15:57:57 UTC
So some time ago I wrote a little script that looks through the git history (up to a certain point), looking for mentioned bugs that are still open:

https://github.com/rossburton/ross-tools/blob/master/git-find-bugs

No idea if it still works...