TPE-195 Reference creation fail to detect git change 08/144908/1
authorhyokeun <hyokeun.jeon@samsung.com>
Fri, 18 Aug 2017 09:16:54 +0000 (18:16 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Fri, 18 Aug 2017 09:16:57 +0000 (18:16 +0900)
Problem: Git repository change check was not implemented.
Fix: Compare git path from source project and manifest.

Change-Id: Ie0926750afdf40325a1a4fbe95f585612da1eeb8

job_ref_create_prj_obs.py

index f43ea96..19ce4ce 100644 (file)
@@ -590,7 +590,20 @@ class ref_create_project_obs(object):
             print "\n********"
             print "  1) package list of target project \n %s" %(package_list)
 
+            manifest_packages = self.get_manifest_filelists_snapshot(self.profile, \
+                                                 os.path.join(os.getenv("URL_PUBLIC_REPO_BASE"), \
+                                                 snapshotdir,\
+                                                 "builddata/manifest"))
+            # Changed git repo check
+            git_changed_packages = []
+            for x in todo_dict:
+                if todo_dict[x].get('git', None) and todo_dict[x].get('git') not in manifest_packages:
+                    print 'Git repository change detected! %s' % todo_dict[x]
+                    git_changed_packages.append(x)
+                    package_list.remove(x)
+
             packages = self.remove_duplicates(package_list, remote_package_list)
+            packages.extend(git_changed_packages)
             print "\n********"
             print "  2) remove package %s" %(packages)
             for pkgname in packages:
@@ -610,10 +623,6 @@ class ref_create_project_obs(object):
  
             print "\n********"
             print "  4) compare package project "
-            manifest_packages = self.get_manifest_filelists_snapshot(self.profile, \
-                                                 os.path.join(os.getenv("URL_PUBLIC_REPO_BASE"), \
-                                                 snapshotdir,\
-                                                 "builddata/manifest"))
             todo_dict = self.compare_with_manifest(todo_dict, manifest_packages)
             print '\nCompare With Manifest Done at %s' % (str(datetime.now()))