summaryrefslogtreecommitdiff
path: root/util/dependency_updater/tools/toolbox.py
diff options
context:
space:
mode:
authorDaniel Smith <daniel.smith@qt.io>2022-03-07 12:29:22 +0100
committerDaniel Smith <Daniel.Smith@qt.io>2022-03-30 12:08:27 +0000
commite3205793dc15bcc09a49f8080470169c6246a9c5 (patch)
tree867497e22587ea5a232f36533db51275b0efca0c /util/dependency_updater/tools/toolbox.py
parentd192c1e50674ec244e1c2edbbcf41479d91c30b9 (diff)
downloadqtrepotools-e3205793dc15bcc09a49f8080470169c6246a9c5.tar.gz
Have the Submodule Update Utility catch manually merged updates
If a change is manually merged after the utility has marked it as failed, the utility should pick up on this so the round can continue automatically without further user action. This change also updates calls to any() to directly pass an iterator rather than computing a value set through list comprehension. Change-Id: I18a5511de30e92e4276ef596c8ae2011f297dd63 Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Diffstat (limited to 'util/dependency_updater/tools/toolbox.py')
-rw-r--r--util/dependency_updater/tools/toolbox.py10
1 files changed, 7 insertions, 3 deletions
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