summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorThomas Lundström <thomas.lundstrom@enea.com>2016-06-13 10:02:24 +0200
committerThomas Lundström <thomas.lundstrom@enea.com>2016-06-13 10:02:24 +0200
commite62a2c71e4bfc572a40f0d075c08d01382028c69 (patch)
tree9a3e42697ff6f4b18c8c9f8b257f5d59b2743a3f /doc
parent08c4038bf12e574289999cd12a30ec75995939f3 (diff)
downloadel_manifests-standard-e62a2c71e4bfc572a40f0d075c08d01382028c69.tar.gz
Added gen_known_issues.py that extracts open bugs from Jira
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/gen_known_issues.py85
-rwxr-xr-x[-rw-r--r--]doc/gen_pkgdiff.py1
2 files changed, 86 insertions, 0 deletions
diff --git a/doc/gen_known_issues.py b/doc/gen_known_issues.py
new file mode 100755
index 0000000..387fc49
--- /dev/null
+++ b/doc/gen_known_issues.py
@@ -0,0 +1,85 @@
1#!/usr/bin/python
2
3from subprocess import check_output
4import json, re, datetime
5import time
6
7jd = json.JSONDecoder()
8
9def jira_query(query):
10 jira_url = "http://eneaissues.enea.com"
11 fields = "key,summary"
12 query = query.replace(" ", "+")
13
14 cmd = ["curl",
15 "-s",
16 "-D-",
17 "-u", "rest_reader:jira123",
18 "-X", "GET",
19 "-H", "Content-Type: application/json",
20 jira_url + "/rest/api/2/search?jql=" + query + "&fields=" + fields
21 ]
22
23 tmp = check_output(cmd).splitlines()
24 tmp = jd.decode(tmp[-1])
25 return tmp["issues"]
26
27conditions = ("project=LXCR",
28 "issueType=bug",
29 "resolution=Unresolved",
30 'affectedversion="Enea Linux 6"'
31 )
32
33bugs = []
34
35time_str = time.strftime("%Y-%m-%d, %H:%M:%S (%Z)")
36
37for issue in jira_query(" and ".join(conditions)):
38 bugs.append((issue["key"], issue["fields"]["summary"]))
39
40print '<?xml version="1.0" encoding="ISO-8859-1"?>'
41print '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"'
42print '"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">'
43print '<section id="relinfo-extracted-from-jira">'
44print ' <title>Extracted from Jira</title>'
45print ' '
46print ' <para>'
47print ' This section lists open bugs in Jira. Extracted at %s.' % time_str
48print ' </para>'
49print ' '
50print ' <para><programlisting>project = "Linux CR" \\'
51print ' and issuetype = Bug \\'
52print ' and affectedVersion = "Enea Linux 6" \\'
53print ' and resolution = Unresolved</programlisting></para>'
54print ' '
55print ' <informaltable>'
56print ' <tgroup cols="2">'
57print ' <colspec colwidth="6*" />'
58print ' '
59print ' <colspec align="center" colwidth="1*" />'
60print ' '
61print ' <thead>'
62print ' <row>'
63print ' <entry align="center">Summary</entry>'
64print ' '
65print ' <entry>Enea Ref</entry>'
66print ' </row>'
67print ' </thead>'
68print ' '
69print ' <tbody>',
70
71for bug in sorted(bugs):
72 print ''
73 print ' <row>'
74 print ' <entry>%s</entry>' % bug[1]
75 print ' '
76 print ' <entry>%s</entry>' % bug[0]
77 print ' </row>'
78
79print ' </tbody>'
80print ' </tgroup>'
81print ' </informaltable>'
82print ' <para>'
83print ' Number of open bugs: %d' % len(bugs)
84print ' </para>'
85print '</section>'
diff --git a/doc/gen_pkgdiff.py b/doc/gen_pkgdiff.py
index 4b18ae2..ddacf44 100644..100755
--- a/doc/gen_pkgdiff.py
+++ b/doc/gen_pkgdiff.py
@@ -1,3 +1,4 @@
1#!/bin/python
1############################################################################### 2###############################################################################
2# 3#
3# Diff two licenses.xml files. There are two cases: 4# Diff two licenses.xml files. There are two cases: