Skip to content

Commit

Permalink
fedora-bot: Continue after failure
Browse files Browse the repository at this point in the history
Fedora Bot can handle more than one component to be processed.
The components are processed one by one in the loop. When processing of
component fails it breaks the loop. This commit fixes this adding
exception for such case and continuing with the next component.
  • Loading branch information
elkoniu authored and thozza committed Sep 10, 2024
1 parent e1ae402 commit 1133320
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions fedora_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,24 +317,28 @@ def main():
parser.error(f"Invalid component format, must be PACKAGE:NUM_TESTS : {component_numtests}")

print(f"\n--- {component} ---\n")
if args.apikey:
msg_info(f"Checking for open pull requests of {component}...")
merge_open_pull_requests(args, component, num_tests)
else:
msg_info("No Fedora account API key supplied - skipping merging of pull requests.")

if args.user and args.password: # Only check Bodhi if credentials were supplied
msg_info(f"Checking for missing updates of '{component}'...")
missing_updates = get_missing_updates(component, fedoras)

if missing_updates:
msg_info(f"Found missing updates in Bodhi: {missing_updates}")
publish_updates(args, component, missing_updates)
msg_ok(f"Tried to update {missing_updates}.")
try:
if args.apikey:
msg_info(f"Checking for open pull requests of {component}...")
merge_open_pull_requests(args, component, num_tests)
else:
msg_ok("No releases found with missing updates.")
else:
msg_info("No Fedora credentials supplied - skipping Bodhi updates.")
msg_info("No Fedora account API key supplied - skipping merging of pull requests.")

if args.user and args.password: # Only check Bodhi if credentials were supplied
msg_info(f"Checking for missing updates of '{component}'...")
missing_updates = get_missing_updates(component, fedoras)

if missing_updates:
msg_info(f"Found missing updates in Bodhi: {missing_updates}")
publish_updates(args, component, missing_updates)
msg_ok(f"Tried to update {missing_updates}.")
else:
msg_ok("No releases found with missing updates.")
else:
msg_info("No Fedora credentials supplied - skipping Bodhi updates.")
except Exception as error:
print(f"Failure in processing component [{component}] - skipping")
print(f"Exception: {error=}, {type(error)=}")


if __name__ == "__main__":
Expand Down

0 comments on commit 1133320

Please sign in to comment.