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