From 8bd49e05cce0eabd4a7875be670b94234a32b973 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 4 Sep 2015 18:37:32 +0200 Subject: [PATCH] add site labels to issues --- bin/generate-issues | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/generate-issues b/bin/generate-issues index 8954120..af7a3a7 100755 --- a/bin/generate-issues +++ b/bin/generate-issues @@ -58,6 +58,11 @@ SITES = { 'SR' => 'Simula Research Laboratory', } +REVERSE_SITES = {} +SITES.each_pair do |key, name| + REVERSE_SITES[name] = key +end + #------------------- Parsing proposal.pdata --------------------- def split_line(line) @@ -382,11 +387,14 @@ def populate_workpackage(github, repo, workpackage) end workpackage['tasks'].each_value do |task| + org_labels = [REVERSE_SITES[task['lead']]] + \ + (task['partners'] or []).map {|site| REVERSE_SITES[site]} + make_task_issue(github, repo, task, { :labels => [ 'task', workpackage['label'], - ] + ] + org_labels }) end workpackage['deliverables'].each do |deliverable| @@ -396,6 +404,7 @@ def populate_workpackage(github, repo, workpackage) :labels => [ 'deliverable', workpackage['label'], + REVERSE_SITES[deliverable['lead']] ] }) end