Basil Eljuse | 4b14afb | 2020-09-30 13:07:23 +0100 | [diff] [blame] | 1 | #!/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 | |
| 18 | from github import GitHub, ApiError, ApiNotFoundError |
| 19 | |
| 20 | try: |
| 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 | |
| 42 | except ApiNotFoundError as e: |
| 43 | print(e, e.request, e.response) |