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
=== modified file 'phased-updater'
--- phased-updater 2013-08-07 16:26:41 +0000
+++ phased-updater 2013-08-19 19:39:52 +0000
@@ -240,10 +240,12 @@
240 signer)240 signer)
241 continue241 continue
242 signer_email = get_primary_email(signer)242 signer_email = get_primary_email(signer)
243 if not signer_email:
244 continue
245 pkg = spph.source_package_name243 pkg = spph.source_package_name
246 version = spph.source_package_version244 version = spph.source_package_version
245 if not signer_email:
246 logging.info('no signer email address for %s %s %s' %
247 (rname, pkg, version))
248 continue
247 signer_name = signer.name249 signer_name = signer.name
248 changer = spph.package_creator250 changer = spph.package_creator
249 if 'buckets' in spph_buckets[rname][spph]:251 if 'buckets' in spph_buckets[rname][spph]:
@@ -403,22 +405,25 @@
403 # the fraction of hours that have passed so far in the day)405 # the fraction of hours that have passed so far in the day)
404 current_amount = data['this_count']406 current_amount = data['this_count']
405 increase = current_amount - previous_amount407 increase = current_amount - previous_amount
408 logging.info('[%s/%s] increase: %s, previous_avg: %s' %
409 (release_version, src_pkg, increase,
410 previous_amount))
406 # 2013-06-20 - Fix errors api to add this411 # 2013-06-20 - Fix errors api to add this
407 link = data['web_link'] + '&version=%s' % version412 link = data['web_link'] + '&version=%s' % version
413 logging.info('Details: %s' % link)
408 return(increase, link)414 return(increase, link)
409415
410416
411def main():417def main():
412 # TODO: make email code less redundant418 # TODO: make email code less redundant
413 # TODO: Determine how to override an increased rate
414 # TODO: modify HTTP_USER_AGENT (both versions of urllib)419 # TODO: modify HTTP_USER_AGENT (both versions of urllib)
415 # TODO: Open bugs for regressions when false positives reduced420 # TODO: Open bugs for regressions when false positives reduced
416 # TODO: determine if starting p-u-p over from 0% is an issue
417 ubuntu = launchpad.distributions['ubuntu']421 ubuntu = launchpad.distributions['ubuntu']
418 archive = ubuntu.getArchive(name='primary')422 archive = ubuntu.getArchive(name='primary')
419 options.archive = archive423 options.archive = archive
420424
421 overrides = defaultdict(list)425 overrides = defaultdict(list)
426 rate_overrides = []
422 override_file = csv.reader(open(OVERRIDES, 'r'))427 override_file = csv.reader(open(OVERRIDES, 'r'))
423 for row in override_file:428 for row in override_file:
424 # package, version, problem429 # package, version, problem
@@ -427,7 +432,10 @@
427 package = row[0].strip()432 package = row[0].strip()
428 version = row[1].strip()433 version = row[1].strip()
429 problem = row[2].strip()434 problem = row[2].strip()
430 overrides[(package, version)].append(problem)435 if problem == 'increased-rate':
436 rate_overrides.append((package, version))
437 else:
438 overrides[(package, version)].append(problem)
431439
432 releases = []440 releases = []
433 for series in ubuntu.series:441 for series in ubuntu.series:
@@ -467,30 +475,46 @@
467 issues[rname][pub_source] = {}475 issues[rname][pub_source] = {}
468 issues[rname][pub_source]['buckets'] = problems476 issues[rname][pub_source]['buckets'] = problems
469 rate_increase = crash_rate_increase(rvers, src_pkg, version)477 rate_increase = crash_rate_increase(rvers, src_pkg, version)
478 # Unset the rate_increase until it is more useful
470 if rate_increase:479 if rate_increase:
480 logging.info('Disregarding rate increase for: %s' % src_pkg)
481 rate_increase = False
482 if rate_increase and (src_pkg, version) not in rate_overrides:
471 if pub_source not in issues[rname]:483 if pub_source not in issues[rname]:
472 issues[rname][pub_source] = {}484 issues[rname][pub_source] = {}
473 issues[rname][pub_source]['rate'] = rate_increase485 issues[rname][pub_source]['rate'] = rate_increase
474 pups = [pb.phased_update_percentage486 pbs = [pb for pb in pub_source.getPublishedBinaries()
475 for pb in pub_source.getPublishedBinaries()487 if pb.phased_update_percentage is not None]
476 if pb.phased_update_percentage]488 if pbs:
477 if pups:489 # the p-u-p is currently the same for all binary packages
490 last_pup = pbs[0].phased_update_percentage
478 if pub_source not in issues[rname]:491 if pub_source not in issues[rname]:
479 issues[rname][pub_source] = {}492 issues[rname][pub_source] = {}
480 issues[rname][pub_source]['pup'] = pups[0]493 # phasing has stopped so check what the max value was
494 if last_pup == 0:
495 for allpb in archive.getPublishedBinaries(
496 exact_match=True, pocket='Updates',
497 binary_name=pbs[0].binary_package_name):
498 if allpb.distro_arch_series.distroseries == release:
499 if allpb.phased_update_percentage > 0:
500 max_pup = allpb.phased_update_percentage
501 break
502 issues[rname][pub_source]['pup'] = max_pup
503 else:
504 issues[rname][pub_source]['pup'] = last_pup
481 suite = rname + '-updates'505 suite = rname + '-updates'
482 if pub_source not in issues[rname]:506 if pub_source not in issues[rname]:
483 continue507 continue
484 elif ('rate' not in issues[rname][pub_source] and508 elif ('rate' not in issues[rname][pub_source] and
485 'buckets' not in issues[rname][pub_source] and509 'buckets' not in issues[rname][pub_source] and
486 pups):510 pbs):
487 # there is not an error so increment the phasing511 # there is not an error so increment the phasing
488 current_pup = issues[rname][pub_source]['pup']512 current_pup = issues[rname][pub_source]['pup']
489 new_pup = current_pup + PUP_INCREMENT513 new_pup = current_pup + PUP_INCREMENT
490 if not options.no_act:514 if not options.no_act:
491 set_pup(current_pup, new_pup, release, suite, src_pkg)515 set_pup(current_pup, new_pup, release, suite, src_pkg)
492 issues[rname][pub_source]['pup'] = new_pup516 issues[rname][pub_source]['pup'] = new_pup
493 elif pups:517 elif pbs:
494 # there is an error and pup is not None so stop the phasing518 # there is an error and pup is not None so stop the phasing
495 current_pup = issues[rname][pub_source]['pup']519 current_pup = issues[rname][pub_source]['pup']
496 issues[rname][pub_source]['previous_pup'] = current_pup520 issues[rname][pub_source]['previous_pup'] = current_pup

Subscribers

People subscribed via source and target branches