@@ -75,7 +75,7 @@ class Bug:
def get_data():
url_re = r"(?P<server>https?://.+yocto.+/)#/?builders/(?P<builder>\d+)/builds/(?P<build>\d+)"
- logging.debug("Searching bugzilla for AB-INT bugs...")
+ logging.info("Searching bugzilla for AB-INT bugs...")
bz = bugzilla.Bugzilla("https://bugzilla.yoctoproject.org/rest")
# add limit=5 for speed
query = bz.build_query(
@@ -91,10 +91,12 @@ def get_data():
for bug in bugs
]
- pprint.pprint(bugs)
- print(f"Found {len(bugs)} AB-INT bugs")
+ logging.info(f"Found {len(bugs)} AB-INT bugs: {", ".join(str(bug.id) for bug in bugs)}")
+ logging.info("Fetching bugzilla comments...")
comments_data = bz.get_comments([bug.id for bug in bugs])["bugs"]
+
+ logging.info("Scanning for autobuilder link...")
for bug in bugs:
for comment in comments_data[str(bug.id)]["comments"]:
for match in re.finditer(url_re, comment["text"]):
@@ -109,6 +111,7 @@ def get_data():
bug.seen.append(started_at)
except requests.exceptions.HTTPError as e:
logging.debug(f"Couldn't find build for {builder=} {build=}")
+ logging.info(f"Bug {bug.id} was seen {len(bug.seen)} times")
json_str = json.dumps([bug.to_dict() for bug in bugs], indent=2,)
@@ -124,8 +127,7 @@ if __name__ == "__main__":
parser.add_argument("--cached", action="store_true", help="Use the local cached data instead of fetching")
args = parser.parse_args()
- if args.verbose:
- logging.basicConfig(level=logging.DEBUG)
+ logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO)
if args.cached:
logging.debug(f"Loading cached data from {CACHE_NAME}")
Add more logging so if the script produces bad data we can tell from the output. Signed-off-by: Ross Burton <ross.burton@arm.com> --- scripts/abint/abint.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)