Page MenuHomePhabricator

Labslogbot should auto-link git hashes and Gerrit change-ids
Closed, ResolvedPublic


Now that deployment is doing from Git/Gerrit please modify Logmsgbot/Morebots in a way that entries in the Server admin log with a reference to Gerrit like 'g4102' (see ) are linked to Gerrit.



Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:12 AM
bzimport set Reference to bz35876.

Using {{gerrit|1234}} markup works, see .
Not sure how common g1234 format is, at least I couldn't find a recent entry with this.

It should link Git hashes and gerrit change-id hashes, those are recommended form for identifiers of changes. During deployment a git hash is most precise (not ambiguous between different branches and usable in Git outside Gerrit context).

Regexes for these can be found in the Gerrit configuration and Bugzilla configuration, which already have these.

Should probably be added to the syntax morebots already has for expanding "bug 123" to {{bug|123}} which displays [[bugzilla:123|bug 123]].

I updated the {{Gerrit}} template on wikitech to also take git hashes and gerrit change-ids, so it should be easier to expand for more bots.

It only has to expand the matched hashes to {{Gerrit|<match>}}.

Related URL: (Gerrit Change I0a7ca5450f9f74ebd36fb47f8e30d2fc8135df97)

Current status: 68135 was deployed, but I was dumb and screwed up the regexp. (It matches '2013', for example.)

I worked around some of the bugs in, but I should fix the regexp.

I wonder if perhaps we should avoid doing *any* special processing of the message content in adminbot and instead just wrap the entire message in a template or module invocation, like:

{{SAL|17:33 mutante: upgrading binutils and libldap on bast1001}}

That way we do all the fancy string processing in Lua. We'd be able to tweak it / enhance it without relying on rebuilding the adminbot package.

Krinkle edited projects, added Stashbot; removed WMF-General-or-Unknown.
Krinkle set Security to None.
Krinkle removed a subscriber: Krinkle.

I've started a template on wikitech to do the sort of linking that my sal tool does. As suggested by @ori, the template uses a lua module to do the text processing. @Stashbot will start using this soon.

Mentioned in SAL (#wikimedia-labs) [2016-11-14T04:53:08Z] <bd808> Restarted for wrap wiki entries in [[Template:SAL entry]] (T37876)