[Starlingx-discuss] FYI: Linking commits/reviews to Launchpad bugs

Penney, Don Don.Penney at windriver.com
Fri May 10 18:23:09 UTC 2019

Further to this, it's also important to note that the Closes-Bug tag CANNOT include the URL to the Launchpad bug report. It must be just the ID.

Valid tag:
Closes-Bug: 1827326

Closes-Bug: https://bugs.launchpad.net/starlingx/+bug/1827326

From: Penney, Don
Sent: Tuesday, May 07, 2019 3:12 PM
To: 'starlingx-discuss at lists.starlingx.io' (starlingx-discuss at lists.starlingx.io)
Subject: FYI: Linking commits/reviews to Launchpad bugs

Hi all,

I've learned a bit more this afternoon about how Gerrit updates Launchpad bugs based on the commit messages in reviews and thought I should share and clarify some things for folks.

As noted on the wiki:

if you're working on a Launchpad bug, you need to specify one or more tags in the commit message for Closes-Bug, Partial-Bug, or Related-Bug with the Launchpad bug number, such as:
Closes-Bug: 123456

We've also seen that it appears this tag must be in the final section of your commit message, ie. no blank lines following it... so the following is good:

This commit fixes the typos.

Change-Id: If46f03a5d042f949db9359d6ddd7f69790ccaf4f
Closes-Bug: 1827326
Signed-off-by: Don Penney <don.penney at windriver.com>

whereas the following would appear to be ignored (I'm not sure why, yet):

This commit fixes the typos.

Closes-Bug: 1827326

Change-Id: If46f03a5d042f949db9359d6ddd7f69790ccaf4f
Signed-off-by: Don Penney <don.penney at windriver.com>

Two things will happen when the tag is processed correctly:

1.       Gerrit will mark the Launchpad bug as "In Progress" (or different status for merged or abandoned, of course)

2.       Gerrit will add a comment to the bug indicating "Fix proposed" ... BUT ONLY ON THE INITIAL PATCHSET

The note on that second point is important... If you do not set the tag correctly on the initial review creation, Gerrit WILL NOT add a comment linking back to your review. In which case, you should probably do this manually yourself. (I suspect this is intended to avoid adding a comment every time the review is updated.)

When you create your review, you can click on the bug link in Gerrit and should see the state change and comment in Launchpad. If you don't see that, Gerrit did not process your tag correctly.


Don Penney, Developer, Wind River

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.starlingx.io/pipermail/starlingx-discuss/attachments/20190510/88f5e4f1/attachment.html>

More information about the Starlingx-discuss mailing list