blob: 8725909c19e7ee666d5fcd4d5ac92f6509834474 [file] [log] [blame]
Basil Eljuse4b14afb2020-09-30 13:07:23 +01001#!/usr/bin/env python3
2
3__copyright__ = """
4/*
5 * Copyright (c) 2020, Arm Limited. All rights reserved.
6 *
7 * SPDX-License-Identifier: BSD-3-Clause
8 *
9 */
10 """
11
12""" tfa_defects.py:
13
14 Retrieves TF-A defects from GitHub
15
16"""
17
18from github import GitHub, ApiError, ApiNotFoundError
19
20try:
21 token = "<GitHub Access Token>"
22 gh = GitHub(access_token=token)
23
24 # Please note that currently 'open' defects are reported
25 # In future, labels='bug' would be used for defect density
26 open_bug_issues = gh.repos(
27 'ARM-software')('tf-issues').issues.get(state='open', labels='bug')
28
29 bugCounter = 0
30
31 TFA_URL = "https://github.com/ARM-software/tf-issues/issues/"
32
33 for issue in open_bug_issues:
34 print("Found open bug with id: %s: %s, %s" %
35 (issue.number, issue.title, issue.state))
36 bugCounter += 1
37
38 print("\t url for this issue is: %s" % (TFA_URL + str(issue.number)))
39
40 print("@@ Total number of open bugs: %d" % (bugCounter))
41
42except ApiNotFoundError as e:
43 print(e, e.request, e.response)