Merge lp:~sil2100/merge-o-matic/exclude-pkgs-from-stats into lp:merge-o-matic

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 301
Proposed branch: lp:~sil2100/merge-o-matic/exclude-pkgs-from-stats
Merge into: lp:merge-o-matic
Diff against target: 162 lines (+98/-1)
3 files modified
cron.daily (+1/-1)
data/foundations.exclude (+65/-0)
stats.py (+32/-0)
To merge this branch: bzr merge lp:~sil2100/merge-o-matic/exclude-pkgs-from-stats
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Brian Murray Approve
Review via email: mp+335387@code.launchpad.net

Commit message

Experimental try on adding a 'soft blacklist' for excluding certain packages only from m-o-m statistics.

Description of the change

Experimental try on adding a 'soft blacklist' for excluding certain packages only from m-o-m statistics.

This is useful since when generating statistics for some teams, some packages might not be relevant for merging. In the Foundations team we would like to omit those in the statistics which we use for graphing our KPIs.

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Two things:

1) I download the exclude list in cron.daily as I saw this is what's done for the blacklist. Makes more sense than having it local-only or in the source tree.
2) I was considering adding a new, separate count of 'excluded' but I couldn't find any real use for something like that. There's always risk of one forgetting that some packages are excluded, yes, but the exclude file should anyway be always kept up-to-date.

Revision history for this message
Brian Murray (brian-murray) wrote :

> Two things:
>
> 1) I download the exclude list in cron.daily as I saw this is what's done for
> the blacklist. Makes more sense than having it local-only or in the source
> tree.
> 2) I was considering adding a new, separate count of 'excluded' but I couldn't
> find any real use for something like that. There's always risk of one
> forgetting that some packages are excluded, yes, but the exclude file should
> anyway be always kept up-to-date.

I think the excluded count would be easy to add and doesn't cost anything, additionally it'd be useful to have this count for grafana because if it is grows a bunch something could be wrong.

Revision history for this message
Brian Murray (brian-murray) wrote :

One in-line comment.

303. By Łukasz Zemczak

Remove unnecessary conditional for read_excluded_packages()

304. By Łukasz Zemczak

Add an 'excluded' statistic to keep track of the number of explicitly exluded packages from the stats.

Revision history for this message
Brian Murray (brian-murray) wrote :

Okay, this seems good to me.

review: Approve
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

I also prepared a list of d-i packages to exclude for foundations. I do not have access to snakefruit so I can't get it in place, but once I get someone who can validate the list and put it up, this branch here will be good for production.

You can see the list here:
http://people.canonical.com/~lzemczak/foundations.exclude-mom

305. By Łukasz Zemczak

Switch to shipping the exclude list in MoM bzr, add initial version of the foundations blacklist.

306. By Łukasz Zemczak

I guess it's better if we have a separate directory for 'static' files like the exclude list.

Revision history for this message
Brian Murray (brian-murray) wrote :

Waiting for slangasek's approval of the exclude list.

307. By Łukasz Zemczak

Slightly trim down the exclude list.

Revision history for this message
Steve Langasek (vorlon) wrote :

