Merge lp:~brian-murray/ubuntu-archive-tools/override-rate into lp:ubuntu-archive-tools

Proposed by Brian Murray
Status: Merged
Merged at revision: 767
Proposed branch: lp:~brian-murray/ubuntu-archive-tools/override-rate
Merge into: lp:ubuntu-archive-tools
Diff against target: 112 lines (+36/-12)
1 file modified
phased-updater (+36/-12)
To merge this branch: bzr merge lp:~brian-murray/ubuntu-archive-tools/override-rate
Reviewer Review Type Date Requested Status
Colin Watson Needs Fixing
Review via email: mp+179232@code.launchpad.net

Description of the change

There was no support in the phased-updater for overriding an increased rate of crashes about a package, this adds that. Additionally, the phased-updater does not look to see what the highest phased-update-percentage was set to so we could have a case where a phased update was set to 80%, stopped and then restarted at 10% which doesn't make a whole lot of sense. This fixes that by looking at the binary package publishing history to see what the maximum phased-update-percentage was.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

18:10 <cjwatson> what happens if the package isn't built on i386 at all?
18:11 <cjwatson> maybe my proof of concept was a bit naive - you could search without distro_arch_series= and then go through the results looking for things where .distro_arch_series.distro_series (or however it's spelled) is release
18:11 <cjwatson> I'm also concerned that this appears to go through the entire history
18:12 <cjwatson> you should get it back in ordered form, so I think you would be better off stopping at the most recent publication that matches your criteria
18:12 <cjwatson> (i.e. you should get it most recent first IIRC)
18:13 <bdmurray> right and most recent is zero, so just use [1]?
18:15 <cjwatson> I'd use a for loop and break once you've found a publication you like

review: Needs Fixing
768. By Brian Murray

updated based on reviewer feedback

769. By Brian Murray

be more verbose about why an email address was looked up and skipped

770. By Brian Murray

always set the rate_increase to false so that phasing is not stopped because of it

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phased-updater'
2--- phased-updater 2013-08-07 16:26:41 +0000
3+++ phased-updater 2013-08-19 19:39:52 +0000
4@@ -240,10 +240,12 @@
5 signer)
6 continue
7 signer_email = get_primary_email(signer)
8- if not signer_email:
9- continue
10 pkg = spph.source_package_name
11 version = spph.source_package_version
12+ if not signer_email:
13+ logging.info('no signer email address for %s %s %s' %
14+ (rname, pkg, version))
15+ continue
16 signer_name = signer.name
17 changer = spph.package_creator
18 if 'buckets' in spph_buckets[rname][spph]:
19@@ -403,22 +405,25 @@
20 # the fraction of hours that have passed so far in the day)
21 current_amount = data['this_count']
22 increase = current_amount - previous_amount
23+ logging.info('[%s/%s] increase: %s, previous_avg: %s' %
24+ (release_version, src_pkg, increase,
25+ previous_amount))
26 # 2013-06-20 - Fix errors api to add this
27 link = data['web_link'] + '&version=%s' % version
28+ logging.info('Details: %s' % link)
29 return(increase, link)
30
31
32 def main():
33 # TODO: make email code less redundant
34- # TODO: Determine how to override an increased rate
35 # TODO: modify HTTP_USER_AGENT (both versions of urllib)
36 # TODO: Open bugs for regressions when false positives reduced
37- # TODO: determine if starting p-u-p over from 0% is an issue
38 ubuntu = launchpad.distributions['ubuntu']
39 archive = ubuntu.getArchive(name='primary')
40 options.archive = archive
41
42 overrides = defaultdict(list)
43+ rate_overrides = []
44 override_file = csv.reader(open(OVERRIDES, 'r'))
45 for row in override_file:
46 # package, version, problem
47@@ -427,7 +432,10 @@
48 package = row[0].strip()
49 version = row[1].strip()
50 problem = row[2].strip()
51- overrides[(package, version)].append(problem)
52+ if problem == 'increased-rate':
53+ rate_overrides.append((package, version))
54+ else:
55+ overrides[(package, version)].append(problem)
56
57 releases = []
58 for series in ubuntu.series:
59@@ -467,30 +475,46 @@
60 issues[rname][pub_source] = {}
61 issues[rname][pub_source]['buckets'] = problems
62 rate_increase = crash_rate_increase(rvers, src_pkg, version)
63+ # Unset the rate_increase until it is more useful
64 if rate_increase:
65+ logging.info('Disregarding rate increase for: %s' % src_pkg)
66+ rate_increase = False
67+ if rate_increase and (src_pkg, version) not in rate_overrides:
68 if pub_source not in issues[rname]:
69 issues[rname][pub_source] = {}
70 issues[rname][pub_source]['rate'] = rate_increase
71- pups = [pb.phased_update_percentage
72- for pb in pub_source.getPublishedBinaries()
73- if pb.phased_update_percentage]
74- if pups:
75+ pbs = [pb for pb in pub_source.getPublishedBinaries()
76+ if pb.phased_update_percentage is not None]
77+ if pbs:
78+ # the p-u-p is currently the same for all binary packages
79+ last_pup = pbs[0].phased_update_percentage
80 if pub_source not in issues[rname]:
81 issues[rname][pub_source] = {}
82- issues[rname][pub_source]['pup'] = pups[0]
83+ # phasing has stopped so check what the max value was
84+ if last_pup == 0:
85+ for allpb in archive.getPublishedBinaries(
86+ exact_match=True, pocket='Updates',
87+ binary_name=pbs[0].binary_package_name):
88+ if allpb.distro_arch_series.distroseries == release:
89+ if allpb.phased_update_percentage > 0:
90+ max_pup = allpb.phased_update_percentage
91+ break
92+ issues[rname][pub_source]['pup'] = max_pup
93+ else:
94+ issues[rname][pub_source]['pup'] = last_pup
95 suite = rname + '-updates'
96 if pub_source not in issues[rname]:
97 continue
98 elif ('rate' not in issues[rname][pub_source] and
99 'buckets' not in issues[rname][pub_source] and
100- pups):
101+ pbs):
102 # there is not an error so increment the phasing
103 current_pup = issues[rname][pub_source]['pup']
104 new_pup = current_pup + PUP_INCREMENT
105 if not options.no_act:
106 set_pup(current_pup, new_pup, release, suite, src_pkg)
107 issues[rname][pub_source]['pup'] = new_pup
108- elif pups:
109+ elif pbs:
110 # there is an error and pup is not None so stop the phasing
111 current_pup = issues[rname][pub_source]['pup']
112 issues[rname][pub_source]['previous_pup'] = current_pup

Subscribers

People subscribed via source and target branches