2 @setfilename debbugs.info
3 @settitle Debbugs programmer's manual
7 * Debbugs: (debbugs). A library for communication with Debbugs.
11 Copyright @copyright{} 2011 Free Software Foundation, Inc.
14 Permission is granted to copy, distribute and/or modify this document
15 under the terms of the GNU Free Documentation License, Version 1.2 or
16 any later version published by the Free Software Foundation; with no
17 Invariant Sections, with the Front-Cover, or Back-Cover Texts. A copy of
18 the license is included in the section entitled ``GNU Free Documentation
19 License'' in the Emacs manual.
21 This document is part of a collection distributed under the GNU Free
22 Documentation License. If you want to distribute this document
23 separately from the collection, you can do so by adding a copy of the
24 license to the document, as described in section 6 of the license.
26 All Emacs Lisp code contained in this document may be used, distributed,
27 and modified without restriction.
32 @top Debbugs programmer's manual
33 Debbugs is a bugtracking system (BTS) that was initially written for
34 Debian project but actually used also by GNU project. The main
35 distinctive feature of Debbugs is that it's mostly email-based. All
36 actions on bug reports: opening, closing, changing the status,
37 commenting, forwarding are performed via email by sending specially
38 composed letters to the partucular mail addresses. However, searching
39 the bug reports, querying bug report status and viewing comments have
40 been web-based for a long time. To overcome this inconvinience the
41 Debbugs/SOAP service was introduced.
43 Debbugs/SOAP service provides the means for developer to write client
44 application that can send the queries with certain search criteria to
45 Debbugs server and retrieve a set of bug reports that match them. The
46 developer may also ask Debbugs server for additional information about
47 every bug report (e. g. subject, date, originator, tags and etc.) and
48 get all comments and attachments.
50 @code{debbugs}, described in this document, is the Emacs library that
51 exposes to developer the available functions provided by Debbugs
52 server. @code{debbugs} uses Emacs SOAP client library for communication
53 with Debbugs server. In tandem with Emacs email facilities,
54 @code{debbugs} provides a solution for building application that
55 interacts with Debbugs BTS directly from Emacs without addressing
56 Debbugs' web interface.
59 * Installation:: Getting and installing @code{debbugs}.
60 * Configuration:: Configuring @code{debbugs}.
61 * Requesting bug numbers:: How to request bug report numbers.
62 * Requesting bugs statuses:: How to request status of bug report.
63 * Requesting messages:: How to get messages from bug report.
69 @subheading Installation on Emacs 24 or later
70 Install @code{debbugs} from ELPA repository.
72 @subheading Installation on Emacs 22 and Emacs 23
73 If you want to install @code{debbugs} on Emacs 22/23, you will need to
74 install @code{soap-client} library first. It can be downloaded from
75 @uref{http://code.google.com/p/emacs-soap-client/, Emacs SOAP client
78 Compile the library and add it into your @code{load-path}:
81 (add-to-list 'load-path "/path/to/emacs-soap-client/")
84 @code{debbugs} library can be downloaded from
85 @uref{http://elpa.gnu.org/packages/, ELPA repository}. Compile it and
86 set the @code{load-path}:
89 (add-to-list 'load-path "/path/to/debbugs/")
92 @subheading Installation on Emacs 21
93 We have not tried yet to install @code{debbugs} on Emacs 21. We would
94 definitely say that the installation will require even more additional
95 libraries than needed for installation on Emacs 22/23.
98 @chapter Configuration
99 @code{debbugs} is already configured to work with two main ports of
100 Debbugs BTS: @uref{http://bugs.debian.org} and
101 @uref{http://debbugs.gnu.org}. So if you intend to use these ports, you
102 don't need to configure @code{debbugs}. If you want to interact with
103 Debbugs port other than those listed, you have to configure
104 @code{debbugs} by adding a new server specifier to
105 @code{debbugs-servers} variable. The actual port can be selected by
106 @code{debbugs-port} variable.
108 @defvar debbugs-servers
109 List of Debbugs server specifiers. Each entry is a list that contains a
110 string identifying the port name and the server parameters in
111 keyword-value form. The list initially contains two predefined and
112 configured Debbugs servers: @code{"gnu.org"} and @code{"debian.org"}.
118 Location of WSDL. The value is a string with URL that should return the
119 WSDL specification of Debbugs/SOAP service. This keyword is intended for
120 future use and currently is ignored.
122 URL of the server script (@code{bugreport.cgi} in default Debbugs
123 installation) that provides the access to mboxes with messages from bug
127 Example. Add new Debbugs port with name "foobars.net":
133 :wsdl "http://bugs.foobars.net/cgi/soap.cgi?WSDL"
134 :bugreport-url "http://bugs.foobars.net/cgi/bugreport.cgi"))
139 This variable holds the name of currently used port. Value of the
140 variable corresponds to the Debbugs server to be accessed, either
141 "gnu.org", or "debian.org", or user defined port name.
144 @node Requesting bug numbers
145 @chapter Requesting bug numbers
146 In Debbugs BTS, the bug number is the unique identifier of bug
147 report. The functions described in this section return from Debbugs
148 server the list of bug numbers that match user's query.
150 @defun debbugs-get-bugs &rest query
151 This function returns a list of bug numbers that match the
152 @var{query}. The @var{query} is a key-value pair sequence, where the key
153 is a keyword (symbol) and the value is a string. All queries are
154 logically concatenated via AND.
160 The value is the name of the package a bug belongs to, like @code{"emacs"},
161 @code{"coreutils"}, @code{"gnus"}, or @code{"tramp"}.
163 This is the severity of the bug. The exact set of available severities
164 depends on policy of particular Debbugs port:
167 @code{"critical"}, @code{"grave"}, @code{"serious"},
168 @code{"important"}, @code{"normal"}, @code{"minor"}, @code{"wishlist"},
172 @code{"important"}, @code{"grave"}, @code{"normal"}, @code{"minor"},
175 An arbitrary string the bug is annotated with. Usually, this is used to
176 mark the status of the bug. The list of possible tags depends on Debbugs
180 @code{"patch"}, @code{"wontfix"}, @code{"moreinfo"},
181 @code{"unreproducible"}, @code{"fixed"}, @code{"potato"},
182 @code{"woody"}, @code{"sid"}, @code{"help"}, @code{"security"},
183 @code{"upstream"}, @code{"pending"}, @code{"sarge"},
184 @code{"sarge-ignore"}, @code{"experimental"}, @code{"d-i"},
185 @code{"confirmed"}, @code{"ipv6"}, @code{"lfs"},
186 @code{"fixed-in-experimental"}, @code{"fixed-upstream"}, @code{"l10n"},
187 @code{"etch"}, @code{"etch-ignore"}, @code{"lenny"},
188 @code{"lenny-ignore"}.
191 @code{"fixed"}, @code{"notabug"}, @code{"wontfix"},
192 @code{"unreproducible"}, @code{"moreinfo"}, @code{"patch"}.
194 This is used to identify bugs by the owner's email address. The special
195 email address @code{"me"} is used as pattern, replaced with variable
196 @code{user-mail-address} (@pxref{(elisp)User Identification})
198 With this keyword it is possible to filter bugs by the submitter's email
199 address. The special email address @code{"me"} is used as pattern,
200 replaced with variable @code{user-mail-address}.
202 A keyword to filter for bugs which are already archived, or not. Valid
203 values are @code{"0"} (not archived), @code{"1"} (archived) or
204 @code{"both"}. If this keyword is not given in the query, @code{:archive
205 "0"} is assumed by default.
208 Example. Get all bug reports that were initiated by me.
211 (let ((debbugs-port "gnu.org"))
212 (debbugs-get-bugs :submitter "me" :archive "both"))
213 @result{} (5516 5551 5645 7259)
217 @defun debbugs-newest-bugs amount
218 This function returns a list of bug numbers, according to @var{amount}
219 (a number) of latest bugs.
221 Example. Get the latest six bug report numbers from Debian BTS:
224 (let ((debbugs-port "debian.org"))
225 (debbugs-newest-bugs 6))
226 @result{} (633152 633153 633154 633155 633156 633157)
230 @node Requesting bugs statuses
231 @chapter Requesting bugs statuses
232 Bug status is a collection of fields that holds the information about
233 the state and importance of the bug report, about originator, owner and
234 various aspects of relationship with other bug reports.
236 @defun debbugs-get-status &rest bug-numbers
237 Return a list of status entries for the bug reports identified by
238 @var{bug-numbers}. Every returned entry is an association list with the
239 following attributes:
245 A list of package names the bug belongs to.
247 The severity of the bug report. Possible values are the same as for
248 @code{:severity} in @code{debbugs-get-bugs} (@pxref{Requesting bug
251 The status of the bug report, a list of strings. Possible values are the
252 same as for @code{:tags} in @code{debbugs-get-bugs} (@pxref{Requesting
255 The string @code{"pending"}, @code{"forwarded"} or @code{"done"}.
257 Subject/Title of the bugreport.
259 The E-mail address of bug report submitter.
261 A list of bug numbers this bug was merged with.
263 Source package name of the bug report.
265 Date of bug creation. Encoded as UNIX time.
268 Date of last update. Encoded as UNIX time.
271 Date of bug report / bug fix (empty for now). Encoded as UNIX time.
273 The E-mail address of the worker who has closed the bug (if done).
275 @code{t} if the bug is archived, @code{nil} otherwise.
277 The date the bug has been unarchived, if ever. Encoded as UNIX time.
280 List of version strings.
282 A URL or an E-mail address.
284 A list of bug numbers this bug blocks.
286 A list of bug numbers this bug is blocked by.
288 The message id of the initial bug report.
290 Who is responsible for fixing.
292 Always the string @code{"db-h"} or @code{"archive"}.
294 A list of package names.
299 Example. Get status of bug number #10 from GNU BTS:
302 (let ((debbugs-port "gnu.org"))
303 (debbugs-get-status 10))
305 (((source . "unknown") (found_versions) (done) (blocks)
306 (date . 1203606305.0) (fixed) (fixed_versions) (mergedwith)
307 (found) (unarchived) (blockedby) (keywords) (summary)
308 (msgid . "<87zltuz7eh.fsf@@freemail.hu>") (id . 10)
309 (forwarded) (severity . "wishlist")
310 (owner . "Magnus Henoch <*****@@freemail.hu>")
311 (log_modified . 1310061242.0) (location . "db-h")
312 (subject . "url-gw should support HTTP CONNECT proxies")
313 (originator . "Magnus Henoch <*****@@freemail.hu>")
314 (last_modified . 1310061242.0) (pending . "pending") (affects)
315 (archived) (tags) (fixed_date) (package "emacs") (found_date)
320 @defun debbugs-get-attribute bug-or-message attribute
321 General accessor that returns the value of key
322 @var{attribute}. @var{bug-or-message} must be list element returned by
323 either @code{debbugs-get-status} or @code{debbugs-get-bug-log}.
325 Example. Return the originator of last submitted bug report:
328 (let ((debbags-port "gnu.org"))
329 (debbugs-get-attribute
330 (car (apply 'debbugs-get-status (debbugs-newest-bugs 1)))
332 @result{} "Jack Daniels <jack@@daniels.com>"
336 @node Requesting messages
337 @chapter Requesting messages
339 @defun debbugs-get-bug-log bug-number
340 Returns a list of messages related to @var{bug-number}. Every message is
341 an association list with the following attributes:
345 The number of the message inside the bug log. The numbers are ascending,
346 newer messages have a higher number.
348 The header lines from the E-mail messages, as arrived at the bug
353 A list of possible attachments, or @code{nil}. Not implemented yet server
358 @defun debbugs-get-message-numbers messages
359 Returns the message numbers of @var{messages}. @var{messages} must be
360 the result of a @code{debbugs-get-bug-log} call.
362 Example. Get message numbers from bug report #456789 log from Debian
366 (let ((debbugs-port "debian.org"))
367 (debbugs-get-message-numbers (debbugs-get-bug-log 456789)))
372 @defun debbugs-get-message messages message-number
373 Returns the message @var{message-number} of
374 @var{messages}. @var{messages} must be the result of a
375 @code{debbugs-get-bug-log} call. The returned message is a list of
376 strings. The first element are the header lines of the message, the
377 second element is the body of the message. Further elements of the list,
378 if any, are attachments of the message. If there is no message with
379 @var{message-number}, the function returns @code{nil}.
381 Example: Return the first message of last submitted bug report to Debian
385 (let* ((debbugs-port "gnu.org")
386 (messages (apply 'debbugs-get-bug-log
387 (debbugs-newest-bugs 1))))
390 (car (debbugs-get-message-numbers messages))))
394 @defun debbugs-get-mbox bug-number mbox-type &optional filename
395 Download mbox with all messages from bug report
396 @var{bug-number}. @var{mbox-type} specifies a type of mbox and can be
397 one of the following symbols:
401 Download mbox folder, i. e. mbox with messages as they arrived at
404 Download maintainer's mbox, i. e. mbox with messages as they are
405 resended from Debbugs server.
408 Download status mbox. The use of either symbol depends on actual Debbugs
409 server configuration. For gnu.org, use the former; for debian.org - the
413 @var{filename}, if non-@code{nil}, is the name of file to store mbox. If
414 @var{filename} is @code{nil}, the downloaded mbox is inserted into the
417 Note that mbox downloading will work only if the @code{:bugreport-url}
418 field of @code{debbugs-servers} variable is specified
419 (@pxref{Configuration}).