]> code.delx.au - gnu-emacs-elpa/blob - packages/debbugs/debbugs.texi
Allow sending bug control messages from random modes.
[gnu-emacs-elpa] / packages / debbugs / debbugs.texi
1 \input texinfo
2 @setfilename debbugs.info
3 @settitle Debbugs programmer's manual
4
5 @dircategory Emacs
6 @direntry
7 * Debbugs: (debbugs). A library for communication with Debbugs.
8 @end direntry
9
10 @copying
11 Copyright @copyright{} 2011 Free Software Foundation, Inc.
12
13 @quotation
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.
20
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.
25
26 All Emacs Lisp code contained in this document may be used, distributed,
27 and modified without restriction.
28 @end quotation
29 @end copying
30
31 @node Top
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.
42
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.
49
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.
57
58 @menu
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.
64 @end menu
65
66 @node Installation
67 @chapter Installation
68
69 @subheading Installation on Emacs 24 or later
70 Install @code{debbugs} from ELPA repository.
71
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
76 project page}.
77
78 Compile the library and add it into your @code{load-path}:
79
80 @example
81 (add-to-list 'load-path "/path/to/emacs-soap-client/")
82 @end example
83
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}:
87
88 @example
89 (add-to-list 'load-path "/path/to/debbugs/")
90 @end example
91
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.
96
97 @node Configuration
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.
107
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"}.
113
114 Valid keywords are:
115
116 @table @code
117 @item :wsdl
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.
121 @item :bugreport-url
122 URL of the server script (@code{bugreport.cgi} in default Debbugs
123 installation) that provides the access to mboxes with messages from bug
124 reports.
125 @end table
126
127 Example. Add new Debbugs port with name "foobars.net":
128
129 @example
130 (add-to-list
131 'debbugs-servers
132 '("foobars.net"
133 :wsdl "http://bugs.foobars.net/cgi/soap.cgi?WSDL"
134 :bugreport-url "http://bugs.foobars.net/cgi/bugreport.cgi"))
135 @end example
136 @end defvar
137
138 @defvar debbugs-port
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.
142 @end defvar
143
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.
149
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.
155
156 Valid keywords are:
157
158 @table @code
159 @item :package
160 The value is the name of the package a bug belongs to, like @code{"emacs"},
161 @code{"coreutils"}, @code{"gnus"}, or @code{"tramp"}.
162 @item :severity
163 This is the severity of the bug. The exact set of available severities
164 depends on policy of particular Debbugs port:
165
166 Debian port:
167 @code{"critical"}, @code{"grave"}, @code{"serious"},
168 @code{"important"}, @code{"normal"}, @code{"minor"}, @code{"wishlist"},
169 and @code{"fixed"}.
170
171 GNU port:
172 @code{"important"}, @code{"grave"}, @code{"normal"}, @code{"minor"},
173 @code{"wishlist"}.
174 @item :tag
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
177 port.
178
179 Debian port:
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"}.
189
190 GNU port:
191 @code{"fixed"}, @code{"notabug"}, @code{"wontfix"},
192 @code{"unreproducible"}, @code{"moreinfo"}, @code{"patch"}.
193 @item :owner
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})
197 @item :submitter
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}.
201 @item :archive
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.
206 @end table
207
208 Example. Get all bug reports that were initiated by me.
209
210 @example
211 (let ((debbugs-port "gnu.org"))
212 (debbugs-get-bugs :submitter "me" :archive "both"))
213 @result{} (5516 5551 5645 7259)
214 @end example
215 @end defun
216
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.
220
221 Example. Get the latest six bug report numbers from Debian BTS:
222
223 @example
224 (let ((debbugs-port "debian.org"))
225 (debbugs-newest-bugs 6))
226 @result{} (633152 633153 633154 633155 633156 633157)
227 @end example
228 @end defun
229
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.
235
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:
240
241 @table @code
242 @item bug_num
243 The bug number.
244 @item package
245 A list of package names the bug belongs to.
246 @item severity
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
249 numbers}).
250 @item tags
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
253 bug numbers}).
254 @item pending
255 The string @code{"pending"}, @code{"forwarded"} or @code{"done"}.
256 @item subject
257 Subject/Title of the bugreport.
258 @item originator
259 The E-mail address of bug report submitter.
260 @item mergedwith
261 A list of bug numbers this bug was merged with.
262 @item source
263 Source package name of the bug report.
264 @item date
265 Date of bug creation. Encoded as UNIX time.
266 @item log_modified
267 @item last_modified
268 Date of last update. Encoded as UNIX time.
269 @item found_date
270 @item fixed_date
271 Date of bug report / bug fix (empty for now). Encoded as UNIX time.
272 @item done
273 The E-mail address of the worker who has closed the bug (if done).
274 @item archived
275 @code{t} if the bug is archived, @code{nil} otherwise.
276 @item unarchived
277 The date the bug has been unarchived, if ever. Encoded as UNIX time.
278 @item found_versions
279 @item fixed_versions
280 List of version strings.
281 @item forwarded
282 A URL or an E-mail address.
283 @item blocks
284 A list of bug numbers this bug blocks.
285 @item blockedby
286 A list of bug numbers this bug is blocked by.
287 @item msgid
288 The message id of the initial bug report.
289 @item owner
290 Who is responsible for fixing.
291 @item location
292 Always the string @code{"db-h"} or @code{"archive"}.
293 @item affects
294 A list of package names.
295 @item summary
296 Arbitrary text.
297 @end table
298
299 Example. Get status of bug number #10 from GNU BTS:
300
301 @example
302 (let ((debbugs-port "gnu.org"))
303 (debbugs-get-status 10))
304 @result{}
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)
316 (bug_num . 10)))
317 @end example
318 @end defun
319
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}.
324
325 Example. Return the originator of last submitted bug report:
326
327 @example
328 (let ((debbags-port "gnu.org"))
329 (debbugs-get-attribute
330 (car (apply 'debbugs-get-status (debbugs-newest-bugs 1)))
331 'originator))
332 @result{} "Jack Daniels <jack@@daniels.com>"
333 @end example
334 @end defun
335
336 @node Requesting messages
337 @chapter Requesting messages
338
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:
342
343 @table @code
344 @item msg_num
345 The number of the message inside the bug log. The numbers are ascending,
346 newer messages have a higher number.
347 @item header
348 The header lines from the E-mail messages, as arrived at the bug
349 tracker.
350 @item body
351 The message body.
352 @item attachments
353 A list of possible attachments, or @code{nil}. Not implemented yet server
354 side.
355 @end table
356 @end defun
357
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.
361
362 Example. Get message numbers from bug report #456789 log from Debian
363 BTS:
364
365 @example
366 (let ((debbugs-port "debian.org"))
367 (debbugs-get-message-numbers (debbugs-get-bug-log 456789)))
368 @result{} (5 10 12)
369 @end example
370 @end defun
371
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}.
380
381 Example: Return the first message of last submitted bug report to Debian
382 BTS:
383
384 @example
385 (let* ((debbugs-port "gnu.org")
386 (messages (apply 'debbugs-get-bug-log
387 (debbugs-newest-bugs 1))))
388 (debbugs-get-message
389 messages
390 (car (debbugs-get-message-numbers messages))))
391 @end example
392 @end defun
393
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:
398
399 @table @code
400 @item mboxfolder
401 Download mbox folder, i. e. mbox with messages as they arrived at
402 Debbugs server.
403 @item mboxmaint
404 Download maintainer's mbox, i. e. mbox with messages as they are
405 resended from Debbugs server.
406 @item mboxstat
407 @item mboxstatus
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
410 latter.
411 @end table
412
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
415 current buffer.
416
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}).
420 @end defun
421
422 @bye