diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/dependency_updater/main.py | 10 | ||||
-rw-r--r-- | util/dependency_updater/tools/toolbox.py | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/util/dependency_updater/main.py b/util/dependency_updater/main.py index eaefd60..26f976a 100644 --- a/util/dependency_updater/main.py +++ b/util/dependency_updater/main.py @@ -322,11 +322,15 @@ def main(): # Determine how to exit clear_state = False - if not any([r.progress for r in config.state_data.values() if - r.progress < Repo.PROGRESS.DONE.value]): + if not any(r.progress < Repo.PROGRESS.DONE for r in config.state_data.values()): if config.args.simulate: print("INFO: Done with this round, but not clearing state because --sim was used.") - elif config.args.pause_on_finish_fail and not config.state_data.get("pause_on_finish_fail"): + elif (config.args.pause_on_finish_fail # The args say to pause on failure + and not config.state_data.get("pause_on_finish_fail") # And not already paused + # And are there any real failures that should cause us to pause. + and any(r.progress == Repo.PROGRESS.DONE_FAILED_BLOCKING for r in + config.state_data.values())): + # Set the flag and report the error. print( "Done with this round: Running in Pause On Finish Fail mode. Not resetting state.") config.state_data["pause_on_finish_fail"] = Repo.Repo(id="pause_on_finish_fail", diff --git a/util/dependency_updater/tools/toolbox.py b/util/dependency_updater/tools/toolbox.py index 10c45bf..9b3a15c 100644 --- a/util/dependency_updater/tools/toolbox.py +++ b/util/dependency_updater/tools/toolbox.py @@ -560,7 +560,7 @@ def get_check_progress(config: Config, repo: Repo) -> (PROGRESS, str, str): """Determine the progress status of a submodule update :returns: progress: PROGRESS, merged_ref: str, gerrit_change_status: str[NEW, MERGED, STAGED, INTEGRATING, ABANDONED]""" - if repo.progress >= PROGRESS.DONE: + if repo.progress in [PROGRESS.DONE, PROGRESS.DONE_NO_UPDATE, PROGRESS.IGNORE_IS_META]: return repo.progress, repo.proposal.merged_ref, "MERGED" elif repo.proposal.proposed_yaml and not repo.proposal.change_id: if repo.proposal.inconsistent_set: @@ -568,6 +568,9 @@ def get_check_progress(config: Config, repo: Repo) -> (PROGRESS, str, str): else: return PROGRESS.READY, "", "" elif repo.proposal.change_id: + # This condition also catches DONE_FAILED_BLOCKING and DONE_FAILED_NON_BLOCKING + # So that if a change was manually merged without the bot's help, + # it gets picked up and marked as merged. change = config.datasources.gerrit_client.changes.get(repo.proposal.change_id) remote_status = change.status if remote_status == "NEW" and repo.progress == PROGRESS.IN_PROGRESS and repo.stage_count > 0: @@ -809,8 +812,9 @@ def push_submodule_update(config: Config, repo: Repo, retry: bool = False) -> Pr def do_try_supermodule_updates(config: Config) -> dict[str, Repo]: """Push supermodule updates if needed""" blocking_repos = [r for r in config.state_data.values() if not r.is_non_blocking] - if not any([r for r in blocking_repos if r.id not in ["qt/qt5", "yocto/meta-qt6"] - and (r.progress < PROGRESS.DONE or r.progress == PROGRESS.DONE_FAILED_BLOCKING)]): + if not any((r.progress < PROGRESS.DONE or r.progress == PROGRESS.DONE_FAILED_BLOCKING) + and r.id not in ["qt/qt5", "yocto/meta-qt6"] + for r in blocking_repos): if config.args.update_supermodule: supermodule = push_supermodule_update(config) config.state_data[supermodule.id] = supermodule |