[tor-bugs] #33847 [Internal Services/Services Admin Team]: teach zwiebelbot about GitLab

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Apr 8 18:26:46 UTC 2020


#33847: teach zwiebelbot about GitLab
-------------------------------------------------+-------------------------
 Reporter:  anarcat                              |          Owner:  (none)
     Type:  task                                 |         Status:  new
 Priority:  Medium                               |      Milestone:
Component:  Internal Services/Services Admin     |        Version:
  Team                                           |
 Severity:  Normal                               |     Resolution:
 Keywords:  tickets-migration                    |  Actual Points:
Parent ID:  #30857                               |         Points:
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by anarcat):

 the bot is ran by weasel. it's a linmoria bot with an extra module:

 https://github.com/weaselp/ticketbot/

 we would need to implement a new ticket helper to talk with the GitLab
 API:

 https://github.com/weaselp/ticketbot/blob/master/tickethelpers.py

 in the short term though we could just reuse the `TicketHtmlTitleProvider`
 which just shows the `<title>` tag returned by gitlab. That does not
 include the issue status, however, but it could be good enough at first.
 we would need to extend the class because of the `PATH` prefix.

 the providers are hooked in here:

 https://github.com/weaselp/ticketbot/blob/master/ticketconfig.py

 ... and specifically in, `_setup_channels`, which maps URLs to regexes:

 https://github.com/weaselp/ticketbot/blob/master/ticketconfig.py#L109

 those URLs then are mapped to specific providers in `_setup_providers`.

 the regex could be something like:

 {{{
 regex='(?<!\w)((?<path>[\w/]+)#(?<number>[0-9]{4,}))(?:(?=\W)|$'
 }}}

 note the added `path` and `number` named groups, which could be reused in
 the extended class to properly construct the URL to lookup.

 when we replace trac by gitlab completely, then the PATH group would be
 become optional and default to the legacy project path.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/33847#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list