diff options
author | Thomas Lundström <thomas.lundstrom@enea.com> | 2016-06-13 10:02:24 +0200 |
---|---|---|
committer | Thomas Lundström <thomas.lundstrom@enea.com> | 2016-06-13 10:02:24 +0200 |
commit | e62a2c71e4bfc572a40f0d075c08d01382028c69 (patch) | |
tree | 9a3e42697ff6f4b18c8c9f8b257f5d59b2743a3f /doc | |
parent | 08c4038bf12e574289999cd12a30ec75995939f3 (diff) | |
download | el_manifests-standard-e62a2c71e4bfc572a40f0d075c08d01382028c69.tar.gz |
Added gen_known_issues.py that extracts open bugs from Jira
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/gen_known_issues.py | 85 | ||||
-rwxr-xr-x[-rw-r--r--] | doc/gen_pkgdiff.py | 1 |
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 | |||
3 | from subprocess import check_output | ||
4 | import json, re, datetime | ||
5 | import time | ||
6 | |||
7 | jd = json.JSONDecoder() | ||
8 | |||
9 | def 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 | |||
27 | conditions = ("project=LXCR", | ||
28 | "issueType=bug", | ||
29 | "resolution=Unresolved", | ||
30 | 'affectedversion="Enea Linux 6"' | ||
31 | ) | ||
32 | |||
33 | bugs = [] | ||
34 | |||
35 | time_str = time.strftime("%Y-%m-%d, %H:%M:%S (%Z)") | ||
36 | |||
37 | for issue in jira_query(" and ".join(conditions)): | ||
38 | bugs.append((issue["key"], issue["fields"]["summary"])) | ||
39 | |||
40 | print '<?xml version="1.0" encoding="ISO-8859-1"?>' | ||
41 | print '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"' | ||
42 | print '"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">' | ||
43 | print '<section id="relinfo-extracted-from-jira">' | ||
44 | print ' <title>Extracted from Jira</title>' | ||
45 | print ' ' | ||
46 | print ' <para>' | ||
47 | print ' This section lists open bugs in Jira. Extracted at %s.' % time_str | ||
48 | print ' </para>' | ||
49 | print ' ' | ||
50 | print ' <para><programlisting>project = "Linux CR" \\' | ||
51 | print ' and issuetype = Bug \\' | ||
52 | print ' and affectedVersion = "Enea Linux 6" \\' | ||
53 | print ' and resolution = Unresolved</programlisting></para>' | ||
54 | print ' ' | ||
55 | print ' <informaltable>' | ||
56 | print ' <tgroup cols="2">' | ||
57 | print ' <colspec colwidth="6*" />' | ||
58 | print ' ' | ||
59 | print ' <colspec align="center" colwidth="1*" />' | ||
60 | print ' ' | ||
61 | print ' <thead>' | ||
62 | print ' <row>' | ||
63 | print ' <entry align="center">Summary</entry>' | ||
64 | print ' ' | ||
65 | print ' <entry>Enea Ref</entry>' | ||
66 | print ' </row>' | ||
67 | print ' </thead>' | ||
68 | print ' ' | ||
69 | print ' <tbody>', | ||
70 | |||
71 | for 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 | |||
79 | print ' </tbody>' | ||
80 | print ' </tgroup>' | ||
81 | print ' </informaltable>' | ||
82 | print ' <para>' | ||
83 | print ' Number of open bugs: %d' % len(bugs) | ||
84 | print ' </para>' | ||
85 | print '</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: |