I have discussed the particulars of this blacklist with Łukasz, and this has my +1. We may want to extend the list further later as a result of manual analysis, but this is a correct starting point with no false-positives.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cron.daily'
2--- cron.daily 2017-10-16 14:37:36 +0000
3+++ cron.daily 2018-01-11 20:01:03 +0000
4@@ -83,7 +83,7 @@
5 # Produce pretty reports
6 ./stats.py $QUIET
7 ./stats.py $QUIET -t ubuntu-server
8-./stats.py $QUIET -t foundations-bugs
9+./stats.py $QUIET -t foundations-bugs -E data/foundations.exclude
10 ./stats.py $QUIET -t ubuntu-openstack
11 ./stats-graphs.py $QUIET
12 ./merge-status.py $QUIET
13
14=== added directory 'data'
15=== added file 'data/foundations.exclude'
16--- data/foundations.exclude 1970-01-01 00:00:00 +0000
17+++ data/foundations.exclude 2018-01-11 20:01:03 +0000
18@@ -0,0 +1,65 @@
19+anna
20+apt-setup
21+base-installer
22+bterm-unifont
23+cdebconf-entropy
24+cdebconf-keystep
25+cdebconf-terminal
26+cdrom-checker
27+cdrom-detect
28+cdrom-retriever
29+choose-mirror
30+clock-setup
31+debian-installer
32+debian-installer-utils
33+efi-reader
34+elilo-installer
35+finish-install
36+grub-installer
37+installation-locale
38+iso-scan
39+lilo-installer
40+live-installer
41+lvmcfg
42+main-menu
43+media-retriever
44+migration-assistant
45+mountmedia
46+netcfg
47+net-retriever
48+network-console
49+nobootloader
50+oldsys-preseed
51+partconf
52+partman-auto
53+partman-auto-crypto
54+partman-auto-loop
55+partman-auto-lvm
56+partman-auto-raid
57+partman-base
58+partman-basicfilesystems
59+partman-basicmethods
60+partman-btrfs
61+partman-crypto
62+partman-efi
63+partman-ext3
64+partman-iscsi
65+partman-jfs
66+partman-lvm
67+partman-md
68+partman-multipath
69+partman-nbd
70+partman-partitioning
71+partman-swapfile
72+partman-target
73+partman-uboot
74+partman-xfs
75+pkgsel
76+preseed
77+rescue
78+rootskel
79+rootskel-gtk
80+system-integrity-check
81+tzsetup
82+udpkg
83+usb-discover
84\ No newline at end of file
85
86=== modified file 'stats.py'
87--- stats.py 2017-07-06 19:11:04 +0000
88+++ stats.py 2018-01-11 20:01:03 +0000
89@@ -20,6 +20,7 @@
90 from __future__ import print_function, with_statement
91
92 import logging
93+import os
94 import time
95
96 from deb.version import Version
97@@ -39,6 +40,27 @@
98 )
99
100
101+def read_excluded_packages(path):
102+ if not os.path.isfile(path):
103+ return set()
104+
105+ exclude = set()
106+ with open(path) as excludelist:
107+ for line in excludelist:
108+ try:
109+ line = line[:line.index("#")]
110+ except ValueError:
111+ pass
112+
113+ line = line.strip()
114+ if not line:
115+ continue
116+
117+ exclude.add(line)
118+
119+ return exclude
120+
121+
122 def options(parser):
123 parser.add_option("-D", "--source-distro", type="string", metavar="DISTRO",
124 default=SRC_DISTRO,
125@@ -62,6 +84,9 @@
126 help="Process only these destination components")
127 parser.add_option("-t", "--team", type="string", metavar="TEAM",
128 help="Process only packages owned by this team")
129+ parser.add_option("-E", "--exclude-packages", type="string", metavar="FILE",
130+ help="Exclude packages listed in the following file")
131+
132
133 def main(options, args):
134 src_distro = options.source_distro
135@@ -72,6 +97,7 @@
136
137 team = options.team
138 team_package_list = get_team_packages(team)
139+ exclude_packages = read_excluded_packages(options.exclude_packages)
140 blacklist = read_blacklist()
141
142 # For each package in the destination distribution, locate the latest in
143@@ -85,6 +111,7 @@
144 stats["needs-merge"] = 0
145 stats["repackaged"] = 0
146 stats["modified"] = 0
147+ stats["excluded"] = 0
148
149 if options.component is not None \
150 and our_component not in options.component:
151@@ -102,6 +129,11 @@
152 our_version = Version(our_source["Version"])
153 logging.debug("%s: %s is %s", package, our_distro, our_version)
154
155+ if package in exclude_packages:
156+ logging.debug("%s: excluded from statistics")
157+ stats["excluded"] += 1
158+ continue
159+
160 stats["total"] += 1
161
162 if package in blacklist:

Subscribers

People subscribed via source and target branches

to status/vote changes: