]> code.delx.au - gnu-emacs-elpa/blob - packages/debbugs/debbugs.texi
Add implemented SOAP function "search_est".
[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 @titlepage
32 @title Debbugs Programmer's Manual
33 @author by Evgeny M. Zubok
34 @page
35 @insertcopying
36 @end titlepage
37
38 @contents
39
40 @node Top
41 @top Debbugs Programmer's Manual
42
43 Debbugs is a bugtracking system (BTS) that was initially written for
44 the Debian project but actually used also by the GNU project. The
45 main distinctive feature of Debbugs is that it's mostly email-based.
46 All actions on bug reports: opening, closing, changing the status,
47 commenting, forwarding are performed via email by sending specially
48 composed letters to the particular mail addresses. However, searching
49 the bug reports, querying bug report status and viewing comments have
50 been web-based for a long time. To overcome this inconvenience the
51 Debbugs/SOAP service was introduced.
52
53 The Debbugs/SOAP service provides the means for developers to write
54 client applications that can send the queries with certain search
55 criteria to the Debbugs server and retrieve a set of bug reports that
56 match them. The developer may also ask the Debbugs server for
57 additional information about every bug report (e.g. subject, date,
58 originator, tags and etc.) and get all comments and attachments.
59
60 @code{debbugs}, described in this document, is the Emacs library that
61 exposes to developers the available functions provided by the Debbugs
62 server. @code{debbugs} uses Emacs' SOAP client library for
63 communication with the Debbugs server. In tandem with Emacs' email
64 facilities, @code{debbugs} provides a solution for building
65 applications that interact with the Debbugs BTS directly from Emacs
66 without addressing Debbugs' web interface.
67
68 @menu
69 * Installation:: Getting and installing @code{debbugs}.
70 * Configuration:: Configuring @code{debbugs}.
71 * Requesting bug numbers:: How to request bug report numbers.
72 * Requesting bugs statuses:: How to request the status of bug reports.
73 * Requesting messages:: How to get messages from bug reports.
74 @end menu
75
76 @node Installation
77 @chapter Installation
78
79 @subheading Installation on Emacs 24 or later
80
81 Install @code{debbugs} from the @ref{Packaging, ELPA repository, , elisp}.
82
83 @subheading Installation on Emacs 22 and Emacs 23
84
85 If you want to install @code{debbugs} on Emacs 22/23, you will need to
86 install the @code{soap-client} library first. It can be downloaded from
87 the @uref{http://code.google.com/p/emacs-soap-client/, Emacs SOAP client
88 project page}.
89
90 Compile the library and add it into your @code{load-path}:
91
92 @example
93 (add-to-list 'load-path "/path/to/emacs-soap-client/")
94 @end example
95
96 @code{debbugs} library can be downloaded from the
97 @uref{http://elpa.gnu.org/packages/, ELPA repository}. Compile it and
98 set the @code{load-path}:
99
100 @example
101 (add-to-list 'load-path "/path/to/debbugs/")
102 @end example
103
104 @subheading Installation on Emacs 21
105
106 We have not tried yet to install @code{debbugs} on Emacs 21. We would
107 definitely say that the installation will require even more additional
108 libraries than needed for installation on Emacs 22/23.
109
110 @node Configuration
111 @chapter Configuration
112
113 @code{debbugs} is already configured to work with two main ports of
114 Debbugs BTS: @uref{http://bugs.debian.org} and
115 @uref{http://debbugs.gnu.org}. So if you intend to use one of these
116 ports, you don't need to configure @code{debbugs}. If you want to
117 interact with a Debbugs port other than those listed, you have to
118 configure @code{debbugs} by adding a new server specifier to the
119 @code{debbugs-servers} variable. The actual port can be selected by
120 the @code{debbugs-port} variable.
121
122 @defvar debbugs-servers
123 List of Debbugs server specifiers. Each entry is a list that contains a
124 string identifying the port name and the server parameters in
125 keyword-value form. The list initially contains two predefined and
126 configured Debbugs servers: @code{"gnu.org"} and @code{"debian.org"}.
127
128 Valid keywords are:
129
130 @table @code
131 @item :wsdl
132 Location of WSDL. The value is a string with the URL that should
133 return the WSDL specification of the Debbugs/SOAP service. This
134 keyword is intended for future use, it is ignored currently.
135
136 @item :bugreport-url
137 The URL of the server script (@code{bugreport.cgi} in the default
138 Debbugs installation) that provides the access to mboxes with messages
139 from bug reports.
140 @end table
141
142 Example. Add a new Debbugs port with name "foobars.net":
143
144 @example
145 (add-to-list
146 'debbugs-servers
147 '("foobars.net"
148 :wsdl "http://bugs.foobars.net/cgi/soap.cgi?WSDL"
149 :bugreport-url "http://bugs.foobars.net/cgi/bugreport.cgi"))
150 @end example
151 @end defvar
152
153 @defvar debbugs-port
154 This variable holds the name of the currently used port. The value of
155 the variable corresponds to the Debbugs server to be accessed, either
156 @code{"gnu.org"} or @code{"debian.org"}, or a user defined port name.
157 @end defvar
158
159 @node Requesting bug numbers
160 @chapter Requesting bug numbers
161
162 In Debbugs BTS, the bug number is the unique identifier of a bug
163 report. The functions described in this section return from the
164 Debbugs server the list of bug numbers that match a user's query.
165
166 @defun debbugs-get-bugs &rest query
167 This function returns a list of bug numbers that match the
168 @var{query}. @var{query} is a sequence of keyword-value pairs where the
169 values are strings, i.e. :KEYWORD ``VALUE'' [:KEYWORD ``VALUE'']*
170
171 The keyword-value pair is a subquery. The keywords are allowed to
172 have multiple occurrence within the query at any place. The
173 subqueries with the same keyword form the logical subquery, which
174 returns the union of bugs of every subquery it contains.
175
176 The result of the @var{query} is an intersection of results of all
177 subqueries.
178
179 Valid keywords are:
180
181 @table @code
182 @item :package
183 The value is the name of the package a bug belongs to, like @code{"emacs"},
184 @code{"coreutils"}, @code{"gnus"}, or @code{"tramp"}.
185
186 @item :src
187 This is used to retrieve bugs that belong to source with given name.
188
189 @item :severity
190 This is the severity of the bug. The exact set of available severities
191 depends on the policy of a particular Debbugs port:
192
193 Debian port:
194 @code{"critical"}, @code{"grave"}, @code{"serious"},
195 @code{"important"}, @code{"normal"}, @code{"minor"}, @code{"wishlist"},
196 and @code{"fixed"}.
197
198 GNU port:
199 @code{"serious"}, @code{"important"}, @code{"normal"}, @code{"minor"},
200 @code{"wishlist"}.
201
202 @item :tag
203 An arbitrary string the bug is annotated with. Usually, this is used
204 to mark the status of the bug. The list of possible tags depends on
205 the Debbugs port.
206
207 Debian port: @code{"patch"}, @code{"wontfix"}, @code{"moreinfo"},
208 @code{"unreproducible"}, @code{"fixed"}, @code{"potato"},
209 @code{"woody"}, @code{"sid"}, @code{"help"}, @code{"security"},
210 @code{"upstream"}, @code{"pending"}, @code{"sarge"},
211 @code{"sarge-ignore"}, @code{"experimental"}, @code{"d-i"},
212 @code{"confirmed"}, @code{"ipv6"}, @code{"lfs"},
213 @code{"fixed-in-experimental"}, @code{"fixed-upstream"}, @code{"l10n"},
214 @code{"etch"}, @code{"etch-ignore"}, @code{"lenny"},
215 @code{"lenny-ignore"}, @code{"squeeze"}, @code{"squeeze-ignore"},
216 @code{"wheezy"}, @code{"wheezy-ignore"}. The actual list of tags can be
217 found on @uref{http://www.debian.org/Bugs/Developer#tags}.
218
219 GNU port: @code{"fixed"}, @code{"notabug"}, @code{"wontfix"},
220 @code{"unreproducible"}, @code{"moreinfo"}, @code{"patch"},
221 @code{"pending"}, @code{"help"}, @code{"security"}, @code{"confirmed"}.
222 See @url{http://debbugs.gnu.org/Developer.html#tags} for the actual list
223 of tags.
224
225 @item :owner
226 This is used to identify bugs by the owner's email address. The
227 special email address @code{"me"} is used as pattern, replaced with
228 the variable @code{user-mail-address} (@pxref{(elisp)User
229 Identification}).
230
231 @item :submitter
232 With this keyword it is possible to filter bugs by the submitter's
233 email address. The special email address @code{"me"} is used as
234 pattern, replaced with the variable @code{user-mail-address}.
235
236 @item :maint
237 This is used to find bugs of the packages which are maintained by the
238 person with the given email address. The special email address
239 @code{"me"} is used as pattern, replaced with @code{user-mail-address}.
240
241 @item :correspondent
242 This allows to find bug reports where the person with the given email
243 address has participated. The special email address @code{"me"} is used
244 as pattern, replaced with @code{user-mail-address}.
245
246 @item :affects
247 With this keyword it is possible to find bugs which affect the package
248 with the given name. The bugs are chosen by the value of field
249 @code{affects} in bug's status. The returned bugs do not necessary
250 belong to this package.
251
252 @item :status
253 Status of bug. Valid values are @code{"done"}, @code{"forwarded"} and
254 @code{"open"}.
255
256 @item :archive
257 A keyword to filter for bugs which are already archived, or not. Valid
258 values are @code{"0"} (not archived), @code{"1"} (archived) or
259 @code{"both"}. If this keyword is not given in the query,
260 @code{:archive "0"} is assumed by default.
261 @end table
262
263 Example. Get all opened and forwarded release critical bugs for the
264 packages which are maintained by @code{"me"} and which have a patch:
265
266 @example
267 (let ((debbugs-port "debian.org"))
268 (debbugs-get-bugs :maint "me" :tag "patch"
269 :severity "critical"
270 :status "open"
271 :severity "grave"
272 :status "forwarded"
273 :severity "serious"))
274 @end example
275 @end defun
276
277 @defun debbugs-newest-bugs amount
278 This function returns a list of bug numbers, according to @var{amount}
279 (a number) of latest bugs.
280
281 Example. Get the latest six bug report numbers from Debian BTS:
282
283 @example
284 (let ((debbugs-port "debian.org"))
285 (debbugs-newest-bugs 6))
286 @result{} (633152 633153 633154 633155 633156 633157)
287 @end example
288 @end defun
289
290 @node Requesting bugs statuses
291 @chapter Requesting bugs statuses
292
293 Bug status is a collection of fields that holds the information about
294 the state and importance of the bug report, about originator, owner and
295 various aspects of relationship with other bug reports.
296
297 @defun debbugs-get-status &rest bug-numbers
298 Return a list of status entries for the bug reports identified by
299 @var{bug-numbers}. Every returned entry is an association list with the
300 following attributes:
301
302 @table @code
303 @item id
304 @itemx bug_num
305 The bug number.
306
307 @item package
308 A list of package names the bug belongs to.
309
310 @item severity
311 The severity of the bug report. Possible values are the same as for
312 @code{:severity} in @code{debbugs-get-bugs} (@pxref{Requesting bug
313 numbers}).
314
315 @item tags
316 The status of the bug report, a list of strings. Possible values are the
317 same as for @code{:tags} in @code{debbugs-get-bugs} (@pxref{Requesting
318 bug numbers}).
319
320 @item pending
321 The string @code{"pending"}, @code{"forwarded"} or @code{"done"}.
322
323 @item subject
324 Subject/Title of the bugreport.
325
326 @item originator
327 The E-mail address of the bug report submitter.
328
329 @item mergedwith
330 A list of bug numbers this bug was merged with.
331
332 @item source
333 Source package name of the bug report.
334
335 @item date
336 Date of bug creation. Encoded as UNIX time.
337
338 @item log_modified
339 @itemx last_modified
340 Date of last update. Encoded as UNIX time.
341
342 @item found_date
343 @itemx fixed_date
344 Date of bug report / bug fix (empty for now). Encoded as UNIX time.
345
346 @item done
347 The E-mail address of the worker who has closed the bug (if done).
348
349 @item archived
350 @code{t} if the bug is archived, @code{nil} otherwise.
351
352 @item unarchived
353 The date the bug has been unarchived, if ever. Encoded as UNIX time.
354
355 @item found_versions
356 @itemx fixed_versions
357 List of version strings.
358
359 @item forwarded
360 A URL or an E-mail address.
361
362 @item blocks
363 A list of bug numbers this bug blocks.
364
365 @item blockedby
366 A list of bug numbers this bug is blocked by.
367
368 @item msgid
369 The message id of the initial bug report.
370
371 @item owner
372 Who is responsible for fixing.
373
374 @item location
375 Always the string @code{"db-h"} or @code{"archive"}.
376
377 @item affects
378 A list of package names.
379
380 @item summary
381 Arbitrary text.
382 @end table
383
384 Example. Get the status of bug number #10 from GNU BTS:
385
386 @example
387 (let ((debbugs-port "gnu.org"))
388 (debbugs-get-status 10))
389 @result{}
390 (((source . "unknown") (found_versions) (done) (blocks)
391 (date . 1203606305.0) (fixed) (fixed_versions) (mergedwith)
392 (found) (unarchived) (blockedby) (keywords) (summary)
393 (msgid . "<87zltuz7eh.fsf@@freemail.hu>") (id . 10)
394 (forwarded) (severity . "wishlist")
395 (owner . "Magnus Henoch <*****@@freemail.hu>")
396 (log_modified . 1310061242.0) (location . "db-h")
397 (subject . "url-gw should support HTTP CONNECT proxies")
398 (originator . "Magnus Henoch <*****@@freemail.hu>")
399 (last_modified . 1310061242.0) (pending . "pending") (affects)
400 (archived) (tags) (fixed_date) (package "emacs") (found_date)
401 (bug_num . 10)))
402 @end example
403 @end defun
404
405 @defun debbugs-get-attribute bug-or-message attribute
406 General accessor that returns the value of key @var{attribute}.
407 @var{bug-or-message} must be a list element returned by either
408 @code{debbugs-get-status} or @code{debbugs-get-bug-log}
409 (@pxref{Requesting messages}).
410
411 Example. Return the originator of the last submitted bug report:
412
413 @example
414 (let ((debbags-port "gnu.org"))
415 (debbugs-get-attribute
416 (car (apply 'debbugs-get-status (debbugs-newest-bugs 1)))
417 'originator))
418 @result{} "Jack Daniels <jack@@daniels.com>"
419 @end example
420 @end defun
421
422 @node Requesting messages
423 @chapter Requesting messages
424
425 @defun debbugs-get-bug-log bug-number
426 Returns a list of messages related to @var{bug-number}. Every message is
427 an association list with the following attributes:
428
429 @table @code
430 @item msg_num
431 The number of the message inside the bug log. The numbers are ascending,
432 newer messages have a higher number.
433 @item header
434 The header lines from the E-mail messages, as arrived at the bug
435 tracker.
436 @item body
437 The message body.
438 @item attachments
439 A list of possible attachments, or @code{nil}. Not implemented yet server
440 side.
441 @end table
442 @end defun
443
444 @defun debbugs-get-message-numbers messages
445 Returns the message numbers of @var{messages}. @var{messages} must be
446 the result of a @code{debbugs-get-bug-log} call.
447
448 Example. Get message numbers from bug report #456789 log from Debian
449 BTS:
450
451 @example
452 (let ((debbugs-port "debian.org"))
453 (debbugs-get-message-numbers (debbugs-get-bug-log 456789)))
454 @result{} (5 10 12)
455 @end example
456 @end defun
457
458 @defun debbugs-get-message messages message-number
459 Returns the message @var{message-number} of
460 @var{messages}. @var{messages} must be the result of a
461 @code{debbugs-get-bug-log} call. The returned message is a list of
462 strings. The first element are the header lines of the message, the
463 second element is the body of the message. Further elements of the list,
464 if any, are attachments of the message. If there is no message with
465 @var{message-number}, the function returns @code{nil}.
466
467 Example: Return the first message of the last submitted bug report to
468 GNU BTS:
469
470 @example
471 (let* ((debbugs-port "gnu.org")
472 (messages (apply 'debbugs-get-bug-log
473 (debbugs-newest-bugs 1))))
474 (debbugs-get-message
475 messages
476 (car (debbugs-get-message-numbers messages))))
477 @end example
478 @end defun
479
480 @defun debbugs-get-mbox bug-number mbox-type &optional filename
481 Download mbox with all messages from bug report
482 @var{bug-number}. @var{mbox-type} specifies a type of mbox and can be
483 one of the following symbols:
484
485 @table @code
486 @item mboxfolder
487 Download mbox folder, i.e. mbox with messages as they arrived at the
488 Debbugs server.
489
490 @item mboxmaint
491 Download maintainer's mbox, i.e. mbox with messages as they are resent
492 from the Debbugs server.
493
494 @item mboxstat
495 @itemx mboxstatus
496 Download status mbox. The use of either symbol depends on the actual
497 Debbugs server configuration. For @code{"gnu.org"}, use the former;
498 for @code{"debian.org} - the latter.
499 @end table
500
501 @var{filename}, if non-@code{nil}, is the name of the file to store
502 mbox. If @var{filename} is @code{nil}, the downloaded mbox is
503 inserted into the current buffer.
504
505 Note, that mbox downloading will work only if the
506 @code{:bugreport-url} field of the @code{debbugs-servers} variable is
507 specified (@pxref{Configuration}).
508 @end defun
509
510 @bye