scripts/regression-hotspots.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
New commits: commit 70ce608fbfd5193f59b16b72b6a0e22fa60b3613 Author: Rafał Dobrakowski <dobrakowskira...@gmail.com> AuthorDate: Sun Apr 7 00:35:14 2024 +0200 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Sun Apr 7 16:44:35 2024 +0200 Addition of https address opening - without certificates Change-Id: I80760b6fdea58cc7591197f1d407552d07e631d1 Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/165862 Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> diff --git a/scripts/regression-hotspots.py b/scripts/regression-hotspots.py index cec27816..6ea80ba6 100755 --- a/scripts/regression-hotspots.py +++ b/scripts/regression-hotspots.py @@ -12,19 +12,28 @@ import sys import re import git +import ssl + from urllib.request import urlopen, URLError from io import BytesIO + def get_fixed_regression_bugs(): url = 'https://bugs.documentfoundation.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&bug_status=NEEDINFO&bug_status=PLEASETEST&columnlist=&keywords=regression%2C%20&keywords_type=allwords&limit=0&list_id=354018&product=LibreOffice&query_format=advanced&resolution=FIXED&ctype=csv&human=0' + + ctx = ssl.create_default_context() + ctx.check_hostname = False + ctx.verify_mode = ssl.CERT_NONE + try: - resp = urlopen(url) + resp = urlopen(url, context=ctx) except URLError: - sys.stderr.write('Error fetching {}'.format(url)) + sys.stderr.write('Error fetching {} -> {} '.format(url, URLError.errno)) sys.exit(1) bug_ids=[] for line in [raw.decode('utf-8').strip(' ') for raw in BytesIO(resp.read())][1:]: bug_ids.append(int(line)) return bug_ids + def get_dir_counts(file_counts, level): dir_counts = {} for (filename, count) in file_counts.items(): @@ -36,15 +45,18 @@ def get_dir_counts(file_counts, level): else: dir_counts[dirpart]=count return dir_counts + def print_counts(counts): printorder = reversed(sorted((count, name) for (name, count) in counts.items())) for count in printorder: print('%5d %s' % (count[0], count[1])) + if __name__ == '__main__': file_counts = {} excluderegex = re.compile(r'qa/|icon-themes/|extras/source/gallery/|extras/source/palettes/|extras/source/templates/|extras/source/truetype/|helpcontent2|dictionaries|translations|download\.lst|\.png|\.patch') fixed_regression_ids = get_fixed_regression_bugs() sys.stderr.write('found %d fixed regressions: %s ' % (len(fixed_regression_ids), fixed_regression_ids)) + for bug_id in fixed_regression_ids: sys.stderr.write('working on bug %d ' % bug_id) lognames = git.Git('.').execute(['git', 'log', '--grep=[fdo|tdf]#'+str(bug_id), '--pretty=tformat:', '--name-only']) @@ -56,6 +68,7 @@ if __name__ == '__main__': file_counts[filename]+=1 else: file_counts[filename]=1 + print('=== files === ') print_counts(file_counts) print(' === fourth level dirs === ')