Use REST API for bug titles in mklog.
* mklog.py: Use REST API for bug title downloading.
This commit is contained in:
parent
4a5d072ad9
commit
25c284f148
|
@ -1,3 +1,7 @@
|
||||||
|
2020-05-19 Martin Liska <mliska@suse.cz>
|
||||||
|
|
||||||
|
* mklog.py: Use REST API for bug title downloading.
|
||||||
|
|
||||||
2020-05-19 Martin Liska <mliska@suse.cz>
|
2020-05-19 Martin Liska <mliska@suse.cz>
|
||||||
|
|
||||||
* gcc-changelog/git_commit.py: Add param use_commit_ts
|
* gcc-changelog/git_commit.py: Add param use_commit_ts
|
||||||
|
|
|
@ -31,8 +31,6 @@ import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import bs4
|
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from unidiff import PatchSet
|
from unidiff import PatchSet
|
||||||
|
@ -46,6 +44,8 @@ macro_regex = re.compile(r'#\s*(define|undef)\s+([a-zA-Z0-9_]+)')
|
||||||
super_macro_regex = re.compile(r'^DEF[A-Z0-9_]+\s*\(([a-zA-Z0-9_]+)')
|
super_macro_regex = re.compile(r'^DEF[A-Z0-9_]+\s*\(([a-zA-Z0-9_]+)')
|
||||||
fn_regex = re.compile(r'([a-zA-Z_][^()\s]*)\s*\([^*]')
|
fn_regex = re.compile(r'([a-zA-Z_][^()\s]*)\s*\([^*]')
|
||||||
template_and_param_regex = re.compile(r'<[^<>]*>')
|
template_and_param_regex = re.compile(r'<[^<>]*>')
|
||||||
|
bugzilla_url = 'https://gcc.gnu.org/bugzilla/rest.cgi/bug?id=%s&' \
|
||||||
|
'include_fields=summary'
|
||||||
|
|
||||||
function_extensions = set(['.c', '.cpp', '.C', '.cc', '.h', '.inc', '.def'])
|
function_extensions = set(['.c', '.cpp', '.C', '.cc', '.h', '.inc', '.def'])
|
||||||
|
|
||||||
|
@ -106,17 +106,15 @@ def sort_changelog_files(changed_file):
|
||||||
|
|
||||||
|
|
||||||
def get_pr_titles(prs):
|
def get_pr_titles(prs):
|
||||||
if not prs:
|
|
||||||
return ''
|
|
||||||
|
|
||||||
output = ''
|
output = ''
|
||||||
for pr in prs:
|
for pr in prs:
|
||||||
id = pr.split('/')[-1]
|
id = pr.split('/')[-1]
|
||||||
r = requests.get('https://gcc.gnu.org/PR%s' % id)
|
r = requests.get(bugzilla_url % id)
|
||||||
html = bs4.BeautifulSoup(r.text, features='lxml')
|
bugs = r.json()['bugs']
|
||||||
title = html.title.text
|
if len(bugs) == 1:
|
||||||
title = title[title.find('–') + 1:].strip()
|
output += '%s - %s\n' % (pr, bugs[0]['summary'])
|
||||||
output += '%s - %s\n' % (pr, title)
|
print(output)
|
||||||
|
if output:
|
||||||
output += '\n'
|
output += '\n'
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue