Merge lp:~danilo/launchpad-work-items-tracker/bug-1124087 into lp:~linaro-automation/launchpad-work-items-tracker/linaro

Proposed by Данило Шеган
Status: Merged
Approved by: Stevan Radaković
Approved revision: 346
Merged at revision: 346
Proposed branch: lp:~danilo/launchpad-work-items-tracker/bug-1124087
Merge into: lp:~linaro-automation/launchpad-work-items-tracker/linaro
Diff against target: 29 lines (+9/-3)
1 file modified
collect_jira (+9/-3)
To merge this branch: bzr merge lp:~danilo/launchpad-work-items-tracker/bug-1124087
Reviewer Review Type Date Requested Status
Stevan Radaković Approve
Review via email: mp+148169@code.launchpad.net

Description of the change

Concatenate component (actually team) names when a card lists multiple components like http://cards.linaro.org/browse/CARD-372

To post a comment you must log in.
Revision history for this message
Stevan Radaković (stevanr) wrote :

Looks good, thanks.
Approve +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'collect_jira'
2--- collect_jira 2013-01-04 10:46:26 +0000
3+++ collect_jira 2013-02-13 13:02:21 +0000
4@@ -55,6 +55,11 @@
5 return data
6
7
8+def construct_team_from_components(components):
9+ '''Construct a team name from multiple component['name'] values.'''
10+ assert len(components) > 0, "Cards with no components should be ignored."
11+ return u', '.join([team['name'] for team in components])
12+
13 def jira_import(collector, cfg, opts):
14 '''Collect roadmap items from JIRA into DB.'''
15
16@@ -103,9 +108,10 @@
17 if len(components) == 0:
18 dbg('Skipping card without component (name = %s, key = %s)' %
19 (name, key))
20- # JIRA allows listing multiple components
21- assert len(components) == 1
22- model_card.team = unicode(components[0]['name'])
23+ continue
24+ # JIRA allows listing multiple components, combine them into a single
25+ # team description.
26+ model_card.team = construct_team_from_components(components)
27 model_card.priority = unicode(fields['priority']['name'])
28 size_fields = []
29 timetracking = fields['timetracking']

Subscribers

People subscribed via source and target branches