add work package title to issues
This commit is contained in:
parent
8bd49e05cc
commit
d25c4f180a
@ -262,6 +262,8 @@ See page %{page} of the [proposal](#{PROPOSAL_URL}) for the full description.
|
|||||||
END
|
END
|
||||||
|
|
||||||
TASK_TPL = <<-END
|
TASK_TPL = <<-END
|
||||||
|
Work Package %{wptitle}
|
||||||
|
|
||||||
Lead Institution: %{lead}
|
Lead Institution: %{lead}
|
||||||
|
|
||||||
Partners: %{partners}
|
Partners: %{partners}
|
||||||
@ -270,6 +272,8 @@ Work phases: %{wphases}
|
|||||||
END
|
END
|
||||||
|
|
||||||
DELIV_TPL = <<-END
|
DELIV_TPL = <<-END
|
||||||
|
Work Package %{wptitle}
|
||||||
|
|
||||||
Lead Institution: %{lead}
|
Lead Institution: %{lead}
|
||||||
|
|
||||||
Due: %{date} (month %{month})
|
Due: %{date} (month %{month})
|
||||||
@ -280,12 +284,13 @@ END
|
|||||||
DELIV_MILESTONE_TPL = "# %{title}\n\n#{DELIV_TPL}"
|
DELIV_MILESTONE_TPL = "# %{title}\n\n#{DELIV_TPL}"
|
||||||
|
|
||||||
|
|
||||||
def make_task_issue(github, repo, task, options)
|
def make_task_issue(github, repo, task, workpackage, options)
|
||||||
title = "#{task['label']}: #{task['title']}"
|
title = "#{task['label']}: #{task['title']}"
|
||||||
issues = get_issues(github, repo)
|
issues = get_issues(github, repo)
|
||||||
issue = issues.find { |i| i.title.start_with?(task['label'] + ':') }
|
issue = issues.find { |i| i.title.start_with?(task['label'] + ':') }
|
||||||
if issue.nil?
|
if issue.nil?
|
||||||
body = TASK_TPL % {
|
body = TASK_TPL % {
|
||||||
|
wptitle: "#{workpackage['label']}: #{workpackage['title']}",
|
||||||
lead: task['lead'],
|
lead: task['lead'],
|
||||||
wphases: task['wphases'],
|
wphases: task['wphases'],
|
||||||
partners: (task['partners'] or ['None']).join(', ')
|
partners: (task['partners'] or ['None']).join(', ')
|
||||||
@ -309,12 +314,13 @@ def make_task_issue(github, repo, task, options)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def make_deliverable_issue(github, repo, deliverable, options)
|
def make_deliverable_issue(github, repo, deliverable, workpackage, options)
|
||||||
title = "#{deliverable['label']}: #{deliverable['title']}"
|
title = "#{deliverable['label']}: #{deliverable['title']}"
|
||||||
issues = get_issues(github, repo)
|
issues = get_issues(github, repo)
|
||||||
issue = issues.find { |i| i.title.start_with?(deliverable['label'] + ':') }
|
issue = issues.find { |i| i.title.start_with?(deliverable['label'] + ':') }
|
||||||
if issue.nil?
|
if issue.nil?
|
||||||
body = DELIV_TPL % {
|
body = DELIV_TPL % {
|
||||||
|
wptitle: "#{workpackage['label']}: #{workpackage['title']}",
|
||||||
lead: deliverable['lead'],
|
lead: deliverable['lead'],
|
||||||
date: deliverable['due_date'],
|
date: deliverable['due_date'],
|
||||||
month: deliverable['month'],
|
month: deliverable['month'],
|
||||||
@ -338,13 +344,14 @@ def make_deliverable_issue(github, repo, deliverable, options)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def make_deliverable_milestone(github, repo, deliverable)
|
def make_deliverable_milestone(github, repo, deliverable, workpackage)
|
||||||
title = deliverable['label']
|
title = deliverable['label']
|
||||||
|
|
||||||
milestone = get_milestones(github, repo).find { |ms| ms.title == title }
|
milestone = get_milestones(github, repo).find { |ms| ms.title == title }
|
||||||
if milestone.nil?
|
if milestone.nil?
|
||||||
puts "Making milestone on #{repo}: #{title}"
|
puts "Making milestone on #{repo}: #{title}"
|
||||||
body = DELIV_MILESTONE_TPL % {
|
body = DELIV_MILESTONE_TPL % {
|
||||||
|
wptitle: "#{workpackage['label']}: #{workpackage['title']}",
|
||||||
title: deliverable['title'],
|
title: deliverable['title'],
|
||||||
lead: deliverable['lead'],
|
lead: deliverable['lead'],
|
||||||
date: deliverable['due_date'],
|
date: deliverable['due_date'],
|
||||||
@ -390,16 +397,16 @@ def populate_workpackage(github, repo, workpackage)
|
|||||||
org_labels = [REVERSE_SITES[task['lead']]] + \
|
org_labels = [REVERSE_SITES[task['lead']]] + \
|
||||||
(task['partners'] or []).map {|site| REVERSE_SITES[site]}
|
(task['partners'] or []).map {|site| REVERSE_SITES[site]}
|
||||||
|
|
||||||
make_task_issue(github, repo, task, {
|
make_task_issue(github, repo, task, workpackage,
|
||||||
:labels => [
|
:labels => [
|
||||||
'task',
|
'task',
|
||||||
workpackage['label'],
|
workpackage['label'],
|
||||||
] + org_labels
|
] + org_labels
|
||||||
})
|
)
|
||||||
end
|
end
|
||||||
workpackage['deliverables'].each do |deliverable|
|
workpackage['deliverables'].each do |deliverable|
|
||||||
milestone = make_deliverable_milestone(github, repo, deliverable)
|
milestone = make_deliverable_milestone(github, repo, deliverable, workpackage)
|
||||||
make_deliverable_issue(github, repo, deliverable, {
|
make_deliverable_issue(github, repo, deliverable, workpackage, {
|
||||||
:milestone => milestone,
|
:milestone => milestone,
|
||||||
:labels => [
|
:labels => [
|
||||||
'deliverable',
|
'deliverable',
|
||||||
|
Loading…
Reference in New Issue
Block a user