Merge lp:~mabac/launchpad-work-items-tracker/external-config into lp:~linaro-automation/launchpad-work-items-tracker/linaro

Proposed by Mattias Backman
Status: Merged
Merged at revision: 328
Proposed branch: lp:~mabac/launchpad-work-items-tracker/external-config
Merge into: lp:~linaro-automation/launchpad-work-items-tracker/linaro
Diff against target: 62 lines (+7/-6)
2 files modified
all-projects (+4/-1)
collect_roadmap (+3/-5)
To merge this branch: bzr merge lp:~mabac/launchpad-work-items-tracker/external-config
Reviewer Review Type Date Requested Status
Guilherme Salgado (community) Approve
Review via email: mp+89918@code.launchpad.net

Description of the change

Hi,

This branch move the setting of current lane to an external config file. We can maintain this file next to the milestone cfg files in linaro-config for instance.

Thanks,

Mattias

To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote :

Nice and simple!

 review approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'all-projects'
2--- all-projects 2011-12-07 09:03:27 +0000
3+++ all-projects 2012-01-24 15:17:24 +0000
4@@ -69,6 +69,8 @@
5 def main():
6 parser = optparse.OptionParser(usage="%prog <database dir> <www root dir> [www root url]")
7 parser.add_option("--config-dir", dest="config_dir", default="config")
8+ parser.add_option("--roadmap-config-file", dest="roadmap_config_file",
9+ default="roadmap-config")
10 parser.add_option("--debug", dest="debug", action="store_true")
11 parser.add_option("--token-file", dest="token_file")
12 opts, args = parser.parse_args()
13@@ -133,7 +135,8 @@
14 else:
15 sys.stderr.write("No API token given to collect_roadmap for %s" % project_name)
16
17- if not collect_roadmap(source_dir, db_file, config_file, extra_collect_roadmap_args):
18+ if not collect_roadmap(source_dir, db_file, args.roadmap_config_file,
19+ extra_collect_roadmap_args):
20 sys.stderr.write("collect_roadmap failed for %s" % project_name)
21
22 publish_new_db(project_name, project_output_dir, db_file)
23
24=== modified file 'collect_roadmap'
25--- collect_roadmap 2011-12-22 11:53:37 +0000
26+++ collect_roadmap 2012-01-24 15:17:24 +0000
27@@ -32,8 +32,6 @@
28 logger = logging.getLogger("linaroroadmap")
29
30
31-CURRENT_LANE = '2011Q4' # Until we find how to keep this in an external config.
32-
33 def dbg(msg):
34 '''Print out debugging message if debugging is enabled.'''
35 logger.debug(msg)
36@@ -58,7 +56,7 @@
37 return data
38
39
40-def kanban_import_lanes(collector, workflow_stages):
41+def kanban_import_lanes(collector, workflow_stages, cfg):
42 nodes = {}
43 root_node_id = None
44 lanes_to_ignore = ['Legend']
45@@ -83,7 +81,7 @@
46 assert node['parent_id'] == root_node_id
47 model_lane = Lane(get_json_item(node, 'name'),
48 node['id'])
49- if model_lane.name == CURRENT_LANE:
50+ if model_lane.name == cfg['current_lane']:
51 model_lane.is_current = True
52 else:
53 model_lane.is_current = False
54@@ -157,7 +155,7 @@
55 assert board is not None, "Could not access board %s." % board_id
56 card_types = board['board']['card_types']
57 status_list = kanban_import_lanes(collector,
58- board['board']['workflow_stages'])
59+ board['board']['workflow_stages'], cfg)
60
61 tasks_url = get_kanban_url('boards/%s/tasks.json' % board_id, api_token)
62 tasks = get_json_data(tasks_url)

Subscribers

People subscribed via source and target branches