From a6d4e68bf121a3d0e1e626f4d288ad2b594947e2 Mon Sep 17 00:00:00 2001 From: Sona Sarmadi Date: Tue, 28 Aug 2018 07:11:55 +0200 Subject: First draft of doc copied from standard profile -updated rel-info -updated UG -added new chapterdoc for RT: Real-Time in Enea Linux Change-Id: If8cec0e29d1d6aa4a09507881d815af13dd68ee2 Signed-off-by: Sona Sarmadi --- doc/gen_known_issues.py | 122 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 doc/gen_known_issues.py (limited to 'doc/gen_known_issues.py') diff --git a/doc/gen_known_issues.py b/doc/gen_known_issues.py new file mode 100644 index 0000000..f926f9f --- /dev/null +++ b/doc/gen_known_issues.py @@ -0,0 +1,122 @@ +#!/usr/bin/python + +#------------------------------------------------------------------------------ +# +# This script generates an XML file with a table with issues in Jira. See the +# variable 'conditions' for query details. It is used bu the make system in +# the generation of the release notes. +# +# The result is printed to STDOUT. +# +# It is possible to override the generation. If there is a file named +# jiraissues_override.xml in the current directory, then that file will be +# printed instead. This mechanism can be used if the table needs manual +# modifications. +# +#------------------------------------------------------------------------------ + +from subprocess import check_output +import json, re, datetime +import time + +try: + with open("book-enea-linux-release-info/doc/jiraissues_override.xml") as f: + print f.read(), + + exit(0) + +except SystemExit: + # Printing the override file was successful. Exception raised by + # the exit() call in the try block. + exit(0) + +except IOError: + # Accessing the override file failed. Assume that it does not exist + # and proceed with normal operation. + pass + +jd = json.JSONDecoder() + +def jira_query(query): + jira_url = "http://eneaissues.enea.com" + fields = "key,summary" + query = query.replace(" ", "+") + + cmd = ["curl", + "-s", + "-D-", + "-u", "rest_reader:jira123", + "-X", "GET", + "-H", "Content-Type: application/json", + jira_url + "/rest/api/2/search?jql=" + query + "&fields=" + fields + ] + + tmp = check_output(cmd).splitlines() + tmp = jd.decode(tmp[-1]) + return tmp["issues"] + +conditions = ("project=LXCR", + "issueType=bug", + "resolution=Unresolved", + 'affectedversion="EL7_Std_ARM"' + ) + +bugs = [] + +time_str = time.strftime("%Y-%m-%d, %H:%M:%S (%Z)") + +for issue in jira_query(" and ".join(conditions)): + bugs.append((issue["key"], issue["fields"]["summary"])) + +print '' +print '' +print '
' +print ' Extracted from Jira' +print +print ' ' +print ' In the table below are the issue(s) that currently affect this specific release. Use the ticket reference provided for each issue, to look up further information if needed. Extracted at %s.' % time_str +print ' ' +print +print ' Jira query: (%s)' % "\n and ".join(conditions) +print +print ' ' +print ' ' +print ' ' +print +print ' ' +print +print ' ' +print ' ' +print ' Summary' +print +print ' Enea Ref' +print ' ' +print ' ' +print +print ' ', + +if bugs: + for bug in sorted(bugs): + print + print ' ' + print ' %s' % bug[1] + print + print ' %s' % bug[0] + print ' ' + +else: + print ' ' + print ' ' + print ' No issues found' + print ' ' + print ' ' + +print ' ' +print ' ' +print ' ' + +if bugs: + print ' Number of open bugs: %d' % len(bugs) + +print '
' -- cgit v1.2.3-54-g00ecf