Skip to content
Vesa Poikajärvi edited this page May 6, 2013 · 9 revisions

QA Reports can be loosely integrated with some external service like Bugzilla. These services are configured in file config/external.services.yml which by default only includes one Bugzilla service. For the "integration" to work the service must provide an URI scheme to which an item ID can be placed, and the URI would then lead to that specific item in the service (e.g. http://bugs.domain.com/show_bug.cgi?id=1234 or http://gerrit.domain.com/1234/).

Currently there are three types of service - bugzilla, gerrit, and link. Bugzilla and Gerrit integrations actually fetch some data (short description and status) and show that on the report page, and link is just a dummy integration that will generate a link to specified service. Notice: The Gerrit integration currently works only with the legacy numerical IDs.

When you have only one external service configured the links of format 1234 in text fields and comments will lead to that specific service. When using multiple services each service must have a prefix defined so the correct service can be identified. You could have e.g. prefix BZ for Bugzilla and CM for Gerrit, and then links such as BZ#1234 and CM#1234 would lead to Bugzilla and Gerrit respectively. One of the services is defined as default and used if a link without a prefix or with an unknown prefix is found.

So for further demonstration - this feature turns this

into this

Somewhat related are the options for default prefix in config/config.yml for two REST API endpoints. Since Issue Summary and Patches Included are sections that quite often contain only a list of IDs a shortcut API parameter is provided for delivering the IDs as a list. The default prefixes for both of these endpoints are defined in config/config.yml.

Example configuration

This configuration shows an example that adds integration by ID to Bugzilla, Gerrit, and Gerrit as plain link. It also shows the keys needed by currently supported handlers. Notice, that URLs are sprintf'd so all % signs must be escaped (i.e. % -> %%) and each URI must contain ONE %s marker which is replaced by the ID (in case of link_uri) or query parameters (uri parameter of Gerrit and Bugzilla).

Notice: Currently the prefixes must contain only characters A-Z and IDs must be numeric!

- name:     Bugzilla
  server:   bugs.domain.com
  port:     443
  use_ssl:  true
  prefix:   BZ
  default:  true
  type:     bugzilla
  uri:      /buglist.cgi?bugidtype=include&columnlist=short_desc%%2Cbug_status%%2Cresolution&query_format=advanced&ctype=csv&bug_id=%s
  link_uri: https://bugs.domain.com/show_bug.cgi?id=%s
  proxy_server:
  proxy_port:
  http_username:
  http_password:
  bugzilla_username:
  bugzilla_password:

- name:     Gerrit
  prefix:   CM
  default:  false
  type:     link
  link_uri: http://review.cyanogenmod.org/%s

- name:       Gerrit Integration
  server:     review.cyanogenmod.org
  port:       80
  use_ssl:    false
  prefix:     CMI
  default:    false
  type:       gerrit
  uri:        /query?q=%s
  link_uri:   http://review.cyanogenmod.org/%s
  proxy_server: 
  proxy_port:
  http_username:
  http_password:

Clone this wiki locally