Merge lp:~james-w/launchpad-work-items-tracker/multi-project into lp:launchpad-work-items-tracker

Proposed by James Westby on 2010-12-06
Status: Merged
Merge reported by: Clint Byrum
Merged at revision: not available
Proposed branch: lp:~james-w/launchpad-work-items-tracker/multi-project
Merge into: lp:launchpad-work-items-tracker
Diff against target: 50 lines (+21/-8)
1 file modified
collect (+21/-8)
To merge this branch: bzr merge lp:~james-w/launchpad-work-items-tracker/multi-project
Reviewer Review Type Date Requested Status
Clint Byrum (community) 2010-12-06 Approve on 2010-12-08
Jamie Bennett (community) 2010-12-06 Needs Fixing on 2010-12-07
Review via email: mp+42893@code.launchpad.net

Description of the Change

Hi,

This adds a new feature that we need for Linaro, now that we are tracking work
that is going on in multiple projects.

It adds a new configuration option so that you can specify a list of
additional projects to fetch from. I did this to maintain compatibility with
all existing configurations.

Thanks,

James

To post a comment you must log in.
Jamie Bennett (jamiebennett) wrote :

Looks like you have a conflict there.

review: Needs Fixing
James Westby (james-w) wrote :

On Tue, 07 Dec 2010 12:49:43 -0000, Jamie Bennett <email address hidden> wrote:
> Review: Needs Fixing
> Looks like you have a conflict there.

Fixed.

Thanks,

James

242. By James Westby on 2010-12-07

Merge trunk.

243. By James Westby on 2010-12-07

Drop the now dead inprogress_teams argument.

Clint Byrum (clint-fewbar) wrote :

Upon running with a single 'extra_projects' defined I get this error:

clint@clint-MacBookPro:~/src/wi/bzr/trunk$ ./collect -d ../natty.db -c ../natty.cfg --debug
Traceback (most recent call last):
  File "./collect", line 962, in <module>
    lp_import(db, cfg, opts.pattern)
  File "./collect", line 569, in lp_import
    import_project(extra_project)
  File "./collect", line 552, in import_project
    lp_import_milestones(lp, db, project_name, True)
TypeError: lp_import_milestones() takes exactly 2 arguments (4 given)

extra_projects = [ 'pipemeter' ]

review: Needs Fixing
244. By James Westby on 2010-12-08

Fix the error caused by a mismerge.

Clint Byrum (clint-fewbar) wrote :

Working fine now after revno 244.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'collect'
2--- collect 2010-12-08 10:47:18 +0000
3+++ collect 2010-12-08 23:15:10 +0000
4@@ -546,25 +546,38 @@
5
6 lp = Launchpad.login_with('ubuntu-work-items', service_root=EDGE_SERVICE_ROOT)
7
8+ urls = []
9+
10+ def import_project(project):
11+ lp_import_milestones(project, db)
12+ url = '%s/%s/+specs?batch=300' % (
13+ report_tools.blueprints_base_url, project.name)
14+ urls.append(url)
15+
16 if 'release' in cfg:
17 lp_project = lp.distributions['ubuntu'].getSeries(name_or_version=cfg['release'])
18 url = '%s/ubuntu/%s/+specs?batch=300' % (
19 report_tools.blueprints_base_url, cfg['release'])
20+ urls.append(url)
21 else:
22 assert 'project' in cfg, 'Configuration needs to specify project or release'
23 lp_project = lp.projects[cfg['project']]
24- url = '%s/%s/+specs?batch=300' % (
25- report_tools.blueprints_base_url, cfg['project'])
26+ import_project(cfg['project'])
27+
28+ extra_projects = cfg.get('extra_projects', [])
29+ for extra_project_name in extra_projects:
30+ extra_project = lp.projects[extra_project_name]
31+ import_project(extra_project)
32
33 lp_import_milestones(lp_project, db)
34 lp_import_teams(lp, db, cfg)
35
36- for (bp, (url, milestone)) in lp_blueprints_from_list(url, name_pattern).iteritems():
37- dbg('lp_import(): downloading %s from %s' % (bp, url))
38- contents = urllib.urlopen(url).read().decode('UTF-8')
39- if lp_import_blueprint(db, bp, url, contents):
40- lp_import_blueprint_workitems(lp, db, bp, url, contents, cfg.get('release'))
41-
42+ for url in urls:
43+ for (bp, (url, milestone)) in lp_blueprints_from_list(url, name_pattern).iteritems():
44+ dbg('lp_import(): downloading %s from %s' % (bp, url))
45+ contents = urllib.urlopen(url).read().decode('UTF-8')
46+ if lp_import_blueprint(db, bp, url, contents):
47+ lp_import_blueprint_workitems(lp, db, bp, url, contents, cfg.get('release'))
48 lp_import_bug_workitems(lp_project, db, cfg)
49
50 ########################################################################

Subscribers

People subscribed via source and target branches

to all changes: