]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
suite/run.py: update sha1 from basic_config to parsed_yaml
authorVallari Agrawal <val.agl002@gmail.com>
Tue, 1 Jul 2025 14:10:01 +0000 (19:40 +0530)
committerVallari Agrawal <val.agl002@gmail.com>
Tue, 1 Jul 2025 15:15:19 +0000 (20:45 +0530)
This is because during backtracking to find
build when using --newest, the new build/suite
sha is updated on basic_config. And job's parsed_yaml
is never updated with new sha.

Fixes: https://tracker.ceph.com/issues/71612
Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
teuthology/misc.py
teuthology/suite/run.py

index 93bdc7a4d28e00b24c842bb162680977891a5c0b..d4c619cc548a248f8a6b5c0de3c99420701813aa 100644 (file)
@@ -1009,6 +1009,17 @@ def deep_merge(a: DeepMerge, b: DeepMerge) -> DeepMerge:
         return a
     return b
 
+def update_key(key_to_update, a: dict, b: dict):
+    """
+    Update key (`key_to_update`) of dict `a` on all levels
+    to the values of same key in `b` dict.
+    """
+    for key, value in b.items():
+        if key == key_to_update:
+            a[key] = value
+        elif isinstance(value, dict):
+            if key in a and isinstance(a[key], dict):
+                update_key(key_to_update, a[key], value)
 
 def ssh_keyscan(hostnames, _raise=True):
     """
index 8115c4122ef891b85a7eeae1364d27a589f987e6..0f76fb746d9573153573d223cd81cc43bdb1257d 100644 (file)
@@ -15,7 +15,7 @@ from teuthology.config import config, JobConfig
 from teuthology.exceptions import (
     BranchMismatchError, BranchNotFoundError, CommitNotFoundError,
 )
-from teuthology.misc import deep_merge, get_results_url
+from teuthology.misc import deep_merge, get_results_url, update_key
 from teuthology.orchestra.opsys import OS
 from teuthology.repo_utils import build_git_url
 
@@ -506,6 +506,8 @@ class Run(object):
                 log.info('Skipping due to excluded_os_type: %s facets %s',
                          exclude_os_type, description)
                 continue
+            update_key('sha1', parsed_yaml, self.base_config) 
+            update_key('suite_sha1', parsed_yaml, self.base_config) 
 
             arg = copy.deepcopy(self.base_args)
             arg.extend([