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