From fc83ceea2065c13345d4459b20360870834f61c3 Mon Sep 17 00:00:00 2001 From: Adam Saleh Date: Feb 06 2020 11:32:13 +0000 Subject: Changed the clone_and_bump to clone_bump_commit, doesn't do pushes and side-tag anymore, that happens at once, afterwards. --- diff --git a/monitor_gating_multi_builds.py b/monitor_gating_multi_builds.py index 5ff0769..2bcfdba 100644 --- a/monitor_gating_multi_builds.py +++ b/monitor_gating_multi_builds.py @@ -81,11 +81,18 @@ def main(args): print(f"Working in {folder}\n") nevrs = {} - # Bump the release on both packages: - nevrs, side_tag_name = utils.clone_and_bump( - folder, nevrs, conf, conf["name_multi_1"], new_side_tag=True) - nevrs, _ = utils.clone_and_bump( - folder, nevrs, conf, conf["name_multi_2"], target=side_tag_name) + # Bump the release on first package: + nevrs, folder_1, branch_1 = utils.clone_bump_commit( + folder, nevrs, conf, conf["name_multi_1"]) + # Create a side-tag + side_tag_name = utils.create_side_tag(conf["fedpkg"], folder=folder_1) + # Bump the release on second package: + nevrs, folder_2, branch_2 = utils.clone_bump_commit( + folder, nevrs, conf, conf["name_multi_2"]) + + # Push to the main repo + utils.push_changes(folder_1, "origin", branch_1) + utils.push_changes(folder_2, "origin", branch_2) # Chain-build the packages utils.chain_build_packages( diff --git a/utils.py b/utils.py index 7fc042c..38db77a 100644 --- a/utils.py +++ b/utils.py @@ -676,7 +676,7 @@ class MonitoringUtils: return side_tag_name - def clone_and_bump(self, folder, nevrs, conf, name, target=None, new_side_tag=False): + def clone_bump_commit(self, folder, nevrs, conf, name): """Clone the repo, bump the release, commit and push.""" namespace = conf["namespace"] branch = conf["branch"] @@ -684,19 +684,13 @@ class MonitoringUtils: self.clone_repo(conf["fedpkg"], namespace, name, folder=folder) gitfolder = os.path.join(folder, name) self.switch_branch(conf["fedpkg"], branch, folder=gitfolder) - side_tag_name = None - # Create a side-tag - if new_side_tag: - side_tag_name = self.create_side_tag(conf["fedpkg"], folder=gitfolder) - target = side_tag_name + self.bump_release(name, folder=gitfolder) self.commit_changes("Bump release", folder=gitfolder) nevr = self.get_nevr(conf["fedpkg"], folder=gitfolder) nevrs[name] = nevr - # Push to the main repo - self.push_changes(gitfolder, "origin", branch) print(f" Upcoming build : {nevr}") - return (nevrs, target) + return (nevrs, gitfolder, branch) def run_command(command, cwd=None):