Page MenuHomePhabricator

Bugzilla gerrit bot should use a shorter format
Closed, DeclinedPublic

Description

Bugzilla gerrit bot should use a shorter format. The current one is overloaded with two links to gerrit change.

Example bot post:

Related URL: https://gerrit.wikimedia.org/r/60705 (Gerrit Change
I3517a9aab8fa8935a86130c4bbdc0ce117f28f02)

This would suffice:

Related gerrit change: I3517a9aa.


Version: wmf-deployment
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=47622

Details

Reference
bz47621

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:35 AM
bzimport added a project: Gerrit.
bzimport set Reference to bz47621.
bzimport added a subscriber: Unknown Object (MLST).

That bug slipped through :-/ Sorry.

Those two links do not refer to the same thing:

  • https://gerrit.wikimedia.org/r/60705 is tied to a project, a branch, and a Change-Id. So we need that number to unabiguously see to which project, branch, change-id this change belongs to.
  • I3517a9aab8fa8935a86130c4bbdc0ce117f28f02 allows to reference changes across branches.

While the first variant gives you an immediate link to the change on
the correct project/branch in Gerrit, 60705 is not stored in git
commit messages. So you cannot grep for it in git log, and it's harder
to see if the patch has been integrated in your branch etc. For those
latter use cases, the Change-Id comes in handy.

By dropping either of those links, we'd fail to give some group the
information they'd need. Hence, I'd rather keep them both.

For abbreviating the Change-Id ... I am not a huge fan of using
trimmed hashes as ids, or references. Especially if they are not real
hashes, but user supplied strings. The proposed I+8 characters format
gives us 10 collisions already, for a single year of using gerrit.
E.g.: "That might be related to I1bbc1ff716" could mean both

I'd like to avoid such vagueness, especially since the likeliness
increases super-linearly :-/

Given that no one would type those ids by hand anyways—regardless if
they are I+8 or I+40 characters—is there a downside to copy/pasting
I+40 characters vs. I+8 characters?

The first part is a good point, you're right.

As for the second, this is likely caused by the commit-msg hook not working reliably (particularly consistently failing to install automatically on Windows). I've had to generate those ids by hand myself (although I did actually SHA1 something when I had to) - for example I48b0e794a39c982544c692757ebaca9a1ed9d909 is I-SHA1 of "matmarex". Really, if git-review could be made to Just Work, these concerns would be moot.

Eh, I was thinking we could make it fit within one line, but I guess that might not be possible without losing information :/

The current format (bug 23942 comment 13) is IMO much better. Closing this per previous comments on how it's impossible :)