]> git.donarmstrong.com Git - debbugs-presentations.git/blob - debbugs.Rnw
update the commands to run local-debbugs
[debbugs-presentations.git] / debbugs.Rnw
1
2 %\usepackage{libertine}
3 \usepackage{fontspec}
4 \setmainfont[Ligatures=TeX]{FreeSerif}
5 \setsansfont[Ligatures=TeX]{FreeSans}
6 \setmonofont{FreeMono}
7 \usepackage[Symbols]{ucharclasses}
8 \newfontfamily{\defaultfont}{FreeSerif}
9 %\newfontfamily{\symbolfont}{FreeSerif}
10 \newfontfamily{\sansfont}{FreeSans}
11 \setDefaultTransitions{\bgroup\defaultfont}{\egroup}
12 \usepackage{url}
13 \usepackage{fancyhdr}
14 \usepackage{graphicx}
15 \usepackage[bf]{caption}
16 \usepackage{rotating}
17 \usepackage{wrapfig}
18 \usepackage{fancybox}
19 \usepackage{booktabs}
20 \usepackage{minted}
21 \usepackage{tcolorbox}
22 \usepackage{etoolbox}
23 \BeforeBeginEnvironment{minted}{\begin{tcolorbox}}%
24 \AfterEndEnvironment{minted}{\end{tcolorbox}}%
25 % \usepackage{multirow}
26 \usepackage{acronym}
27 \usepackage{qrcode}
28 \usepackage[backend=biber,natbib=true,hyperref=true,style=nature]{biblatex}
29 \addbibresource{references.bib}
30 % \usepackage[nomargin,inline,draft]{fixme}
31 % \newcommand{\DLA}[1]{\textcolor{red}{\fxnote{DLA: #1}}}
32 % \usepackage[hyperfigures,bookmarks,colorlinks,citecolor=black,filecolor=black,linkcolor=black,urlcolor=black]{hyperref}
33 \usepackage{texshade}
34 \usepackage{tikz}
35 \usepackage{nameref}
36 \usepackage{zref-xr,zref-user}
37 \renewcommand*{\bibfont}{\tiny}
38 \usepackage[absolute,overlay]{textpos}
39
40 \mode<presentation>
41 {
42   \usetheme{Montpellier}
43   %\useoutertheme[hideallsubsections]{debiansidebar}
44 %  \setbeamercovered{transparent}  
45 }
46
47 \setbeamertemplate{navigation symbols}{}%remove navigation symbols
48
49 \usepackage[nomargin,inline,draft]{fixme}
50 \usepackage{listings}
51
52
53 \logo{\begin{tikzpicture}% Pale figure
54     {\node[opacity=0.3] {\includegraphics[width=2cm,keepaspectratio]{figures/openlogo-crop.pdf}};}%
55     \end{tikzpicture}}
56 \author{Don Armstrong}
57 \title{Debbugs}
58 \subtitle{22 Years of Bugs}
59 \date{August 10th, 2017}
60 \titlegraphic{\includegraphics[height=0.2\textheight,keepaspectratio]{figures/openlogo-crop.pdf}}
61 \subject{BTS}
62
63 \setbeamercolor{postit}{fg=black,bg=yellow}
64
65 % State of the BTS: new features, changes and tips
66
67 % The bug tracking system is where all bugs that affect Debian are
68 % filed. New features, including the affects, summary, and local debbugs
69 % mirror will be presented and demonstrated. Some of the underlying
70 % architectural changes to the codebase in debbugs to make it more
71 % maintainable and deployable are also outlined. Finally, a set of tips
72 % and tricks that can be used to make the BTS easier to use are
73 % presented.
74
75 %  - New Features
76 %    - affects
77 %    - summary
78 %    - local debbugs mirror for offline work
79 %    - New SOAP
80 %      - full text search
81 %      - filtering bugs
82 %    - multi-distribution/arch status
83 %    - control changes at submit@ time
84 %  - Code Architecture Changes
85 %    - Modularization
86 %    - Control abstraction
87 %    - release to experimental
88
89
90 <<load.libraries,echo=FALSE,results="hide",error=FALSE,message=FALSE,cache=FALSE>>=
91 library(lattice)
92 library(xtable)
93 library(ggplot2)
94 library("scales")
95 library(reshape2)
96 library("data.table")
97 opts_chunk$set(dev="cairo_pdf",out.width="\\textwidth",out.height="0.8\\textheight",out.extra="keepaspectratio",fig.width=6/1.2,fig.height=4/1.2)
98 opts_chunk$set(cache=TRUE, autodep=TRUE)
99 options(device = function(file, width = 6/1.2, height = 4/1.2, ...) {
100   cairo_pdf(tempfile(), width = width, height = height, ...)
101 })
102
103
104
105 <<scientific_format,echo=FALSE>>=
106 scientific_10 <- function(x) {
107   parse(text=gsub("e", " %*% 10^", scientific_format()(x)))
108 }
109
110
111 \begin{document}
112
113 %\setbeamercolor{frametitle}[bg=-red!90!green!10,fg=black]
114
115 \frame[plain]{\titlepage
116   Code and slides are here: 
117   \qrcode[padding]{https://dla2.us/p/debbugs2017}
118   \url{https://dla2.us/p/debbugs2017}
119
120 }
121
122 % \begin{frame}{Debbugs}
123 %   \tableofcontents[subsectionstyle=hide]
124 % \end{frame}
125
126 \section{Introduction to Debbugs}
127
128 \subsection{Introduction}
129 \begin{frame}{Goals of this talk}
130   \begin{columns}
131     \column{0.5\textwidth}
132     \begin{itemize}
133     \item Bug Statistics
134     \item New features
135     \item How you can help
136     \item Answer questions/discussion
137     \end{itemize}
138     \column{0.4\textwidth}
139     \includegraphics[width=\textwidth,keepaspectratio]{images/rc_buggy}
140   \end{columns}
141 \end{frame}
142 \begin{frame}{Goals of the BTS}
143   \begin{columns}
144   \column{0.4\textwidth}
145     \includegraphics[width=\textwidth,keepaspectratio]{images/not_a_bug}
146   \column{0.6\textwidth}
147   \begin{itemize}
148   \item Reporting of \only<1>{Features}\only<2>{Bugs}
149   \item Evolution of \only<1>{Features}\only<2>{Bugs}
150   \item Fixing of \only<1>{Features}\only<2>{Bugs}
151   \item Reducing impact of \only<1>{Features}\only<2>{Bugs}
152   \end{itemize}
153 \end{columns}
154 \end{frame}
155
156 \section{Bugs in Debian}
157 \subsection{Bug Reporting Rate}
158 \begin{frame}{Bugs from the beginning of time}
159   \begin{center}
160 <<bug.growth,fig=TRUE,echo=FALSE,cache.extra=file.info("data/sorted_bug_growth_for_r_every_500.txt")[,"mtime"]>>=
161 bug.growth <- fread("data/sorted_bug_growth_for_r_every_500.txt")
162 colnames(bug.growth) <- c("time","bugs")
163 bug.growth <- bug.growth[pmax(bugs) <= as.numeric(bugs),]
164 bug.growth <- bug.growth[order(time),]
165 while (bug.growth[,any(c(0,diff(bugs)) < 0)]) {
166        bug.growth <-
167            bug.growth[c(0,diff(bugs))>=0,]
168 }
169 bug.growth[,date:=
170                 as.POSIXct(ISOdatetime(1970,1,1,0,0,0)+
171                            as.numeric(bug.growth$time))]
172 bug.growth[,`bugs per day`:=c(0,diff(bugs)/
173                                 as.double(diff(date),"days"))
174            ]
175 print(ggplot(bug.growth,#[date > as.POSIXct(ISOdatetime(2005,1,1,0,0,0)),],
176              aes(x=date,y=bugs))+
177       xlab("Time")+ylab("Bugs filed in Debian")+
178       scale_y_continuous(labels = scientific_10)+
179       geom_point())
180
181 \end{center}
182 \end{frame}
183
184 \begin{frame}[fragile]{Bug Growth Rate}
185 <<bug_growth_rate,echo=FALSE>>=
186 print(ggplot(bug.growth[date > as.POSIXct(ISOdatetime(2014,1,1,0,0,0)),],
187              aes(x=date,y=`bugs per day`))+
188       xlab("Time")+ylab("Bugs filed per day")
189       + scale_y_log10(breaks=c(60,100,200,400,800))
190       + geom_line()+stat_smooth(method="lm")
191       + geom_label(data=data.table(date=as.POSIXct(ISOdatetime(2015,04,25,0,0,0)),"bugs per day"=400),label="Jessie",color="red")
192       + geom_label(data=data.table(date=as.POSIXct(ISOdatetime(2017,06,17,0,0,0)),"bugs per day"=400),label="Stretch",color="purple")
193       )
194
195 \end{frame}
196
197 \begin{frame}[fragile]{Is the bug filing rate decreasing?}
198 \tiny
199 <<bug_growth_rate_over_time>>=
200 summary(lm(log(`bugs per day`)~date,bug.growth[date > "2014-01-01 PST",]))
201
202 \normalsize
203 Not significantly decreasing.
204 \end{frame}
205
206 \begin{frame}{My entries into Christian's game}
207   \begin{columns}
208     \column{0.5\textwidth}
209   \begin{center}
210 <<bugs.filed,fig=TRUE,echo=FALSE,warning=FALSE,fig.width=3,fig.height=3>>=
211 print(ggplot(bug.growth[date > as.POSIXct(ISOdatetime(2015,1,1,0,0,0)),],
212              aes(x=date,y=bugs))+
213       xlab("Time")+ylab("Bugs filed in Debian")+
214       scale_y_continuous(labels = scientific_10)+
215       geom_point()+stat_smooth(method="lm"))
216 bugs.filed.per.day <-
217   lm(bugs~date,bug.growth)$coeff[2]*3600*24
218 temp.lm <- lm(date~bugs,bug.growth[date > as.POSIXct(ISOdatetime(2015,1,1,0,0,0)),])
219 bug.880000 <- 
220     as.POSIXct(ISOdatetime(1970,1,1,0,0,0)+as.numeric(predict(temp.lm,data.frame(bugs=880000,date=NA))))
221 bug.900000 <- 
222     as.POSIXct(ISOdatetime(1970,1,1,0,0,0)+as.numeric(predict(temp.lm,data.frame(bugs=900000,date=NA))))
223 bug.1000000 <- 
224     as.POSIXct(ISOdatetime(1970,1,1,0,0,0)+as.numeric(predict(temp.lm,data.frame(bugs=1000000,date=NA))))
225
226 \end{center}
227 \column{0.5\textwidth}
228 Roughly \Sexpr{format(bugs.filed.per.day,digits=1)} bugs are filed per
229 day. The 880000th bug will be filed at \Sexpr{bug.880000}, the
230 900000th bug will be filed at \Sexpr{bug.900000}, and bug one million will be filled 
231 \Sexpr{bug.1000000}.
232 \end{columns}
233 \end{frame}
234
235
236 \subsection{Bug Fixing Rate}
237 \begin{frame}
238   \begin{center}
239 <<bugs.closed,fig=TRUE,echo=FALSE,width=7,height=5,warning=FALSE,error=FALSE,cache.extra=file.info("data/bug_closed_time_series.txt")[,"mtime"]>>=
240 bug.closed.series <- fread(file="data/bug_closed_time_series.txt")
241 colnames(bug.closed.series) <- c("archived.bugs","year.week")
242 bug.closed.series[,week:=
243     gsub("(\\d+)-(\\d+)","\\2",year.week)]
244 bug.closed.series[,year:=
245     gsub("(\\d+)-(\\d+)","\\1",year.week)]
246 bug.closed.series[,doy:= as.numeric(week)*7]
247 bug.closed.series[,year.doy:=
248                        paste(sep="-",year,doy)]
249 bug.closed.series[,date:=
250                        as.POSIXct(strptime(year.doy,
251                                            format="%Y-%j"))]
252
253 # bug.closed.ts <- ts(bug.closed.series[,1],start=1,frequency=7)
254
255 print(ggplot(bug.closed.series[date > as.POSIXct(ISOdatetime(2008,1,1,0,0,0)),],
256              aes(x=date,y=archived.bugs/7))+geom_line()+stat_smooth(method="lm")+
257       ylab("Bugs archived Per Day")+xlab("Time"))
258 bugs.closed.per.day <-
259     bug.closed.series[,sum(archived.bugs)]/
260     as.numeric(bug.closed.series[nrow(bug.closed.series),date]-
261                bug.closed.series[1,date])
262
263   \end{center}
264 Roughly \Sexpr{format(bugs.closed.per.day,digits=1)} bugs are closed per day.
265 \end{frame}
266
267 \subsection{RC Bugs}
268 \begin{frame}{RC Bugs in the Past Year}
269   \begin{center}
270 <<rc.bugs,fig=TRUE,echo=FALSE,warning=FALSE,cache.extra=file.info("data/rc_bugs.txt")[,"mtime"]>>=
271 rc.bugs <-
272     data.table(read.table(file="data/rc_bugs.txt",
273                           header=TRUE,fill=TRUE))
274 rc.bugs[,date:=
275              as.POSIXct(strptime(date,
276                                  format="%Y%m%d%H%M"))]
277 rc.bugs[,unknown:=NULL]
278 rc.bugs[,unknown.1:=NULL]
279 for (i in 1:10) {
280     rc.bugs <- rc.bugs[c(0,diff(total)) > -1000,]
281 }
282 rc.bugs.long <-
283     data.table(melt(rc.bugs,id="date"))
284 print(ggplot(rc.bugs.long[date > 
285                           as.POSIXct(ISOdatetime(2016,08,1,0,0,0)),]
286             ,aes(x=date,y=value,color=variable))+
287       geom_line()+
288       ylab("# of Release Critical Bugs")+xlab("Time")+
289       theme(legend.position="top")+
290       scale_color_discrete("Measure"))
291
292 \end{center}
293 \end{frame}
294
295 \section{Debbugs Structure and Infrastructure}
296
297 \subsection{BTS System Diagram}
298 \begin{frame}{BTS system Diagram}
299   \begin{center}
300     \includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{figures/bug_global_layout}
301   \end{center}
302 \end{frame}
303
304 \subsection{Debbugs Box Diagram}
305 \begin{frame}{Debbugs Box Diagram}
306   \begin{center}
307     \input{debbugs_layout}
308   \end{center}
309 \end{frame}
310
311 \section{New Features}
312
313 \subsection{Database}
314
315 \subsubsection{Perl Database Infrastucture}
316 \begin{frame}{Perl Database Infrastructure}
317   \begin{itemize}
318   \item DBIx::Class
319   \item DBIx::Class::Schema::Loader -- SQL schema to DBIx::Class
320   \item DBIx::Class::DeploymentHandler -- Upgrades of Schema
321   \item Debbugs::DB -- Debbugs SQL Module
322   \end{itemize}
323 \end{frame}
324
325
326 \subsubsection{SQL Loading}
327 \begin{frame}[fragile]{SQL Loading}
328   % SQL loading
329   \begin{itemize}
330   \item Load bugs
331 \begin{minted}{sh}
332 debbugs-loadsql bugs;
333 debbugs-loadsql bugs archive;
334 \end{minted}
335   \item Load Versioning information
336 \begin{minted}{sh}
337 debbugs-loadsql versions;
338 debbugs-loadsql debinfo;
339 \end{minted}
340   \end{itemize}
341 \end{frame}
342
343 \subsubsection{Fun Queries}
344
345 \begin{frame}[fragile]{Messages to bugs}
346 \small
347 \begin{minted}{sql}
348 SELECT count(*),c.addr FROM 
349 message_correspondent mc 
350 JOIN correspondent c ON mc.correspondent=c.id 
351 WHERE correspondent_type='from' 
352 GROUP BY mc.correspondent,c.addr 
353 ORDER BY count DESC LIMIT 5;
354 \end{minted}
355 \begin{verbatim}
356  count |              addr
357 -------+---------------------------------
358   5123 | bubulle@debian.org
359   4346 | joeyh@debian.org
360   4214 | biebl@debian.org
361   3875 | tbm@cyrius.com
362   3632 | ftpmaster@ftp-master.debian.org
363 \end{verbatim}
364 \end{frame}
365
366 \begin{frame}[fragile]{Single-message correspondents}
367 \small
368 \begin{minted}{sql}
369 SELECT count (*) FROM 
370 (SELECT count(*),c.addr 
371  FROM message_correspondent mc 
372  JOIN correspondent c ON 
373  mc.correspondent=c.id 
374  WHERE correspondent_type='from' 
375  GROUP BY mc.correspondent,
376  c.addr 
377  HAVING count(*) = 1) AS foo;
378 \end{minted}
379 \begin{verbatim}
380  count
381 -------
382  30215
383 \end{verbatim}
384 \end{frame}
385
386
387
388 \begin{frame}[fragile]{More fun queries}
389 \begin{minted}{sql}
390 SELECT count(*),t.tag 
391 FROM bug b 
392 JOIN bug_tag bt ON b.id=bt.bug 
393 JOIN tag t on bt.tag=t.id 
394 GROUP by bt.tag,t.tag 
395 ORDER by count DESC LIMIT 5;
396 \end{minted}
397 \begin{verbatim}
398  count  |      tag
399 --------+----------------
400  141184 | patch
401   42288 | upstream
402   39466 | sid
403   33640 | l10n
404   25566 | fixed-upstream
405 \end{verbatim}
406 \end{frame}
407
408 \subsection{Database status caching}
409 \begin{frame}[fragile]{Status caching ``working''}
410 \begin{minted}{sql}
411 SELECT count(*),status 
412 FROM bug_status_cache bsc 
413 JOIN suite s ON bsc.suite=s.id 
414 WHERE s.suite_name='unstable' 
415 GROUP by status;
416 \end{minted}
417 \begin{verbatim}
418  count  | status
419 --------+--------
420  514488 | fixed
421  234155 | absent
422    3923 | found
423 \end{verbatim}
424 \end{frame}
425
426 \subsection{Work still needed for SQL}
427 \begin{frame}{Work Still needed for SQL}
428 \begin{itemize}
429 \item Integration into CGI (\texttt{bugreport.cgi} and
430   \texttt{pkgreport.cgi})
431 \item Database loading/update is slow in some cases
432 \item Some corrupted bugs have been exposed by the loading (#167851
433   and #280931); likely others
434 \item Testing (Mainly of queries)
435 \item Deployment
436 \end{itemize}
437 \end{frame}
438
439 \section{New(ish) Features}
440
441 \subsection{New Changes}
442 \begin{frame}{New Changes}
443   \begin{columns}
444     \column{0.5\textwidth}
445     \begin{itemize}
446   \item Format-flowed messages are wrapped
447   \item https links everywhere
448   \item etag caching support everywhere
449   \item a11y (accessibility, ♿) tag
450   \item newcomer (⎈) tag
451   \item Usercategories now selectable (Categorize/order using)
452   \end{itemize}
453     \column{0.5\textwidth}
454     \includegraphics[width=\textwidth,keepaspectratio]{images/telegraph_bug}
455 \end{columns}
456 \end{frame}
457
458 \section{Contributing to Debbugs}
459
460 \begin{frame}{7 tasks seeking contributors}
461   \begin{itemize}
462   \item Documentation of Usercategories
463   \item Implementation of rss feeds for packages and bugs
464   \item CGI options on pkgreport.cgi for usertags et al. \#536378)
465   \item Documentation of multiple-package reassign and when it or
466     affects should be used
467   \item Documentation for local-debbugs configuration file (behaves
468     like bts select)
469   \end{itemize}
470 \end{frame}
471
472 \begin{frame}{Getting started on these tasks}
473   \begin{itemize}
474   \item Upstream branches: \url{https://bugs.debian.org/debbugs-source/}
475     \begin{itemize}
476     \item master (upstream debbugs): git clone \url{https://bugs.debian.org/debbugs-source/debbugs.git}
477     \item debian (debian branch): git clone -b debian \url{https://bugs.debian.org/debbugs-source/debbugs.git}
478     \item Checked out branches are also available at
479       \url{https://bugs.debian.org/debbugs-source/master} and
480       \url{https://bugs.debian.org/debbugs-source/debian}
481     \end{itemize}
482   \item My branches: \url{https://git.donarmstrong.com/debbugs.git}
483   \item Mailing list debian-debbugs@lists.debian.org
484   \item IRC \#debbugs or \#debian-bugs on irc.debian.org; I'm dondelelcaro
485   \end{itemize}
486 \end{frame}
487
488 \begin{frame}[fragile]{Using \texttt{local-debbugs} to work on these tasks}
489 \footnotesize
490 \begin{minted}{sh}
491 git clone \
492  https://bugs.debian.org/debbugs-source/debbugs.git
493 cd debbugs
494 # get some bugs
495 ./bin/local-debbugs --mirror
496 # start a web daemon
497 ./bin/local-debbugs --daemon
498 # show some of my bugs (use your own search here)
499 ./bin/local-debbugs --search bugs.debian.org
500 # stop the daemon
501 ./bin/local-debbugs --stop
502 # hack and repeat
503 ./bin/local-debbugs --daemon
504 ./bin/local-debbugs --show 614351
505 \end{minted}
506 \end{frame}
507
508 \begin{frame}{The Debbugs Team}
509   \begin{itemize}
510   \item Current team
511     \begin{itemize}
512     \item Don Armstrong
513     \item Blars Blarson
514     \item Colin Watson
515     \end{itemize}
516   \item Emeritus Developers
517     \begin{itemize}
518     \item Steiner Gunderson
519     \item Adam Heath
520     \item Josip Rodin
521     \item Anthony Towns
522     \end{itemize}
523   \item You!
524   \end{itemize}
525 \end{frame}
526
527 \begin{frame}{Questions?}
528 \begin{center}
529 \includegraphics[height=0.8\textheight,keepaspectratio]{images/relevant_xkcd}
530 \end{center}
531 \end{frame}
532
533 \end{document}
534
535